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,995
70367e265a3523c81431d7cc1aedc40b5c3c33f2ecafd09f3b7111937c14093e
408207db8ca1c371e44537925072b5f5dc504f70455710cbde47ad37e542ce42
d123af31290072c03dbacedccd167c2317f3216f
bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b
677a2e6106dfc8ef0a6ae19b1028765c77f86ec2
3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3
1
20,290,995
70367e265a3523c81431d7cc1aedc40b5c3c33f2ecafd09f3b7111937c14093e
408207db8ca1c371e44537925072b5f5dc504f70455710cbde47ad37e542ce42
d123af31290072c03dbacedccd167c2317f3216f
bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b
644a578154d5e384c97464dfbca60e899c60ec49
3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3
1
20,290,995
70367e265a3523c81431d7cc1aedc40b5c3c33f2ecafd09f3b7111937c14093e
408207db8ca1c371e44537925072b5f5dc504f70455710cbde47ad37e542ce42
d123af31290072c03dbacedccd167c2317f3216f
bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b
9b627384a7b22bf4a4aabd9d6952ee9256b3f514
3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3
1
20,290,995
70367e265a3523c81431d7cc1aedc40b5c3c33f2ecafd09f3b7111937c14093e
408207db8ca1c371e44537925072b5f5dc504f70455710cbde47ad37e542ce42
d123af31290072c03dbacedccd167c2317f3216f
bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b
4d0b312b041751c5659cd7d6f780d907d26a60dc
3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3
1
20,290,995
70367e265a3523c81431d7cc1aedc40b5c3c33f2ecafd09f3b7111937c14093e
408207db8ca1c371e44537925072b5f5dc504f70455710cbde47ad37e542ce42
d123af31290072c03dbacedccd167c2317f3216f
bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b
0ccf50aff47981bde07d4d8fe762d36f0c3ad11e
3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3
1
20,290,995
70367e265a3523c81431d7cc1aedc40b5c3c33f2ecafd09f3b7111937c14093e
408207db8ca1c371e44537925072b5f5dc504f70455710cbde47ad37e542ce42
d123af31290072c03dbacedccd167c2317f3216f
bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b
4050306eaf6e782b0802b45331213f0bfb886ede
3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3
1
20,290,995
70367e265a3523c81431d7cc1aedc40b5c3c33f2ecafd09f3b7111937c14093e
408207db8ca1c371e44537925072b5f5dc504f70455710cbde47ad37e542ce42
d123af31290072c03dbacedccd167c2317f3216f
bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b
bcbe26075d0346ebdb6d87900e2eb62eb1c6d893
3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3
1
20,290,995
70367e265a3523c81431d7cc1aedc40b5c3c33f2ecafd09f3b7111937c14093e
408207db8ca1c371e44537925072b5f5dc504f70455710cbde47ad37e542ce42
d123af31290072c03dbacedccd167c2317f3216f
bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b
384b5e63a04883619444f97d6d6f4cadb52d7b3d
3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3
1
20,290,995
70367e265a3523c81431d7cc1aedc40b5c3c33f2ecafd09f3b7111937c14093e
c152d8c813046c5162368db4691ca4d85ab2a8e6be8a34e637ce306e537a6f39
c5533be6e51460c47e2e6ee214ca70d3678dd417
c5533be6e51460c47e2e6ee214ca70d3678dd417
6dcf34a06b2b75c5e732b46928bae962a7bcdb0d
60a060405234801561001057600080fd5b503360805260805161022461003c6000396000818160870152818160df015261017a01526102246000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100665780638da5cb5b14610082578063fdacd576146100c1575b600080fd5b61006461005f3660046101a5565b6100d4565b005b61006f60005481565b6040519081526020015b60405180910390f35b6100a97f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610079565b6100646100cf3660046101d5565b61016f565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561016c57600054604051637ed66abb60e11b815282916001600160a01b0383169163fdacd576916101389160040190815260200190565b600060405180830381600087803b15801561015257600080fd5b505af1158015610166573d6000803e3d6000fd5b50505050505b50565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561016c57600055565b6000602082840312156101b757600080fd5b81356001600160a01b03811681146101ce57600080fd5b9392505050565b6000602082840312156101e757600080fd5b503591905056fea2646970667358221220b1e10dacaa7cee0d35f3627433abf3762fdd39e9feaff847d05bcdf719254aa564736f6c634300080b0033
608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100665780638da5cb5b14610082578063fdacd576146100c1575b600080fd5b61006461005f3660046101a5565b6100d4565b005b61006f60005481565b6040519081526020015b60405180910390f35b6100a97f000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd41781565b6040516001600160a01b039091168152602001610079565b6100646100cf3660046101d5565b61016f565b336001600160a01b037f000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd41716141561016c57600054604051637ed66abb60e11b815282916001600160a01b0383169163fdacd576916101389160040190815260200190565b600060405180830381600087803b15801561015257600080fd5b505af1158015610166573d6000803e3d6000fd5b50505050505b50565b336001600160a01b037f000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd41716141561016c57600055565b6000602082840312156101b757600080fd5b81356001600160a01b03811681146101ce57600080fd5b9392505050565b6000602082840312156101e757600080fd5b503591905056fea2646970667358221220b1e10dacaa7cee0d35f3627433abf3762fdd39e9feaff847d05bcdf719254aa564736f6c634300080b0033
1
20,290,997
0dfee4ebc3f670e187270b1b65c02957c318c4e6dd1fcd7dc34ddea23011c643
4a4ae8be217640a3a7fe929c9c58379babbddd5dc4edce18746078ce2394108a
0fb44352bcfe4c5a53a64dd0fad9a41184a1d609
0fb44352bcfe4c5a53a64dd0fad9a41184a1d609
b2e1c8efaadf45342e4682c4ce7fc4a9fd253f06
61012060405234801562000011575f80fd5b506040516200199e3803806200199e8339818101604052810190620000379190620004d5565b8273ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250505f6200007f60a051620003ac60201b60201c565b90505f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614620000fc5760088114620000fb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000f290620005a2565b60405180910390fd5b5b8273ffffffffffffffffffffffffffffffffffffffff1660c08173ffffffffffffffffffffffffffffffffffffffff16815250505f6200014460c051620003ac60201b60201c565b90505f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614620001c15760088114620001c0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001b79062000610565b60405180910390fd5b5b8273ffffffffffffffffffffffffffffffffffffffff1660e08173ffffffffffffffffffffffffffffffffffffffff16815250505f6200020960e051620003ac60201b60201c565b90505f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161462000286576008811462000285576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200027c906200067e565b60405180910390fd5b5b8673ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508083836012620002cb9190620006d4565b620002d79190620006d4565b620002e391906200070e565b600a620002f1919062000898565b610100818152505060805173ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b81526004015f60405180830381865afa15801562000344573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906200036e919062000a5c565b60405160200162000380919062000b1b565b6040516020818303038152906040525f90816200039e919062000d68565b505050505050505062000eb7565b5f8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161462000457578173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200042b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000451919062000e87565b62000459565b5f5b60ff169050919050565b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6200049f8262000474565b9050919050565b620004b18162000493565b8114620004bc575f80fd5b50565b5f81519050620004cf81620004a6565b92915050565b5f805f8060808587031215620004f057620004ef6200046c565b5b5f620004ff87828801620004bf565b94505060206200051287828801620004bf565b93505060406200052587828801620004bf565b92505060606200053887828801620004bf565b91505092959194509250565b5f82825260208201905092915050565b7f436f696e30206665656420646563696d616c73206d75737420626520380000005f82015250565b5f6200058a601d8362000544565b9150620005978262000554565b602082019050919050565b5f6020820190508181035f830152620005bb816200057c565b9050919050565b7f436f696e31206665656420646563696d616c73206d75737420626520380000005f82015250565b5f620005f8601d8362000544565b91506200060582620005c2565b602082019050919050565b5f6020820190508181035f8301526200062981620005ea565b9050919050565b7f637276555344206665656420646563696d616c73206d757374206265203800005f82015250565b5f62000666601e8362000544565b9150620006738262000630565b602082019050919050565b5f6020820190508181035f830152620006978162000658565b9050919050565b5f819050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f620006e0826200069e565b9150620006ed836200069e565b9250828203905081811115620007085762000707620006a7565b5b92915050565b5f6200071a826200069e565b915062000727836200069e565b9250828201905080821115620007425762000741620006a7565b5b92915050565b5f8160011c9050919050565b5f808291508390505b6001851115620007a5578086048111156200077d576200077c620006a7565b5b60018516156200078d5780820291505b80810290506200079d8562000748565b94506200075d565b94509492505050565b5f82620007bf576001905062000891565b81620007ce575f905062000891565b8160018114620007e75760028114620007f25762000828565b600191505062000891565b60ff841115620008075762000806620006a7565b5b8360020a915084821115620008215762000820620006a7565b5b5062000891565b5060208310610133831016604e8410600b8410161715620008625782820a9050838111156200085c576200085b620006a7565b5b62000891565b62000871848484600162000754565b925090508184048111156200088b576200088a620006a7565b5b81810290505b9392505050565b5f620008a4826200069e565b9150620008b1836200069e565b9250620008e07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484620007ae565b905092915050565b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6200093882620008f0565b810181811067ffffffffffffffff821117156200095a576200095962000900565b5b80604052505050565b5f6200096e62000463565b90506200097c82826200092d565b919050565b5f67ffffffffffffffff8211156200099e576200099d62000900565b5b620009a982620008f0565b9050602081019050919050565b5f5b83811015620009d5578082015181840152602081019050620009b8565b5f8484015250505050565b5f620009f6620009f08462000981565b62000963565b90508281526020810184848401111562000a155762000a14620008ec565b5b62000a22848285620009b6565b509392505050565b5f82601f83011262000a415762000a40620008e8565b5b815162000a53848260208601620009e0565b91505092915050565b5f6020828403121562000a745762000a736200046c565b5b5f82015167ffffffffffffffff81111562000a945762000a9362000470565b5b62000aa28482850162000a2a565b91505092915050565b5f81519050919050565b5f81905092915050565b5f62000acb8262000aab565b62000ad7818562000ab5565b935062000ae9818560208601620009b6565b80840191505092915050565b7f2d637276555344204f7261636c65000000000000000000000000000000000000815250565b5f62000b28828462000abf565b915062000b358262000af5565b600e8201915081905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168062000b8957607f821691505b60208210810362000b9f5762000b9e62000b44565b5b50919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f6008830262000c037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000bc6565b62000c0f868362000bc6565b95508019841693508086168417925050509392505050565b5f819050919050565b5f62000c5062000c4a62000c44846200069e565b62000c27565b6200069e565b9050919050565b5f819050919050565b62000c6b8362000c30565b62000c8362000c7a8262000c57565b84845462000bd2565b825550505050565b5f90565b62000c9962000c8b565b62000ca681848462000c60565b505050565b5b8181101562000ccd5762000cc15f8262000c8f565b60018101905062000cac565b5050565b601f82111562000d1c5762000ce68162000ba5565b62000cf18462000bb7565b8101602085101562000d01578190505b62000d1962000d108562000bb7565b83018262000cab565b50505b505050565b5f82821c905092915050565b5f62000d3e5f198460080262000d21565b1980831691505092915050565b5f62000d58838362000d2d565b9150826002028217905092915050565b62000d738262000aab565b67ffffffffffffffff81111562000d8f5762000d8e62000900565b5b62000d9b825462000b71565b62000da882828562000cd1565b5f60209050601f83116001811462000dde575f841562000dc9578287015190505b62000dd5858262000d4b565b86555062000e44565b601f19841662000dee8662000ba5565b5f5b8281101562000e175784890151825560018201915060208501945060208101905062000df0565b8683101562000e37578489015162000e33601f89168262000d2d565b8355505b6001600288020188555050505b505050505050565b5f60ff82169050919050565b62000e638162000e4c565b811462000e6e575f80fd5b50565b5f8151905062000e818162000e58565b92915050565b5f6020828403121562000e9f5762000e9e6200046c565b5b5f62000eae8482850162000e71565b91505092915050565b60805160a05160c05160e05161010051610a8662000f185f395f818161035301526103ac01525f8181610202015261032d01525f81816101de015261025e01525f818161023501526103d001525f818161028901526103880152610a865ff3fe608060405234801561000f575f80fd5b506004361061007b575f3560e01c8063a035b1fe11610059578063a035b1fe146100d9578063c95389ee146100f7578063ce4b5bbe14610115578063e417773a146101335761007b565b806306fdde031461007f5780633ba94b1e1461009d5780634d180c45146100bb575b5f80fd5b610087610151565b6040516100949190610691565b60405180910390f35b6100a56101dc565b6040516100b2919061072b565b60405180910390f35b6100c3610200565b6040516100d0919061072b565b60405180910390f35b6100e1610224565b6040516100ee919061075c565b60405180910390f35b6100ff610386565b60405161010c9190610795565b60405180910390f35b61011d6103aa565b60405161012a919061075c565b60405180910390f35b61013b6103ce565b604051610148919061072b565b60405180910390f35b5f805461015d906107db565b80601f0160208091040260200160405190810160405280929190818152602001828054610189906107db565b80156101d45780601f106101ab576101008083540402835291602001916101d4565b820191905f5260205f20905b8154815290600101906020018083116101b757829003601f168201915b505050505081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b5f6103816305f5e1006102876102597f00000000000000000000000000000000000000000000000000000000000000006103f2565b6102827f00000000000000000000000000000000000000000000000000000000000000006103f2565b6104f0565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663bb7b8b806040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102f0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103149190610839565b61031e9190610891565b6103289190610891565b6103517f00000000000000000000000000000000000000000000000000000000000000006103f2565b7f00000000000000000000000000000000000000000000000000000000000000006105089092919063ffffffff16565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b5f8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361042f57600190506104eb565b5f8273ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610479573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061049d9190610944565b5050509150505f8112156104e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104dd90610a05565b60405180910390fd5b809150505b919050565b5f8183106104fe5781610500565b825b905092915050565b5f8083850290505f8019858709828110838203039150505f81036105405783828161053657610535610a23565b5b0492505050610600565b808411610579576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8486880990508281118203915080830392505f855f038616905080860495508084049350600181825f0304019050808302841793505f600287600302189050808702600203810290508087026002038102905080870260020381029050808702600203810290508087026002038102905080870260020381029050808502955050505050505b9392505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561063e578082015181840152602081019050610623565b5f8484015250505050565b5f601f19601f8301169050919050565b5f61066382610607565b61066d8185610611565b935061067d818560208601610621565b61068681610649565b840191505092915050565b5f6020820190508181035f8301526106a98184610659565b905092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f6106f36106ee6106e9846106b1565b6106d0565b6106b1565b9050919050565b5f610704826106d9565b9050919050565b5f610715826106fa565b9050919050565b6107258161070b565b82525050565b5f60208201905061073e5f83018461071c565b92915050565b5f819050919050565b61075681610744565b82525050565b5f60208201905061076f5f83018461074d565b92915050565b5f61077f826106fa565b9050919050565b61078f81610775565b82525050565b5f6020820190506107a85f830184610786565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806107f257607f821691505b602082108103610805576108046107ae565b5b50919050565b5f80fd5b61081881610744565b8114610822575f80fd5b50565b5f815190506108338161080f565b92915050565b5f6020828403121561084e5761084d61080b565b5b5f61085b84828501610825565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61089b82610744565b91506108a683610744565b92508282026108b481610744565b915082820484148315176108cb576108ca610864565b5b5092915050565b5f69ffffffffffffffffffff82169050919050565b6108f0816108d2565b81146108fa575f80fd5b50565b5f8151905061090b816108e7565b92915050565b5f819050919050565b61092381610911565b811461092d575f80fd5b50565b5f8151905061093e8161091a565b92915050565b5f805f805f60a0868803121561095d5761095c61080b565b5b5f61096a888289016108fd565b955050602061097b88828901610930565b945050604061098c88828901610825565b935050606061099d88828901610825565b92505060806109ae888289016108fd565b9150509295509295909350565b7f4e6567617469766520416e7377657200000000000000000000000000000000005f82015250565b5f6109ef600f83610611565b91506109fa826109bb565b602082019050919050565b5f6020820190508181035f830152610a1c816109e3565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffdfea2646970667358221220e7cce88acdef3af37091ef125b343736a4475837490e3037ecdeaf51e9dce38c64736f6c63430008150033000000000000000000000000b7ecb2aa52aa64a717180e030241bc75cd946726000000000000000000000000f4030086522a5beea4988f8ca5b36dbc97bee88c0000000000000000000000008350b7de6a6a2c1368e7d4bd968190e13e354297000000000000000000000000eef0c605546958c1f899b6fb336c20671f9cd49f
608060405234801561000f575f80fd5b506004361061007b575f3560e01c8063a035b1fe11610059578063a035b1fe146100d9578063c95389ee146100f7578063ce4b5bbe14610115578063e417773a146101335761007b565b806306fdde031461007f5780633ba94b1e1461009d5780634d180c45146100bb575b5f80fd5b610087610151565b6040516100949190610691565b60405180910390f35b6100a56101dc565b6040516100b2919061072b565b60405180910390f35b6100c3610200565b6040516100d0919061072b565b60405180910390f35b6100e1610224565b6040516100ee919061075c565b60405180910390f35b6100ff610386565b60405161010c9190610795565b60405180910390f35b61011d6103aa565b60405161012a919061075c565b60405180910390f35b61013b6103ce565b604051610148919061072b565b60405180910390f35b5f805461015d906107db565b80601f0160208091040260200160405190810160405280929190818152602001828054610189906107db565b80156101d45780601f106101ab576101008083540402835291602001916101d4565b820191905f5260205f20905b8154815290600101906020018083116101b757829003601f168201915b505050505081565b7f0000000000000000000000008350b7de6a6a2c1368e7d4bd968190e13e35429781565b7f000000000000000000000000eef0c605546958c1f899b6fb336c20671f9cd49f81565b5f6103816305f5e1006102876102597f000000000000000000000000f4030086522a5beea4988f8ca5b36dbc97bee88c6103f2565b6102827f0000000000000000000000008350b7de6a6a2c1368e7d4bd968190e13e3542976103f2565b6104f0565b7f000000000000000000000000b7ecb2aa52aa64a717180e030241bc75cd94672673ffffffffffffffffffffffffffffffffffffffff1663bb7b8b806040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102f0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103149190610839565b61031e9190610891565b6103289190610891565b6103517f000000000000000000000000eef0c605546958c1f899b6fb336c20671f9cd49f6103f2565b7f00000000000000000000000000000000000000000000000000000002540be4006105089092919063ffffffff16565b905090565b7f000000000000000000000000b7ecb2aa52aa64a717180e030241bc75cd94672681565b7f00000000000000000000000000000000000000000000000000000002540be40081565b7f000000000000000000000000f4030086522a5beea4988f8ca5b36dbc97bee88c81565b5f8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361042f57600190506104eb565b5f8273ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610479573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061049d9190610944565b5050509150505f8112156104e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104dd90610a05565b60405180910390fd5b809150505b919050565b5f8183106104fe5781610500565b825b905092915050565b5f8083850290505f8019858709828110838203039150505f81036105405783828161053657610535610a23565b5b0492505050610600565b808411610579576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8486880990508281118203915080830392505f855f038616905080860495508084049350600181825f0304019050808302841793505f600287600302189050808702600203810290508087026002038102905080870260020381029050808702600203810290508087026002038102905080870260020381029050808502955050505050505b9392505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561063e578082015181840152602081019050610623565b5f8484015250505050565b5f601f19601f8301169050919050565b5f61066382610607565b61066d8185610611565b935061067d818560208601610621565b61068681610649565b840191505092915050565b5f6020820190508181035f8301526106a98184610659565b905092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f6106f36106ee6106e9846106b1565b6106d0565b6106b1565b9050919050565b5f610704826106d9565b9050919050565b5f610715826106fa565b9050919050565b6107258161070b565b82525050565b5f60208201905061073e5f83018461071c565b92915050565b5f819050919050565b61075681610744565b82525050565b5f60208201905061076f5f83018461074d565b92915050565b5f61077f826106fa565b9050919050565b61078f81610775565b82525050565b5f6020820190506107a85f830184610786565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806107f257607f821691505b602082108103610805576108046107ae565b5b50919050565b5f80fd5b61081881610744565b8114610822575f80fd5b50565b5f815190506108338161080f565b92915050565b5f6020828403121561084e5761084d61080b565b5b5f61085b84828501610825565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61089b82610744565b91506108a683610744565b92508282026108b481610744565b915082820484148315176108cb576108ca610864565b5b5092915050565b5f69ffffffffffffffffffff82169050919050565b6108f0816108d2565b81146108fa575f80fd5b50565b5f8151905061090b816108e7565b92915050565b5f819050919050565b61092381610911565b811461092d575f80fd5b50565b5f8151905061093e8161091a565b92915050565b5f805f805f60a0868803121561095d5761095c61080b565b5b5f61096a888289016108fd565b955050602061097b88828901610930565b945050604061098c88828901610825565b935050606061099d88828901610825565b92505060806109ae888289016108fd565b9150509295509295909350565b7f4e6567617469766520416e7377657200000000000000000000000000000000005f82015250565b5f6109ef600f83610611565b91506109fa826109bb565b602082019050919050565b5f6020820190508181035f830152610a1c816109e3565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffdfea2646970667358221220e7cce88acdef3af37091ef125b343736a4475837490e3037ecdeaf51e9dce38c64736f6c63430008150033
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.21; // lib/openzeppelin-contracts/contracts/utils/math/Math.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } } // src/StableSwapOracleFactory.sol interface IOracle { function price() external view returns (uint256); } /// @title StableSwapOracleFactory /// @author val @ LlamaRisk /// @notice Factory - Morpho Blue Oracle for StableSwap pools contract StableSwapOracleFactory { function name() external pure returns (string memory) { return "StableSwap Lp/crvUSD Oracle Factory"; } function newStableSwapOracle(address _stableSwapPool, address _coin0Feed, address _coin1Feed, address _crvusdFeed) external returns (IOracle) { return new StableSwapOracle(_stableSwapPool, _coin0Feed, _coin1Feed, _crvusdFeed); } } // src/StableSwapOracle.sol interface StableSwapInterface { function get_virtual_price() external view returns (uint256); function name() external view returns (string memory); } interface AggregatorV3Interface { function latestRoundData() external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); function decimals() external view returns (uint8); } /// @title StableSwapOracle /// @author val @ LlamaRisk /// @notice Morpho Blue Oracle for StableSwap pools contract StableSwapOracle is IOracle { using Math for uint256; StableSwapInterface public immutable STABLE_SWAP_POOL; AggregatorV3Interface public immutable COIN0_FEED; AggregatorV3Interface public immutable COIN1_FEED; AggregatorV3Interface public immutable CRVUSD_FEED; uint256 public immutable SCALE_FACTOR; string public name; /// @param _stableSwapPool Address of the Curve pool. /// @param _coin0Feed ChainLink feed for coin0. /// @param _coin1Feed ChainLink feed for coin1. /// @param _crvusdFeed Chainlink Feed for crvUSD. constructor(address _stableSwapPool, address _coin0Feed, address _coin1Feed, address _crvusdFeed) { COIN0_FEED = AggregatorV3Interface(_coin0Feed); uint256 coin0Decimals = getDecimals(COIN0_FEED); if (_coin0Feed != address(0)) { require(coin0Decimals == 8, "Coin0 feed decimals must be 8"); } COIN1_FEED = AggregatorV3Interface(_coin1Feed); uint256 coin1Decimals = getDecimals(COIN1_FEED); if (_coin1Feed != address(0)) { require(coin1Decimals == 8, "Coin1 feed decimals must be 8"); } CRVUSD_FEED = AggregatorV3Interface(_crvusdFeed); uint256 crvusdDecimals = getDecimals(CRVUSD_FEED); if (_crvusdFeed != address(0)) { require(crvusdDecimals == 8, "crvUSD feed decimals must be 8"); } STABLE_SWAP_POOL = StableSwapInterface(_stableSwapPool); SCALE_FACTOR = 10 ** (18 - coin1Decimals - coin0Decimals + crvusdDecimals); name = string.concat(STABLE_SWAP_POOL.name(), "-crvUSD Oracle"); } function getPrice(AggregatorV3Interface feed) internal view returns (uint256) { if (address(feed) == address(0)) return 1; (, int256 answer,,,) = feed.latestRoundData(); require(answer >= 0, "Negative Answer"); return uint256(answer); } function getDecimals(AggregatorV3Interface feed) internal view returns (uint256) { return (address(feed) == address(0)) ? 0 : feed.decimals(); } function price() external view returns (uint256) { return SCALE_FACTOR.mulDiv( STABLE_SWAP_POOL.get_virtual_price() * Math.min(getPrice(COIN0_FEED), getPrice(COIN1_FEED)) *1e8, getPrice(CRVUSD_FEED) ); } }
1
20,290,998
5ff56fd1ea33050b2751c764db8499002de84e95c6665701a7e22e8f9b25c81e
740aa21559ff40b5ab89e21e6573f4cf3e1b03fd9a3420e96999225822b63989
c5533be6e51460c47e2e6ee214ca70d3678dd417
c5533be6e51460c47e2e6ee214ca70d3678dd417
45e131ab1e3ccf128f4feb793bbc21bb6f102983
608060405234801561001057600080fd5b506040516105f33803806105f383398101604081905261002f91610251565b81518151146100845760405162461bcd60e51b815260206004820152601c60248201527f6172726179206c656e6774682073686f756c6420626520657175616c00000000604482015260640160405180910390fd5b63a973ec9360e01b60009081526020527fd777efdeb12ce631e4e7bb4096e8e44d294f90a879efcd2b8ba060ee12cec7fc80546001600160a01b0319163317905560005b8151811015610125576101138382815181106100e6576100e6610323565b602002602001015183838151811061010057610100610323565b602002602001015161012d60201b60201c565b8061011d81610339565b9150506100c8565b505050610362565b6001600160e01b031991909116600090815260208190526040902080546001600160a01b0319166001600160a01b03909216919091179055565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156101a5576101a5610167565b604052919050565b60006001600160401b038211156101c6576101c6610167565b5060051b60200190565b600082601f8301126101e157600080fd5b815160206101f66101f1836101ad565b61017d565b82815260059290921b8401810191818101908684111561021557600080fd5b8286015b848110156102465780516001600160a01b03811681146102395760008081fd5b8352918301918301610219565b509695505050505050565b6000806040838503121561026457600080fd5b82516001600160401b038082111561027b57600080fd5b818501915085601f83011261028f57600080fd5b8151602061029f6101f1836101ad565b82815260059290921b840181019181810190898411156102be57600080fd5b948201945b838610156102f35785516001600160e01b0319811681146102e45760008081fd5b825294820194908201906102c3565b9188015191965090935050508082111561030c57600080fd5b50610319858286016101d0565b9150509250929050565b634e487b7160e01b600052603260045260246000fd5b600060001982141561035b57634e487b7160e01b600052601160045260246000fd5b5060010190565b610282806103716000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806371c9521c146100515780639bec8dd314610079578063a973ec93146100a0578063f2bff788146100b5575b600080fd5b61006461005f3660046101e7565b6100f6565b60405190151581526020015b60405180910390f35b61008763a973ec9360e01b81565b6040516001600160e01b03199091168152602001610070565b6100b36100ae3660046101e7565b610123565b005b6100de6100c336600461022a565b6000602081905290815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610070565b6001600160e01b0319919091166000908152602081905260409020546001600160a01b0391821691161490565b61013463a973ec9360e01b336100f6565b6101945760405162461bcd60e51b815260206004820152602760248201527f73656e64657220646f65736e27742068617665206772616e74206163636573736044820152662072696768747360c81b606482015260840160405180910390fd5b6001600160e01b03198216600090815260208190526040902080546001600160a01b0319166001600160a01b0383161790555050565b80356001600160e01b0319811681146101e257600080fd5b919050565b600080604083850312156101fa57600080fd5b610203836101ca565b915060208301356001600160a01b038116811461021f57600080fd5b809150509250929050565b60006020828403121561023c57600080fd5b610245826101ca565b939250505056fea26469706673582212206ab6b18c4172d4d566ddbc440de2f915b1f8489fdef188f1df9aa3e89a18a6ac64736f6c634300080b003300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000d9d33b6d4000000000000000000000000000000000000000000000000000000008b63aebf0000000000000000000000000000000000000000000000000000000080ae1c28000000000000000000000000000000000000000000000000000000008c0c263100000000000000000000000000000000000000000000000000000000edc20c3c00000000000000000000000000000000000000000000000000000000d15ef64e000000000000000000000000000000000000000000000000000000008a3234c700000000000000000000000000000000000000000000000000000000ffaac0eb00000000000000000000000000000000000000000000000000000000bd2a182000000000000000000000000000000000000000000000000000000000d2e5fae900000000000000000000000000000000000000000000000000000000d823674400000000000000000000000000000000000000000000000000000000366b4885000000000000000000000000000000000000000000000000000000006ba6db6b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417
608060405234801561001057600080fd5b506004361061004c5760003560e01c806371c9521c146100515780639bec8dd314610079578063a973ec93146100a0578063f2bff788146100b5575b600080fd5b61006461005f3660046101e7565b6100f6565b60405190151581526020015b60405180910390f35b61008763a973ec9360e01b81565b6040516001600160e01b03199091168152602001610070565b6100b36100ae3660046101e7565b610123565b005b6100de6100c336600461022a565b6000602081905290815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610070565b6001600160e01b0319919091166000908152602081905260409020546001600160a01b0391821691161490565b61013463a973ec9360e01b336100f6565b6101945760405162461bcd60e51b815260206004820152602760248201527f73656e64657220646f65736e27742068617665206772616e74206163636573736044820152662072696768747360c81b606482015260840160405180910390fd5b6001600160e01b03198216600090815260208190526040902080546001600160a01b0319166001600160a01b0383161790555050565b80356001600160e01b0319811681146101e257600080fd5b919050565b600080604083850312156101fa57600080fd5b610203836101ca565b915060208301356001600160a01b038116811461021f57600080fd5b809150509250929050565b60006020828403121561023c57600080fd5b610245826101ca565b939250505056fea26469706673582212206ab6b18c4172d4d566ddbc440de2f915b1f8489fdef188f1df9aa3e89a18a6ac64736f6c634300080b0033
1
20,291,001
7b421a4e0352224281141049a1eb8f37dd9bad94f38f5489b35d74f8f7ce5342
5fee24954d25f5f936a8daeec360e67bf15a488d309d9a6ad5c0c877c1e9f09c
7602f839cdf3e88f9bd6c1eb312428c470f2c720
3dc3b756ec5e4ec9a5deba49e2cbf8e21d276286
409af6f07982342f0ca5d0b3b85f6ae9e67208ce
3d60ad80600a3d3981f3363d3d373d3d3d363d732823c188d7897f69472f003027b326c0e78ce7f65af43d82803e903d91602b57fd5bf344454641554c545f4143434f554e545f53414c5400000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000003dc3b756ec5e4ec9a5deba49e2cbf8e21d276286000000000000000000000000000000000000000000000000000000000000013d
363d3d373d3d3d363d732823c188d7897f69472f003027b326c0e78ce7f65af43d82803e903d91602b57fd5bf344454641554c545f4143434f554e545f53414c5400000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000003dc3b756ec5e4ec9a5deba49e2cbf8e21d276286000000000000000000000000000000000000000000000000000000000000013d
1
20,291,004
d72df22fc1dd82c13fbff2594f27a075ccccce055878b918ffa5f811c0db55b4
ce915f48e533834ca5008f2fbb592d58f62172c0a064ef6f1f632ff3e8efeed1
3aeb5831f91d29b3992d659821a7fed7b805a107
ffa397285ce46fb78c588a9e993286aac68c37cd
27db373656aa43454c98e09798422ee9f6033e3b
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,291,006
b1cf151fda08923edb422098cd317f64a3c0328d94c1bb3ed4a6568bcbf4a2b7
edbc417db1b6d7513e5486f34b139ae99ef66dc2fb3283ea86e1e0cfc1378588
c5533be6e51460c47e2e6ee214ca70d3678dd417
c5533be6e51460c47e2e6ee214ca70d3678dd417
56f79862b299f9af4eeddb3872e1ebe94e6244d7
60a060405234801561001057600080fd5b503360805260805161022461003c6000396000818160870152818160df015261017a01526102246000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100665780638da5cb5b14610082578063fdacd576146100c1575b600080fd5b61006461005f3660046101a5565b6100d4565b005b61006f60005481565b6040519081526020015b60405180910390f35b6100a97f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610079565b6100646100cf3660046101d5565b61016f565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561016c57600054604051637ed66abb60e11b815282916001600160a01b0383169163fdacd576916101389160040190815260200190565b600060405180830381600087803b15801561015257600080fd5b505af1158015610166573d6000803e3d6000fd5b50505050505b50565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561016c57600055565b6000602082840312156101b757600080fd5b81356001600160a01b03811681146101ce57600080fd5b9392505050565b6000602082840312156101e757600080fd5b503591905056fea2646970667358221220b1e10dacaa7cee0d35f3627433abf3762fdd39e9feaff847d05bcdf719254aa564736f6c634300080b0033
608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100665780638da5cb5b14610082578063fdacd576146100c1575b600080fd5b61006461005f3660046101a5565b6100d4565b005b61006f60005481565b6040519081526020015b60405180910390f35b6100a97f000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd41781565b6040516001600160a01b039091168152602001610079565b6100646100cf3660046101d5565b61016f565b336001600160a01b037f000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd41716141561016c57600054604051637ed66abb60e11b815282916001600160a01b0383169163fdacd576916101389160040190815260200190565b600060405180830381600087803b15801561015257600080fd5b505af1158015610166573d6000803e3d6000fd5b50505050505b50565b336001600160a01b037f000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd41716141561016c57600055565b6000602082840312156101b757600080fd5b81356001600160a01b03811681146101ce57600080fd5b9392505050565b6000602082840312156101e757600080fd5b503591905056fea2646970667358221220b1e10dacaa7cee0d35f3627433abf3762fdd39e9feaff847d05bcdf719254aa564736f6c634300080b0033
1
20,291,006
b1cf151fda08923edb422098cd317f64a3c0328d94c1bb3ed4a6568bcbf4a2b7
d34a577ea802d747795410d2b14e46e46ef67a923c850b3c4347b02defecdbd0
e185bee533a6f23c4018d1c8863288e83761e6e2
7b60a8e5ee6f22e2f7ca97f4efd22de2a87c9338
32bc6c5723942486a10885ffc065c21650824533
60806040526010805460ff1916600217905560006012553480156200002357600080fd5b5060405162003ad138038062003ad1833981810160405260a08110156200004957600080fd5b81019080805160405193929190846401000000008211156200006a57600080fd5b9083019060208201858111156200008057600080fd5b82516401000000008111828201881017156200009b57600080fd5b82525081516020918201929091019080838360005b83811015620000ca578181015183820152602001620000b0565b50505050905090810190601f168015620000f85780820380516001836020036101000a031916815260200191505b50604052602001805160405193929190846401000000008211156200011c57600080fd5b9083019060208201858111156200013257600080fd5b82516401000000008111828201881017156200014d57600080fd5b82525081516020918201929091019080838360005b838110156200017c57818101518382015260200162000162565b50505050905090810190601f168015620001aa5780820380516001836020036101000a031916815260200191505b5060405260200180516040519392919084640100000000821115620001ce57600080fd5b908301906020820185811115620001e457600080fd5b8251640100000000811182820188101715620001ff57600080fd5b82525081516020918201929091019080838360005b838110156200022e57818101518382015260200162000214565b50505050905090810190601f1680156200025c5780820380516001836020036101000a031916815260200191505b5060409081526020820151910151909250905084848484846000620002806200039e565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350620002dc6301ffc9a760e01b620003a2565b8451620002f190600d90602088019062000443565b5083516200030790600f90602087019062000443565b5062000313836200042a565b601480546001600160a01b0319166001600160a01b0384161790556011819055620003456380ac58cd60e01b620003a2565b62000357635b5e139f60e01b620003a2565b6200036963780e9d6360e01b620003a2565b6200037b63152a902d60e11b620003a2565b5050601680546001600160a01b0319163317905550620004df9650505050505050565b3390565b6001600160e01b0319808216141562000402576040805162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015290519081900360640190fd5b6001600160e01b0319166000908152600160208190526040909120805460ff19169091179055565b80516200043f90600e90602084019062000443565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200048657805160ff1916838001178555620004b6565b82800160010185558215620004b6579182015b82811115620004b657825182559160200191906001019062000499565b50620004c4929150620004c8565b5090565b5b80821115620004c45760008155600101620004c9565b6135e280620004ef6000396000f3fe6080604052600436106102305760003560e01c80636352211e1161012e578063ad72f3f5116100ab578063c87b56dd1161006f578063c87b56dd14610b4d578063e985e9c514610b77578063f0292a0314610bb2578063f2fde38b14610bc7578063f8e76cc014610bfa57610230565b8063ad72f3f5146108b5578063b2e669db146108ca578063b328d6361461098b578063b88d4fde146109b5578063be0cb38d14610a8857610230565b80638b5e51d2116100f25780638b5e51d2146107d25780638da5cb5b1461080b57806395d89b41146108205780639e1c3ee314610835578063a22cb4651461087a57610230565b80636352211e14610684578063662f1229146106ae5780636c0360eb1461077557806370a082311461078a578063715018a6146107bd57610230565b80632a55205a116101bc57806340c10f191161018057806340c10f191461055b57806342842e0e146105945780634e881e20146105d75780634f6ccce714610601578063610d107e1461062b57610230565b80632a55205a146104485780632a959b891461049b5780632f745c59146104da57806338232cfe146105135780633eaaf86b1461054657610230565b8063095ea7b311610203578063095ea7b3146103795780630c6a595a146103b4578063146862cc146103db57806318160ddd146103f057806323b872dd1461040557610230565b806301ffc9a71461023557806303c3ff251461027d57806306fdde03146102a9578063081812fc14610333575b600080fd5b34801561024157600080fd5b506102696004803603602081101561025857600080fd5b50356001600160e01b031916610c24565b604080519115158252519081900360200190f35b6102696004803603604081101561029357600080fd5b50803590602001356001600160a01b0316610c47565b3480156102b557600080fd5b506102be610f91565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102f85781810151838201526020016102e0565b50505050905090810190601f1680156103255780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561033f57600080fd5b5061035d6004803603602081101561035657600080fd5b5035611027565b604080516001600160a01b039092168252519081900360200190f35b34801561038557600080fd5b506103b26004803603604081101561039c57600080fd5b506001600160a01b038135169060200135611089565b005b3480156103c057600080fd5b506103c9611164565b60408051918252519081900360200190f35b3480156103e757600080fd5b506103c961116a565b3480156103fc57600080fd5b506103c9611170565b34801561041157600080fd5b506103b26004803603606081101561042857600080fd5b506001600160a01b03813581169160208101359091169060400135611176565b34801561045457600080fd5b506104786004803603604081101561046b57600080fd5b50803590602001356111cd565b604080516001600160a01b03909316835260208301919091528051918290030190f35b3480156104a757600080fd5b50610269600480360360608110156104be57600080fd5b506001600160a01b038135169060208101359060400135611206565b3480156104e657600080fd5b506103c9600480360360408110156104fd57600080fd5b506001600160a01b0381351690602001356112c8565b34801561051f57600080fd5b506103c96004803603602081101561053657600080fd5b50356001600160a01b0316611318565b34801561055257600080fd5b506103c961132a565b34801561056757600080fd5b506102696004803603604081101561057e57600080fd5b506001600160a01b038135169060200135611330565b3480156105a057600080fd5b506103b2600480360360608110156105b757600080fd5b506001600160a01b0381358116916020810135909116906040013561139d565b3480156105e357600080fd5b50610269600480360360208110156105fa57600080fd5b50356113b8565b34801561060d57600080fd5b506103c96004803603602081101561062457600080fd5b50356113cd565b34801561063757600080fd5b506106556004803603602081101561064e57600080fd5b5035611431565b604080519485526020850193909352838301919091526001600160a01b03166060830152519081900360800190f35b34801561069057600080fd5b5061035d600480360360208110156106a757600080fd5b5035611461565b3480156106ba57600080fd5b506106d8600480360360208110156106d157600080fd5b50356115aa565b60405180868152602001858152602001846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561073657818101518382015260200161071e565b50505050905090810190601f1680156107635780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34801561078157600080fd5b506102be61166c565b34801561079657600080fd5b506103c9600480360360208110156107ad57600080fd5b50356001600160a01b03166116cd565b3480156107c957600080fd5b506103b2611730565b3480156107de57600080fd5b506103c9600480360360408110156107f557600080fd5b506001600160a01b0381351690602001356117d2565b34801561081757600080fd5b5061035d6117fe565b34801561082c57600080fd5b506102be61180d565b34801561084157600080fd5b506103b26004803603606081101561085857600080fd5b506001600160a01b03813581169160208101359091169060400135151561186e565b34801561088657600080fd5b506103b26004803603604081101561089d57600080fd5b506001600160a01b0381351690602001351515611997565b3480156108c157600080fd5b5061035d611a98565b3480156108d657600080fd5b50610269600480360360808110156108ed57600080fd5b81359160208101359181019060608101604082013564010000000081111561091457600080fd5b82018360208201111561092657600080fd5b8035906020019184600183028401116401000000008311171561094857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250611aa7915050565b34801561099757600080fd5b506103c9600480360360208110156109ae57600080fd5b5035611b16565b3480156109c157600080fd5b506103b2600480360360808110156109d857600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135640100000000811115610a1357600080fd5b820183602082011115610a2557600080fd5b80359060200191846001830284011164010000000083111715610a4757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611b28945050505050565b348015610a9457600080fd5b5061026960048036036060811015610aab57600080fd5b6001600160a01b038235169190810190604081016020820135640100000000811115610ad657600080fd5b820183602082011115610ae857600080fd5b80359060200191846001830284011164010000000083111715610b0a57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250611b86915050565b348015610b5957600080fd5b506102be60048036036020811015610b7057600080fd5b5035611bf6565b348015610b8357600080fd5b5061026960048036036040811015610b9a57600080fd5b506001600160a01b0381358116916020013516611dda565b348015610bbe57600080fd5b506103c9611e08565b348015610bd357600080fd5b506103b260048036036020811015610bea57600080fd5b50356001600160a01b0316611e0e565b348015610c0657600080fd5b5061026960048036036020811015610c1d57600080fd5b5035611f06565b6001600160e01b0319811660009081526001602052604090205460ff165b919050565b60008281526018602052604081205460ff16610c9f576040805162461bcd60e51b81526020600482015260126024820152714e6f7420612076616c69642073657269657360701b604482015290519081900360640190fd5b60008381526017602052604090205460011115610cf9576040805162461bcd60e51b815260206004820152601360248201527253657269657320697320534f4c44204f55542160681b604482015290519081900360640190fd5b600083815260176020526040902060010154341015610d495760405162461bcd60e51b81526004018080602001828103825260288152602001806135856028913960400191505060405180910390fd5b600083815260176020526040902054610d63906001612042565b6000848152601760205260409020819055610d8f576000838152601860205260409020805460ff191690555b34610da36001610d9d611170565b90612084565b60405133907fb0442210ef7e89767af2eeb7f3e41f8a7efeaf443711463e8d0d54106b082a0690600090a46000838152601760209081526040918290206004018054835160026001831615610100026000190190921691909104601f8101849004840282018401909452838152610e88938693919291830182828015610e6a5780601f10610e3f57610100808354040283529160200191610e6a565b820191906000526020600020905b815481529060010190602001808311610e4d57829003601f168201915b50505060008881526017602052604090206003015491506120de9050565b506000610ea16064610e9b34600a6120ea565b90612143565b6000858152601760205260409020600201549091506001600160a01b03166108fc610ecc3484612042565b6040518115909202916000818181858888f19350505050158015610ef4573d6000803e3d6000fd5b5080471015610f4a576040805162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f7567682062616c616e636520746f2073656e64206665650000604482015290519081900360640190fd5b6016546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610f84573d6000803e3d6000fd5b5060019150505b92915050565b600d8054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561101d5780601f10610ff25761010080835404028352916020019161101d565b820191906000526020600020905b81548152906001019060200180831161100057829003601f168201915b5050505050905090565b600061103282611f06565b61106d5760405162461bcd60e51b815260040180806020018281038252602c815260200180613463602c913960400191505060405180910390fd5b506000908152600560205260409020546001600160a01b031690565b600061109482611461565b9050806001600160a01b0316836001600160a01b031614156110e75760405162461bcd60e51b81526004018080602001828103825260218152602001806135336021913960400191505060405180910390fd5b806001600160a01b03166110f9612185565b6001600160a01b0316148061111a575061111a81611115612185565b611dda565b6111555760405162461bcd60e51b81526004018080602001828103825260388152602001806133b96038913960400191505060405180910390fd5b61115f8383612189565b505050565b60155481565b60135481565b60125490565b611187611181612185565b826121f7565b6111c25760405162461bcd60e51b81526004018080602001828103825260318152602001806135546031913960400191505060405180910390fd5b61115f838383612293565b60008060006111db8561243b565b6014549091506001600160a01b03166111fa612710610e9b84886120ea565b92509250509250929050565b6000611210612185565b6000546001600160a01b03908116911614611260576040805162461bcd60e51b815260206004820181905260248201526000805160206134bb833981519152604482015290519081900360640190fd5b60105460ff16831080159061127757506011548311155b6112b25760405162461bcd60e51b815260040180806020018281038252602781526020018061341b6027913960400191505060405180910390fd5b6112bd84848461256c565b5060015b9392505050565b6001600160a01b03821660009081526002602052604081206112e990612763565b8211610f8b576001600160a01b0383166000908152600260205260409020611311908361276e565b9050610f8b565b60086020526000908152604090205481565b60125481565b600061133a612185565b6000546001600160a01b0390811691161461138a576040805162461bcd60e51b815260206004820181905260248201526000805160206134bb833981519152604482015290519081900360640190fd5b611394838361277a565b50600192915050565b61115f83838360405180602001604052806000815250611b28565b60186020526000908152604090205460ff1681565b60006113d882611f06565b156113e4575080610c42565b6040805162461bcd60e51b815260206004820152601760248201527f4e6f20746f6b656e20666f756e6420617420696e646578000000000000000000604482015290519081900360640190fd5b600a602052600090815260409020805460018201546002830154600390930154919290916001600160a01b031684565b60008161147057506000610c42565b61147b60038361289c565b156114925761148b6003836128a8565b9050610c42565b60006114a96011548461214390919063ffffffff16565b6010549091506000906114c790600190610d9d90879060ff16612143565b90506013548111156114d857506013545b80821480156114e657508115155b156114f2576001820391505b6000825b8281101561159f57600081815260096020526040902060019061151890612763565b10611597576000818152600960205260409020869061153890600161276e565b10611597576000818152600a6020526040902054861080159061156c57506000818152600a60205260409020600101548611155b15611597576000908152600a60205260409020600301546001600160a01b03169350610c4292505050565b6001016114f6565b509250610c42915050565b601760209081526000918252604091829020805460018083015460028085015460038601546004870180548a516101009782161597909702600019011693909304601f8101899004890286018901909952888552949792966001600160a01b03909116959392908301828280156116625780601f1061163757610100808354040283529160200191611662565b820191906000526020600020905b81548152906001019060200180831161164557829003601f168201915b5050505050905085565b600e8054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561101d5780601f10610ff25761010080835404028352916020019161101d565b60006001600160a01b0382166117145760405162461bcd60e51b815260040180806020018281038252602a8152602001806133f1602a913960400191505060405180910390fd5b506001600160a01b031660009081526008602052604090205490565b611738612185565b6000546001600160a01b03908116911614611788576040805162461bcd60e51b815260206004820181905260248201526000805160206134bb833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6001600160a01b038216600090815260026020526040812081906117f6908461276e565b949350505050565b6000546001600160a01b031690565b600f8054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561101d5780601f10610ff25761010080835404028352916020019161101d565b611876612185565b6000546001600160a01b039081169116146118c6576040805162461bcd60e51b815260206004820181905260248201526000805160206134bb833981519152604482015290519081900360640190fd5b826001600160a01b0316826001600160a01b03161415611929576040805162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b604482015290519081900360640190fd5b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff1916861515908117909155825190815291517f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319281900390910190a3505050565b61199f612185565b6001600160a01b0316826001600160a01b03161415611a01576040805162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b604482015290519081900360640190fd5b8060066000611a0e612185565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155611a52612185565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405180821515815260200191505060405180910390a35050565b6016546001600160a01b031681565b6000611ab1612185565b6000546001600160a01b03908116911614611b01576040805162461bcd60e51b815260206004820181905260248201526000805160206134bb833981519152604482015290519081900360640190fd5b611b0d858585856128b4565b95945050505050565b600b6020526000908152604090205481565b611b39611b33612185565b836121f7565b611b745760405162461bcd60e51b81526004018080602001828103825260318152602001806135546031913960400191505060405180910390fd5b611b80848484846129a4565b50505050565b6000611b90612185565b6000546001600160a01b03908116911614611be0576040805162461bcd60e51b815260206004820181905260248201526000805160206134bb833981519152604482015290519081900360640190fd5b611bea848361277a565b6112bd601254846129f6565b6060611c0182611f06565b611c3c5760405162461bcd60e51b815260040180806020018281038252602f815260200180613504602f913960400191505060405180910390fd5b6000828152600c602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845260609392830182828015611cd15780601f10611ca657610100808354040283529160200191611cd1565b820191906000526020600020905b815481529060010190602001808311611cb457829003601f168201915b5050600e5493945050505060026000196101006001841615020190911604611cfa579050610c42565b805115611d08579050610c42565b600e611d1384612a59565b6040516020018083805460018160011615610100020316600290048015611d715780601f10611d4f576101008083540402835291820191611d71565b820191906000526020600020905b815481529060010190602001808311611d5d575b5050825160208401908083835b60208310611d9d5780518252601f199092019160209182019101611d7e565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052915050919050565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b60115481565b611e16612185565b6000546001600160a01b03908116911614611e66576040805162461bcd60e51b815260206004820181905260248201526000805160206134bb833981519152604482015290519081900360640190fd5b6001600160a01b038116611eab5760405162461bcd60e51b81526004018080602001828103825260268152602001806133436026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600081611f1557506000610c42565b611f2060038361289c565b15611f305761148b60038361289c565b611f38611170565b8211610c42576000611f556011548461214390919063ffffffff16565b601054909150600090611f7390600190610d9d90879060ff16612143565b9050601354811115611f8457506013545b8082148015611f9257508115155b15611fa557611fa2826001612042565b91505b815b81811015612036576000818152600960205260409020600190611fc990612763565b1061202e5760008181526009602052604090208590611fe990600161276e565b1061202e576000818152600a6020526040902054851080159061201d57506000818152600a60205260409020600101548511155b1561202e5760019350505050610c42565b600101611fa7565b50600092505050610c42565b60006112c183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612b23565b6000828201838110156112c1576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611bea848361277a565b6000826120f957506000610f8b565b8282028284828161210657fe5b04146112c15760405162461bcd60e51b81526004018080602001828103825260218152602001806134426021913960400191505060405180910390fd5b60006112c183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612bba565b3390565b600081815260056020526040902080546001600160a01b0319166001600160a01b03841690811790915581906121be82611461565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061220282611f06565b61223d5760405162461bcd60e51b815260040180806020018281038252602c81526020018061338d602c913960400191505060405180910390fd5b600061224883611461565b9050806001600160a01b0316846001600160a01b031614806122835750836001600160a01b031661227884611027565b6001600160a01b0316145b806117f657506117f68185611dda565b826001600160a01b03166122a682611461565b6001600160a01b0316146122eb5760405162461bcd60e51b81526004018080602001828103825260298152602001806134db6029913960400191505060405180910390fd5b6001600160a01b0382166123305760405162461bcd60e51b81526004018080602001828103825260248152602001806133696024913960400191505060405180910390fd5b61233b600082612189565b6001600160a01b03831660009081526008602052604090205461235f906001612042565b6001600160a01b03808516600090815260086020526040808220939093559084168152205461238f906001612084565b6001600160a01b0380841660009081526008602090815260408083209490945591861681526002909152206123c49082612c1f565b506001600160a01b03821660009081526002602052604090206123e79082612c2b565b506123f460038284612c37565b5080826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000818152600b60205260408120541561246457506000818152600b6020526040902054610c42565b600061247b6011548461214390919063ffffffff16565b60105490915060009061249990600190610d9d90879060ff16612143565b90506013548111156124aa57506013545b80821480156124b857508115155b156124cb576124c8826001612042565b91505b815b818110156120365760008181526009602052604090206001906124ef90612763565b10612564576000818152600960205260409020859061250f90600161276e565b10612564576000818152600a6020526040902054851080159061254357506000818152600a60205260409020600101548511155b15612564576000908152600a60205260409020600201549250610c42915050565b6001016124cd565b6001600160a01b0383166125c7576040805162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015290519081900360640190fd5b60005b828161ffff161015612628576012546125ea9061ffff6001840116612084565b6040516001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46001016125ca565b50604051806080016040528060125481526020016126518460125461208490919063ffffffff16565b8152602080820184905233604092830152601380546000908152600a835283812085518155858401516001820155858501516002820155606090950151600390950180546001600160a01b0319166001600160a01b039096169590951790945560125490548452600990915291206126c891612c2b565b506126f86126e16012548461208490919063ffffffff16565b601354600090815260096020526040902090612c2b565b503360009081526007602052604090206127129083612c2b565b50601354612721906001612084565b6013553360009081526008602052604090205461273e9083612084565b3360009081526008602052604090205560125461275b9083612084565b601255505050565b6000610f8b82612c4d565b60006112c18383612c51565b6001600160a01b0382166127d5576040805162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015290519081900360640190fd5b6012546127e3906001612084565b60128190556001600160a01b038316600090815260026020526040902061280991612c2b565b5060125461281a9060039084612c37565b506012546000908152600b602090815260408083208490556001600160a01b03851683526008909152902054612851906001612084565b6001600160a01b0383166000818152600860205260408082209390935560125492517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006112c18383612cb5565b60006112c18383612ccd565b6015546000906128c5906001612084565b601581815560009182526018602090815260408084208054600160ff199091168117909155815160a0810183528a81528084018a815233828501908152606083018a8152608084018c81529754895260178752949097208251815590519281019290925594516002820180546001600160a01b0319166001600160a01b039092169190911790559051600382015591518051612967926004850192019061325b565b5050604051869150859033907f335cf3124d4c238e9c1bbae5ae98a445bab5de090df6b8b94e94caab3ffb45f690600090a4506001949350505050565b6129af848484612293565b6129bb84848484612d0f565b611b805760405162461bcd60e51b81526004018080602001828103825260328152602001806133116032913960400191505060405180910390fd5b6129ff82611f06565b612a3a5760405162461bcd60e51b815260040180806020018281038252602c81526020018061348f602c913960400191505060405180910390fd5b6000828152600c60209081526040909120825161115f9284019061325b565b606081612a7e57506040805180820190915260018152600360fc1b6020820152610c42565b8160005b8115612a9657600101600a82049150612a82565b60608167ffffffffffffffff81118015612aaf57600080fd5b506040519080825280601f01601f191660200182016040528015612ada576020820181803683370190505b5090505b84156117f65760001990910190600a850660300160f81b818381518110612b0157fe5b60200101906001600160f81b031916908160001a905350600a85049450612ade565b60008184841115612bb25760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b77578181015183820152602001612b5f565b50505050905090810190601f168015612ba45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183612c095760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612b77578181015183820152602001612b5f565b506000838581612c1557fe5b0495945050505050565b60006112c18383612e77565b60006112c18383612f3d565b60006117f684846001600160a01b038516612f87565b5490565b81546000908210612c935760405162461bcd60e51b81526004018080602001828103825260228152602001806132ef6022913960400191505060405180910390fd5b826000018281548110612ca257fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b60006112c183836040518060400160405280601e81526020017f456e756d657261626c654d61703a206e6f6e6578697374656e74206b6579000081525061301e565b6000612d23846001600160a01b03166130ab565b612d2f575060016117f6565b6060612e3d630a85bd0160e11b612d44612185565b88878760405160240180856001600160a01b03168152602001846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612dab578181015183820152602001612d93565b50505050905090810190601f168015612dd85780820380516001836020036101000a031916815260200191505b5095505050505050604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b038381831617835250505050604051806060016040528060328152602001613311603291396001600160a01b03881691906130e4565b90506000818060200190516020811015612e5657600080fd5b50516001600160e01b031916630a85bd0160e11b1492505050949350505050565b60008181526001830160205260408120548015612f335783546000198083019190810190600090879083908110612eaa57fe5b9060005260206000200154905080876000018481548110612ec757fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080612ef757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610f8b565b6000915050610f8b565b6000612f498383612cb5565b612f7f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610f8b565b506000610f8b565b600082815260018401602052604081205480612fec5750506040805180820182528381526020808201848152865460018181018955600089815284812095516002909302909501918255915190820155865486845281880190925292909120556112c1565b82856000016001830381548110612fff57fe5b90600052602060002090600202016001018190555060009150506112c1565b6000828152600184016020526040812054828161307c5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612b77578181015183820152602001612b5f565b5084600001600182038154811061308f57fe5b9060005260206000209060020201600101549150509392505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906117f6575050151592915050565b60606117f6848460008560606130f9856130ab565b61314a576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106131895780518252601f19909201916020918201910161316a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146131eb576040519150601f19603f3d011682016040523d82523d6000602084013e6131f0565b606091505b509150915081156132045791506117f69050565b8051156132145780518082602001fd5b60405162461bcd60e51b8152602060048201818152865160248401528651879391928392604401919085019080838360008315612b77578181015183820152602001612b5f565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061329c57805160ff19168380011785556132c9565b828001600101855582156132c9579182015b828111156132c95782518255916020019190600101906132ae565b506132d59291506132d9565b5090565b5b808211156132d557600081556001016132da56fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e64734552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734552433732313a207472616e7366657220746f20746865207a65726f20616464726573734552433732313a206f70657261746f7220717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f76656420666f7220616c6c4552433732313a2062616c616e636520717565727920666f7220746865207a65726f206164647265737343616e206f6e6c79206d696e74206265747765656e203220616e64203230303020746f6b656e73536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774552433732313a20617070726f76656420717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732314d657461646174613a2055524920736574206f66206e6f6e6578697374656e7420746f6b656e4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724552433732313a207472616e73666572206f6620746f6b656e2074686174206973206e6f74206f776e4552433732314d657461646174613a2055524920717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76616c20746f2063757272656e74206f776e65724552433732313a207472616e736665722063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f766564496e76616c696420616d6f756e742073656e7420746f2070757263686173652074686973204e4654a2646970667358221220e5844e7b23ba3eb170fb77325803888dfd777c169a0b3b8329810165df8c842c64736f6c634300060c003300000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000e185bee533a6f23c4018d1c8863288e83761e6e20000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000000e416e696d616c204b696e67646f6d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d416e696d616c4b696e67446f6d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003368747470733a2f2f6d657461646174612e6d696e7461626c652e6170702f7664764a7a796466566b4730645f5a44376d46592f00000000000000000000000000
6080604052600436106102305760003560e01c80636352211e1161012e578063ad72f3f5116100ab578063c87b56dd1161006f578063c87b56dd14610b4d578063e985e9c514610b77578063f0292a0314610bb2578063f2fde38b14610bc7578063f8e76cc014610bfa57610230565b8063ad72f3f5146108b5578063b2e669db146108ca578063b328d6361461098b578063b88d4fde146109b5578063be0cb38d14610a8857610230565b80638b5e51d2116100f25780638b5e51d2146107d25780638da5cb5b1461080b57806395d89b41146108205780639e1c3ee314610835578063a22cb4651461087a57610230565b80636352211e14610684578063662f1229146106ae5780636c0360eb1461077557806370a082311461078a578063715018a6146107bd57610230565b80632a55205a116101bc57806340c10f191161018057806340c10f191461055b57806342842e0e146105945780634e881e20146105d75780634f6ccce714610601578063610d107e1461062b57610230565b80632a55205a146104485780632a959b891461049b5780632f745c59146104da57806338232cfe146105135780633eaaf86b1461054657610230565b8063095ea7b311610203578063095ea7b3146103795780630c6a595a146103b4578063146862cc146103db57806318160ddd146103f057806323b872dd1461040557610230565b806301ffc9a71461023557806303c3ff251461027d57806306fdde03146102a9578063081812fc14610333575b600080fd5b34801561024157600080fd5b506102696004803603602081101561025857600080fd5b50356001600160e01b031916610c24565b604080519115158252519081900360200190f35b6102696004803603604081101561029357600080fd5b50803590602001356001600160a01b0316610c47565b3480156102b557600080fd5b506102be610f91565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102f85781810151838201526020016102e0565b50505050905090810190601f1680156103255780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561033f57600080fd5b5061035d6004803603602081101561035657600080fd5b5035611027565b604080516001600160a01b039092168252519081900360200190f35b34801561038557600080fd5b506103b26004803603604081101561039c57600080fd5b506001600160a01b038135169060200135611089565b005b3480156103c057600080fd5b506103c9611164565b60408051918252519081900360200190f35b3480156103e757600080fd5b506103c961116a565b3480156103fc57600080fd5b506103c9611170565b34801561041157600080fd5b506103b26004803603606081101561042857600080fd5b506001600160a01b03813581169160208101359091169060400135611176565b34801561045457600080fd5b506104786004803603604081101561046b57600080fd5b50803590602001356111cd565b604080516001600160a01b03909316835260208301919091528051918290030190f35b3480156104a757600080fd5b50610269600480360360608110156104be57600080fd5b506001600160a01b038135169060208101359060400135611206565b3480156104e657600080fd5b506103c9600480360360408110156104fd57600080fd5b506001600160a01b0381351690602001356112c8565b34801561051f57600080fd5b506103c96004803603602081101561053657600080fd5b50356001600160a01b0316611318565b34801561055257600080fd5b506103c961132a565b34801561056757600080fd5b506102696004803603604081101561057e57600080fd5b506001600160a01b038135169060200135611330565b3480156105a057600080fd5b506103b2600480360360608110156105b757600080fd5b506001600160a01b0381358116916020810135909116906040013561139d565b3480156105e357600080fd5b50610269600480360360208110156105fa57600080fd5b50356113b8565b34801561060d57600080fd5b506103c96004803603602081101561062457600080fd5b50356113cd565b34801561063757600080fd5b506106556004803603602081101561064e57600080fd5b5035611431565b604080519485526020850193909352838301919091526001600160a01b03166060830152519081900360800190f35b34801561069057600080fd5b5061035d600480360360208110156106a757600080fd5b5035611461565b3480156106ba57600080fd5b506106d8600480360360208110156106d157600080fd5b50356115aa565b60405180868152602001858152602001846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561073657818101518382015260200161071e565b50505050905090810190601f1680156107635780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34801561078157600080fd5b506102be61166c565b34801561079657600080fd5b506103c9600480360360208110156107ad57600080fd5b50356001600160a01b03166116cd565b3480156107c957600080fd5b506103b2611730565b3480156107de57600080fd5b506103c9600480360360408110156107f557600080fd5b506001600160a01b0381351690602001356117d2565b34801561081757600080fd5b5061035d6117fe565b34801561082c57600080fd5b506102be61180d565b34801561084157600080fd5b506103b26004803603606081101561085857600080fd5b506001600160a01b03813581169160208101359091169060400135151561186e565b34801561088657600080fd5b506103b26004803603604081101561089d57600080fd5b506001600160a01b0381351690602001351515611997565b3480156108c157600080fd5b5061035d611a98565b3480156108d657600080fd5b50610269600480360360808110156108ed57600080fd5b81359160208101359181019060608101604082013564010000000081111561091457600080fd5b82018360208201111561092657600080fd5b8035906020019184600183028401116401000000008311171561094857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250611aa7915050565b34801561099757600080fd5b506103c9600480360360208110156109ae57600080fd5b5035611b16565b3480156109c157600080fd5b506103b2600480360360808110156109d857600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135640100000000811115610a1357600080fd5b820183602082011115610a2557600080fd5b80359060200191846001830284011164010000000083111715610a4757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611b28945050505050565b348015610a9457600080fd5b5061026960048036036060811015610aab57600080fd5b6001600160a01b038235169190810190604081016020820135640100000000811115610ad657600080fd5b820183602082011115610ae857600080fd5b80359060200191846001830284011164010000000083111715610b0a57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250611b86915050565b348015610b5957600080fd5b506102be60048036036020811015610b7057600080fd5b5035611bf6565b348015610b8357600080fd5b5061026960048036036040811015610b9a57600080fd5b506001600160a01b0381358116916020013516611dda565b348015610bbe57600080fd5b506103c9611e08565b348015610bd357600080fd5b506103b260048036036020811015610bea57600080fd5b50356001600160a01b0316611e0e565b348015610c0657600080fd5b5061026960048036036020811015610c1d57600080fd5b5035611f06565b6001600160e01b0319811660009081526001602052604090205460ff165b919050565b60008281526018602052604081205460ff16610c9f576040805162461bcd60e51b81526020600482015260126024820152714e6f7420612076616c69642073657269657360701b604482015290519081900360640190fd5b60008381526017602052604090205460011115610cf9576040805162461bcd60e51b815260206004820152601360248201527253657269657320697320534f4c44204f55542160681b604482015290519081900360640190fd5b600083815260176020526040902060010154341015610d495760405162461bcd60e51b81526004018080602001828103825260288152602001806135856028913960400191505060405180910390fd5b600083815260176020526040902054610d63906001612042565b6000848152601760205260409020819055610d8f576000838152601860205260409020805460ff191690555b34610da36001610d9d611170565b90612084565b60405133907fb0442210ef7e89767af2eeb7f3e41f8a7efeaf443711463e8d0d54106b082a0690600090a46000838152601760209081526040918290206004018054835160026001831615610100026000190190921691909104601f8101849004840282018401909452838152610e88938693919291830182828015610e6a5780601f10610e3f57610100808354040283529160200191610e6a565b820191906000526020600020905b815481529060010190602001808311610e4d57829003601f168201915b50505060008881526017602052604090206003015491506120de9050565b506000610ea16064610e9b34600a6120ea565b90612143565b6000858152601760205260409020600201549091506001600160a01b03166108fc610ecc3484612042565b6040518115909202916000818181858888f19350505050158015610ef4573d6000803e3d6000fd5b5080471015610f4a576040805162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f7567682062616c616e636520746f2073656e64206665650000604482015290519081900360640190fd5b6016546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610f84573d6000803e3d6000fd5b5060019150505b92915050565b600d8054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561101d5780601f10610ff25761010080835404028352916020019161101d565b820191906000526020600020905b81548152906001019060200180831161100057829003601f168201915b5050505050905090565b600061103282611f06565b61106d5760405162461bcd60e51b815260040180806020018281038252602c815260200180613463602c913960400191505060405180910390fd5b506000908152600560205260409020546001600160a01b031690565b600061109482611461565b9050806001600160a01b0316836001600160a01b031614156110e75760405162461bcd60e51b81526004018080602001828103825260218152602001806135336021913960400191505060405180910390fd5b806001600160a01b03166110f9612185565b6001600160a01b0316148061111a575061111a81611115612185565b611dda565b6111555760405162461bcd60e51b81526004018080602001828103825260388152602001806133b96038913960400191505060405180910390fd5b61115f8383612189565b505050565b60155481565b60135481565b60125490565b611187611181612185565b826121f7565b6111c25760405162461bcd60e51b81526004018080602001828103825260318152602001806135546031913960400191505060405180910390fd5b61115f838383612293565b60008060006111db8561243b565b6014549091506001600160a01b03166111fa612710610e9b84886120ea565b92509250509250929050565b6000611210612185565b6000546001600160a01b03908116911614611260576040805162461bcd60e51b815260206004820181905260248201526000805160206134bb833981519152604482015290519081900360640190fd5b60105460ff16831080159061127757506011548311155b6112b25760405162461bcd60e51b815260040180806020018281038252602781526020018061341b6027913960400191505060405180910390fd5b6112bd84848461256c565b5060015b9392505050565b6001600160a01b03821660009081526002602052604081206112e990612763565b8211610f8b576001600160a01b0383166000908152600260205260409020611311908361276e565b9050610f8b565b60086020526000908152604090205481565b60125481565b600061133a612185565b6000546001600160a01b0390811691161461138a576040805162461bcd60e51b815260206004820181905260248201526000805160206134bb833981519152604482015290519081900360640190fd5b611394838361277a565b50600192915050565b61115f83838360405180602001604052806000815250611b28565b60186020526000908152604090205460ff1681565b60006113d882611f06565b156113e4575080610c42565b6040805162461bcd60e51b815260206004820152601760248201527f4e6f20746f6b656e20666f756e6420617420696e646578000000000000000000604482015290519081900360640190fd5b600a602052600090815260409020805460018201546002830154600390930154919290916001600160a01b031684565b60008161147057506000610c42565b61147b60038361289c565b156114925761148b6003836128a8565b9050610c42565b60006114a96011548461214390919063ffffffff16565b6010549091506000906114c790600190610d9d90879060ff16612143565b90506013548111156114d857506013545b80821480156114e657508115155b156114f2576001820391505b6000825b8281101561159f57600081815260096020526040902060019061151890612763565b10611597576000818152600960205260409020869061153890600161276e565b10611597576000818152600a6020526040902054861080159061156c57506000818152600a60205260409020600101548611155b15611597576000908152600a60205260409020600301546001600160a01b03169350610c4292505050565b6001016114f6565b509250610c42915050565b601760209081526000918252604091829020805460018083015460028085015460038601546004870180548a516101009782161597909702600019011693909304601f8101899004890286018901909952888552949792966001600160a01b03909116959392908301828280156116625780601f1061163757610100808354040283529160200191611662565b820191906000526020600020905b81548152906001019060200180831161164557829003601f168201915b5050505050905085565b600e8054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561101d5780601f10610ff25761010080835404028352916020019161101d565b60006001600160a01b0382166117145760405162461bcd60e51b815260040180806020018281038252602a8152602001806133f1602a913960400191505060405180910390fd5b506001600160a01b031660009081526008602052604090205490565b611738612185565b6000546001600160a01b03908116911614611788576040805162461bcd60e51b815260206004820181905260248201526000805160206134bb833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6001600160a01b038216600090815260026020526040812081906117f6908461276e565b949350505050565b6000546001600160a01b031690565b600f8054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561101d5780601f10610ff25761010080835404028352916020019161101d565b611876612185565b6000546001600160a01b039081169116146118c6576040805162461bcd60e51b815260206004820181905260248201526000805160206134bb833981519152604482015290519081900360640190fd5b826001600160a01b0316826001600160a01b03161415611929576040805162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b604482015290519081900360640190fd5b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff1916861515908117909155825190815291517f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319281900390910190a3505050565b61199f612185565b6001600160a01b0316826001600160a01b03161415611a01576040805162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b604482015290519081900360640190fd5b8060066000611a0e612185565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155611a52612185565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405180821515815260200191505060405180910390a35050565b6016546001600160a01b031681565b6000611ab1612185565b6000546001600160a01b03908116911614611b01576040805162461bcd60e51b815260206004820181905260248201526000805160206134bb833981519152604482015290519081900360640190fd5b611b0d858585856128b4565b95945050505050565b600b6020526000908152604090205481565b611b39611b33612185565b836121f7565b611b745760405162461bcd60e51b81526004018080602001828103825260318152602001806135546031913960400191505060405180910390fd5b611b80848484846129a4565b50505050565b6000611b90612185565b6000546001600160a01b03908116911614611be0576040805162461bcd60e51b815260206004820181905260248201526000805160206134bb833981519152604482015290519081900360640190fd5b611bea848361277a565b6112bd601254846129f6565b6060611c0182611f06565b611c3c5760405162461bcd60e51b815260040180806020018281038252602f815260200180613504602f913960400191505060405180910390fd5b6000828152600c602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845260609392830182828015611cd15780601f10611ca657610100808354040283529160200191611cd1565b820191906000526020600020905b815481529060010190602001808311611cb457829003601f168201915b5050600e5493945050505060026000196101006001841615020190911604611cfa579050610c42565b805115611d08579050610c42565b600e611d1384612a59565b6040516020018083805460018160011615610100020316600290048015611d715780601f10611d4f576101008083540402835291820191611d71565b820191906000526020600020905b815481529060010190602001808311611d5d575b5050825160208401908083835b60208310611d9d5780518252601f199092019160209182019101611d7e565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052915050919050565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b60115481565b611e16612185565b6000546001600160a01b03908116911614611e66576040805162461bcd60e51b815260206004820181905260248201526000805160206134bb833981519152604482015290519081900360640190fd5b6001600160a01b038116611eab5760405162461bcd60e51b81526004018080602001828103825260268152602001806133436026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600081611f1557506000610c42565b611f2060038361289c565b15611f305761148b60038361289c565b611f38611170565b8211610c42576000611f556011548461214390919063ffffffff16565b601054909150600090611f7390600190610d9d90879060ff16612143565b9050601354811115611f8457506013545b8082148015611f9257508115155b15611fa557611fa2826001612042565b91505b815b81811015612036576000818152600960205260409020600190611fc990612763565b1061202e5760008181526009602052604090208590611fe990600161276e565b1061202e576000818152600a6020526040902054851080159061201d57506000818152600a60205260409020600101548511155b1561202e5760019350505050610c42565b600101611fa7565b50600092505050610c42565b60006112c183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612b23565b6000828201838110156112c1576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611bea848361277a565b6000826120f957506000610f8b565b8282028284828161210657fe5b04146112c15760405162461bcd60e51b81526004018080602001828103825260218152602001806134426021913960400191505060405180910390fd5b60006112c183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612bba565b3390565b600081815260056020526040902080546001600160a01b0319166001600160a01b03841690811790915581906121be82611461565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061220282611f06565b61223d5760405162461bcd60e51b815260040180806020018281038252602c81526020018061338d602c913960400191505060405180910390fd5b600061224883611461565b9050806001600160a01b0316846001600160a01b031614806122835750836001600160a01b031661227884611027565b6001600160a01b0316145b806117f657506117f68185611dda565b826001600160a01b03166122a682611461565b6001600160a01b0316146122eb5760405162461bcd60e51b81526004018080602001828103825260298152602001806134db6029913960400191505060405180910390fd5b6001600160a01b0382166123305760405162461bcd60e51b81526004018080602001828103825260248152602001806133696024913960400191505060405180910390fd5b61233b600082612189565b6001600160a01b03831660009081526008602052604090205461235f906001612042565b6001600160a01b03808516600090815260086020526040808220939093559084168152205461238f906001612084565b6001600160a01b0380841660009081526008602090815260408083209490945591861681526002909152206123c49082612c1f565b506001600160a01b03821660009081526002602052604090206123e79082612c2b565b506123f460038284612c37565b5080826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000818152600b60205260408120541561246457506000818152600b6020526040902054610c42565b600061247b6011548461214390919063ffffffff16565b60105490915060009061249990600190610d9d90879060ff16612143565b90506013548111156124aa57506013545b80821480156124b857508115155b156124cb576124c8826001612042565b91505b815b818110156120365760008181526009602052604090206001906124ef90612763565b10612564576000818152600960205260409020859061250f90600161276e565b10612564576000818152600a6020526040902054851080159061254357506000818152600a60205260409020600101548511155b15612564576000908152600a60205260409020600201549250610c42915050565b6001016124cd565b6001600160a01b0383166125c7576040805162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015290519081900360640190fd5b60005b828161ffff161015612628576012546125ea9061ffff6001840116612084565b6040516001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46001016125ca565b50604051806080016040528060125481526020016126518460125461208490919063ffffffff16565b8152602080820184905233604092830152601380546000908152600a835283812085518155858401516001820155858501516002820155606090950151600390950180546001600160a01b0319166001600160a01b039096169590951790945560125490548452600990915291206126c891612c2b565b506126f86126e16012548461208490919063ffffffff16565b601354600090815260096020526040902090612c2b565b503360009081526007602052604090206127129083612c2b565b50601354612721906001612084565b6013553360009081526008602052604090205461273e9083612084565b3360009081526008602052604090205560125461275b9083612084565b601255505050565b6000610f8b82612c4d565b60006112c18383612c51565b6001600160a01b0382166127d5576040805162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015290519081900360640190fd5b6012546127e3906001612084565b60128190556001600160a01b038316600090815260026020526040902061280991612c2b565b5060125461281a9060039084612c37565b506012546000908152600b602090815260408083208490556001600160a01b03851683526008909152902054612851906001612084565b6001600160a01b0383166000818152600860205260408082209390935560125492517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006112c18383612cb5565b60006112c18383612ccd565b6015546000906128c5906001612084565b601581815560009182526018602090815260408084208054600160ff199091168117909155815160a0810183528a81528084018a815233828501908152606083018a8152608084018c81529754895260178752949097208251815590519281019290925594516002820180546001600160a01b0319166001600160a01b039092169190911790559051600382015591518051612967926004850192019061325b565b5050604051869150859033907f335cf3124d4c238e9c1bbae5ae98a445bab5de090df6b8b94e94caab3ffb45f690600090a4506001949350505050565b6129af848484612293565b6129bb84848484612d0f565b611b805760405162461bcd60e51b81526004018080602001828103825260328152602001806133116032913960400191505060405180910390fd5b6129ff82611f06565b612a3a5760405162461bcd60e51b815260040180806020018281038252602c81526020018061348f602c913960400191505060405180910390fd5b6000828152600c60209081526040909120825161115f9284019061325b565b606081612a7e57506040805180820190915260018152600360fc1b6020820152610c42565b8160005b8115612a9657600101600a82049150612a82565b60608167ffffffffffffffff81118015612aaf57600080fd5b506040519080825280601f01601f191660200182016040528015612ada576020820181803683370190505b5090505b84156117f65760001990910190600a850660300160f81b818381518110612b0157fe5b60200101906001600160f81b031916908160001a905350600a85049450612ade565b60008184841115612bb25760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b77578181015183820152602001612b5f565b50505050905090810190601f168015612ba45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183612c095760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612b77578181015183820152602001612b5f565b506000838581612c1557fe5b0495945050505050565b60006112c18383612e77565b60006112c18383612f3d565b60006117f684846001600160a01b038516612f87565b5490565b81546000908210612c935760405162461bcd60e51b81526004018080602001828103825260228152602001806132ef6022913960400191505060405180910390fd5b826000018281548110612ca257fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b60006112c183836040518060400160405280601e81526020017f456e756d657261626c654d61703a206e6f6e6578697374656e74206b6579000081525061301e565b6000612d23846001600160a01b03166130ab565b612d2f575060016117f6565b6060612e3d630a85bd0160e11b612d44612185565b88878760405160240180856001600160a01b03168152602001846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612dab578181015183820152602001612d93565b50505050905090810190601f168015612dd85780820380516001836020036101000a031916815260200191505b5095505050505050604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b038381831617835250505050604051806060016040528060328152602001613311603291396001600160a01b03881691906130e4565b90506000818060200190516020811015612e5657600080fd5b50516001600160e01b031916630a85bd0160e11b1492505050949350505050565b60008181526001830160205260408120548015612f335783546000198083019190810190600090879083908110612eaa57fe5b9060005260206000200154905080876000018481548110612ec757fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080612ef757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610f8b565b6000915050610f8b565b6000612f498383612cb5565b612f7f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610f8b565b506000610f8b565b600082815260018401602052604081205480612fec5750506040805180820182528381526020808201848152865460018181018955600089815284812095516002909302909501918255915190820155865486845281880190925292909120556112c1565b82856000016001830381548110612fff57fe5b90600052602060002090600202016001018190555060009150506112c1565b6000828152600184016020526040812054828161307c5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612b77578181015183820152602001612b5f565b5084600001600182038154811061308f57fe5b9060005260206000209060020201600101549150509392505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906117f6575050151592915050565b60606117f6848460008560606130f9856130ab565b61314a576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106131895780518252601f19909201916020918201910161316a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146131eb576040519150601f19603f3d011682016040523d82523d6000602084013e6131f0565b606091505b509150915081156132045791506117f69050565b8051156132145780518082602001fd5b60405162461bcd60e51b8152602060048201818152865160248401528651879391928392604401919085019080838360008315612b77578181015183820152602001612b5f565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061329c57805160ff19168380011785556132c9565b828001600101855582156132c9579182015b828111156132c95782518255916020019190600101906132ae565b506132d59291506132d9565b5090565b5b808211156132d557600081556001016132da56fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e64734552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734552433732313a207472616e7366657220746f20746865207a65726f20616464726573734552433732313a206f70657261746f7220717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f76656420666f7220616c6c4552433732313a2062616c616e636520717565727920666f7220746865207a65726f206164647265737343616e206f6e6c79206d696e74206265747765656e203220616e64203230303020746f6b656e73536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774552433732313a20617070726f76656420717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732314d657461646174613a2055524920736574206f66206e6f6e6578697374656e7420746f6b656e4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724552433732313a207472616e73666572206f6620746f6b656e2074686174206973206e6f74206f776e4552433732314d657461646174613a2055524920717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76616c20746f2063757272656e74206f776e65724552433732313a207472616e736665722063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f766564496e76616c696420616d6f756e742073656e7420746f2070757263686173652074686973204e4654a2646970667358221220e5844e7b23ba3eb170fb77325803888dfd777c169a0b3b8329810165df8c842c64736f6c634300060c0033
1
20,291,016
8ef612f8a36fd4c29e12816c3564579ef4294e622351fe2764fee382b5e2af3f
ed4c7683d41ebd94970c9a74d617a3dd696c91ea21e0e9ba86704c5bef3cdbda
849a02be4c2ec8bbd06052c5a0cd51147994ad96
39c40c8f040cf363fa3cc6ed379dced87f318c36
a9d50ceb5c99cf17599897bdcc5ed81b3008bd6a
608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe
1
20,291,016
8ef612f8a36fd4c29e12816c3564579ef4294e622351fe2764fee382b5e2af3f
1bfad1c205ef77a01ce9014e1d7ba3423b444437b63a94a729f542052db52ada
c5533be6e51460c47e2e6ee214ca70d3678dd417
c5533be6e51460c47e2e6ee214ca70d3678dd417
d38530d8d8ebd6e5b70adb7e5d261020c59556ea
60a060405234801561001057600080fd5b503360805260805161022461003c6000396000818160870152818160df015261017a01526102246000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100665780638da5cb5b14610082578063fdacd576146100c1575b600080fd5b61006461005f3660046101a5565b6100d4565b005b61006f60005481565b6040519081526020015b60405180910390f35b6100a97f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610079565b6100646100cf3660046101d5565b61016f565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561016c57600054604051637ed66abb60e11b815282916001600160a01b0383169163fdacd576916101389160040190815260200190565b600060405180830381600087803b15801561015257600080fd5b505af1158015610166573d6000803e3d6000fd5b50505050505b50565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561016c57600055565b6000602082840312156101b757600080fd5b81356001600160a01b03811681146101ce57600080fd5b9392505050565b6000602082840312156101e757600080fd5b503591905056fea2646970667358221220b1e10dacaa7cee0d35f3627433abf3762fdd39e9feaff847d05bcdf719254aa564736f6c634300080b0033
608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100665780638da5cb5b14610082578063fdacd576146100c1575b600080fd5b61006461005f3660046101a5565b6100d4565b005b61006f60005481565b6040519081526020015b60405180910390f35b6100a97f000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd41781565b6040516001600160a01b039091168152602001610079565b6100646100cf3660046101d5565b61016f565b336001600160a01b037f000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd41716141561016c57600054604051637ed66abb60e11b815282916001600160a01b0383169163fdacd576916101389160040190815260200190565b600060405180830381600087803b15801561015257600080fd5b505af1158015610166573d6000803e3d6000fd5b50505050505b50565b336001600160a01b037f000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd41716141561016c57600055565b6000602082840312156101b757600080fd5b81356001600160a01b03811681146101ce57600080fd5b9392505050565b6000602082840312156101e757600080fd5b503591905056fea2646970667358221220b1e10dacaa7cee0d35f3627433abf3762fdd39e9feaff847d05bcdf719254aa564736f6c634300080b0033
1
20,291,016
8ef612f8a36fd4c29e12816c3564579ef4294e622351fe2764fee382b5e2af3f
f25c9bc630bdb603e512cdbafecdd7e8bb84f78ffae88056f535d7f3bafa6a7e
00bdb5699745f5b860228c8f939abf1b9ae374ed
ffa397285ce46fb78c588a9e993286aac68c37cd
6259154e8f89560e773cacf092d3da306c9b5a76
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,291,017
874c3900e665658924da81b7c8705d71dc089ddbfb0e02d4ecb905cf49d8e674
077c3b2b357086a5d6d4abb472e0182b7c3000e9a49ecacd7732a1a3d86e23a1
48b97325e6559ffef92966bdd7840bb04c3e87cf
48b97325e6559ffef92966bdd7840bb04c3e87cf
03a2a4ae4bcafec89638a7cee56c9cd5848c4aaf
608060405267016345785d8a0000600b5560405180610120016040528061a41062ffffff16815260200161f55062ffffff168152602001620132a462ffffff16815260200162017f3462ffffff1681526020016201baf862ffffff1681526020016201f78462ffffff1681526020016202434c62ffffff1681526020016202904062ffffff1681526020015f62ffffff16815250600c9060096100a392919061041a565b506100c4670de0b6b3a764000064012a05f20061027b60201b90919060201c565b600d553480156100d2575f80fd5b50604051614a7b380380614a7b83398181016040528101906100f491906104e5565b5f60015f6101000a81548160ff02191690831515021790555060016002819055506101275f801b846102bb60201b60201c565b506101587f6343452265350cc926492d9bfc7710ca06328d7c328cdb091fde925c1441e7a8846102bb60201b60201c565b506101897f6a4b509b5f306a69ec99e97ff6b166daad9c0a3dfce739a6d67ad1c57143a6b2846102bb60201b60201c565b508360035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505f6007819055505f6008819055505f600460146101000a81548160ff0219169083151502179055508160095f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600a5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505061061d565b5f80830361028b575f90506102b5565b5f8284610298919061057f565b90508284826102a791906105ed565b146102b0575f80fd5b809150505b92915050565b5f6102cc83836103b060201b60201c565b6103a65760015f808581526020019081526020015f205f015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555061034361041360201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4600190506103aa565b5f90505b92915050565b5f805f8481526020019081526020015f205f015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16905092915050565b5f33905090565b828054828255905f5260205f2090810192821561045b579160200282015b8281111561045a578251829062ffffff16905591602001919060010190610438565b5b509050610468919061046c565b5090565b5b80821115610483575f815f90555060010161046d565b5090565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6104b48261048b565b9050919050565b6104c4816104aa565b81146104ce575f80fd5b50565b5f815190506104df816104bb565b92915050565b5f805f80608085870312156104fd576104fc610487565b5b5f61050a878288016104d1565b945050602061051b878288016104d1565b935050604061052c878288016104d1565b925050606061053d878288016104d1565b91505092959194509250565b5f819050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61058982610549565b915061059483610549565b92508282026105a281610549565b915082820484148315176105b9576105b8610552565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6105f782610549565b915061060283610549565b925082610612576106116105c0565b5b828204905092915050565b6144518061062a5f395ff3fe608060405260043610610233575f3560e01c80635c975abb1161012d578063b5f7f636116100aa578063de1ea8661161006e578063de1ea866146108b5578063ecb499e0146108df578063f283439214610909578063f9d0831a14610939578063fa8bf0751461096157610273565b8063b5f7f636146107d5578063b8bb1c57146107ff578063ba0317d114610829578063d11e662d14610865578063d547741f1461088d57610273565b806391d14854116100f157806391d14854146106f15780639326197a1461072d578063a1c1418c14610757578063a217fddf14610781578063a646b909146107ab57610273565b80635c975abb146105fd5780635db7060f146106275780636fac731a146106635780638456cb591461069f5780638e17c017146106b557610273565b8063248a9ca3116101bb57806336568abe1161017f57806336568abe1461052f5780633f4ba83a1461055757806355440fc11461056d57806359995cdb146105975780635bf5d54c146105d357610273565b8063248a9ca31461045d57806328814c301461049957806328dae6e3146104c15780632b836261146104d75780632f2ff15d1461050757610273565b80630ffbdcaa116102025780630ffbdcaa1461034357806313e9924c1461037f57806316345f18146103a957806317274bdc146103e557806318f52ff21461042157610273565b806301ffc9a71461027757806307a3a067146102b357806307c52d83146102ef5780630e5f27741461031957610273565b36610273577f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258743334604051610269929190613103565b60405180910390a1005b5f80fd5b348015610282575f80fd5b5061029d60048036038101906102989190613190565b61099d565b6040516102aa91906131d5565b60405180910390f35b3480156102be575f80fd5b506102d960048036038101906102d49190613218565b610a16565b6040516102e691906131d5565b60405180910390f35b3480156102fa575f80fd5b50610303610a6d565b6040516103109190613243565b60405180910390f35b348015610324575f80fd5b5061032d610a92565b60405161033a91906131d5565b60405180910390f35b34801561034e575f80fd5b5061036960048036038101906103649190613286565b610ac3565b60405161037691906131d5565b60405180910390f35b34801561038a575f80fd5b50610393610ae1565b6040516103a09190613243565b60405180910390f35b3480156103b4575f80fd5b506103cf60048036038101906103ca91906132ec565b610b16565b6040516103dc9190613243565b60405180910390f35b3480156103f0575f80fd5b5061040b60048036038101906104069190613218565b610bd6565b60405161041891906131d5565b60405180910390f35b34801561042c575f80fd5b5061044760048036038101906104429190613317565b610d9a565b6040516104549190613243565b60405180910390f35b348015610468575f80fd5b50610483600480360381019061047e9190613388565b610e2e565b60405161049091906133c2565b60405180910390f35b3480156104a4575f80fd5b506104bf60048036038101906104ba9190613405565b610e4a565b005b3480156104cc575f80fd5b506104d5610e4f565b005b6104f160048036038101906104ec9190613455565b610ebe565b6040516104fe91906131d5565b60405180910390f35b348015610512575f80fd5b5061052d600480360381019061052891906134a5565b61103b565b005b34801561053a575f80fd5b50610555600480360381019061055091906134a5565b61105d565b005b348015610562575f80fd5b5061056b6110d8565b005b348015610578575f80fd5b506105816110f7565b60405161058e919061351f565b60405180910390f35b3480156105a2575f80fd5b506105bd60048036038101906105b89190613218565b6111ff565b6040516105ca9190613596565b60405180910390f35b3480156105de575f80fd5b506105e761137d565b6040516105f49190613243565b60405180910390f35b348015610608575f80fd5b50610611611383565b60405161061e91906131d5565b60405180910390f35b348015610632575f80fd5b5061064d600480360381019061064891906135af565b611398565b60405161065a91906131d5565b60405180910390f35b34801561066e575f80fd5b5061068960048036038101906106849190613218565b611608565b60405161069691906131d5565b60405180910390f35b3480156106aa575f80fd5b506106b36117cc565b005b3480156106c0575f80fd5b506106db60048036038101906106d69190613218565b6117eb565b6040516106e891906131d5565b60405180910390f35b3480156106fc575f80fd5b50610717600480360381019061071291906134a5565b611842565b60405161072491906131d5565b60405180910390f35b348015610738575f80fd5b506107416118a5565b60405161074e91906133c2565b60405180910390f35b348015610762575f80fd5b5061076b6118c9565b60405161077891906133c2565b60405180910390f35b34801561078c575f80fd5b506107956118ed565b6040516107a291906133c2565b60405180910390f35b3480156107b6575f80fd5b506107bf6118f3565b6040516107cc9190613243565b60405180910390f35b3480156107e0575f80fd5b506107e9611916565b6040516107f69190613243565b60405180910390f35b34801561080a575f80fd5b50610813611939565b60405161082091906131d5565b60405180910390f35b348015610834575f80fd5b5061084f600480360381019061084a91906135ff565b611ce5565b60405161085c91906131d5565b60405180910390f35b348015610870575f80fd5b5061088b60048036038101906108869190613779565b611f98565b005b348015610898575f80fd5b506108b360048036038101906108ae91906134a5565b611f9c565b005b3480156108c0575f80fd5b506108c9611fbe565b6040516108d69190613243565b60405180910390f35b3480156108ea575f80fd5b506108f3611fe1565b6040516109009190613243565b60405180910390f35b610923600480360381019061091e9190613455565b61209a565b60405161093091906131d5565b60405180910390f35b348015610944575f80fd5b5061095f600480360381019061095a9190613218565b61221c565b005b34801561096c575f80fd5b50610987600480360381019061098291906135af565b6123d3565b60405161099491906131d5565b60405180910390f35b5f7f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610a0f5750610a0e82612746565b5b9050919050565b5f805f1b610a23816127af565b82600a5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001915050919050565b5f600c60075481548110610a8457610a836137d3565b5b905f5260205f200154905090565b5f805f1b610a9f816127af565b610ab560016007546127c390919063ffffffff16565b600781905550600191505090565b5f805f1b610ad0816127af565b826008819055506001915050919050565b5f80600654600d54610af3919061382d565b9050610b10670de0b6b3a7640000826127e990919063ffffffff16565b91505090565b5f808273ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610b61573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b8591906138e6565b5050509150505f8113610bcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc4906139b7565b60405180910390fd5b80915050919050565b5f805f1b610be3816127af565b6001600e5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490501015610c67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5e90613a1f565b60405180910390fd5b5f600e5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f81548110610cb757610cb66137d3565b5b905f5260205f2090600302016002015f6101000a81548160ff0219169083151502179055610d1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1190613a87565b60405180910390fd5b6001600e5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f81548110610d6b57610d6a6137d3565b5b905f5260205f2090600302016002015f6101000a81548160ff0219169083151502179055506001915050919050565b5f80610da4610a6d565b90505f610db085610b16565b90505f610e20610dce6402540be4008461280e90919063ffffffff16565b610e12610dec670de0b6b3a76400008961280e90919063ffffffff16565b610e046402540be4008861280e90919063ffffffff16565b61280e90919063ffffffff16565b6127e990919063ffffffff16565b905080935050505092915050565b5f805f8381526020019081526020015f20600101549050919050565b505050565b5f801b610e5b816127af565b600780541015610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790613aef565b60405180910390fd5b6001600460146101000a81548160ff02191690831515021790555050565b5f610ec761284e565b610ecf61288f565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610f4b57610f0b836128d3565b610f4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4190613b57565b60405180910390fd5b5b5f8290505f610f5a8287610d9a565b90505f60095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682604051610fa290613ba2565b5f6040518083038185875af1925050503d805f8114610fdc576040519150601f19603f3d011682016040523d82523d5f602084013e610fe1565b606091505b5050905080611025576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101c90613c00565b60405180910390fd5b60019350505050611034612940565b9392505050565b61104482610e2e565b61104d816127af565b611057838361294a565b50505050565b611065612a33565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146110c9576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110d38282612a3a565b505050565b6110e0612b23565b5f801b6110ec816127af565b6110f4612b63565b50565b6110ff61305e565b5f600f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208054905011611181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117890613c68565b60405180910390fd5b600f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815481106111d0576111cf6137d3565b5b905f5260205f2090600202016040518060400160405290815f8201548152602001600182015481525050905090565b611207613076565b5f801b611213816127af565b6001600e5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490501015611297576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128e90613a1f565b60405180910390fd5b600e5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815481106112e6576112e56137d3565b5b905f5260205f2090600302016040518060600160405290815f82015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015f9054906101000a900460ff161515151581525050915050919050565b60075481565b5f60015f9054906101000a900460ff16905090565b5f805f1b6113a5816127af565b5f600e5f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208054905011156114f05783600e5f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8154811061143d5761143c6137d3565b5b905f5260205f2090600302015f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600e5f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815481106114d8576114d76137d3565b5b905f5260205f209060030201600101819055506115fc565b5f60405180606001604052808673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001600115158152509050600e5f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002015f6101000a81548160ff0219169083151502179055505050505b60019150509392505050565b5f805f1b611615816127af565b6001600e5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490501015611699576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169090613a1f565b60405180910390fd5b6001600e5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815481106116ea576116e96137d3565b5b905f5260205f2090600302016002015f6101000a81548160ff021916908315150217905561174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174490613cd0565b60405180910390fd5b5f600e5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8154811061179d5761179c6137d3565b5b905f5260205f2090600302016002015f6101000a81548160ff0219169083151502179055506001915050919050565b6117d461284e565b5f801b6117e0816127af565b6117e8612bc4565b50565b5f805f1b6117f8816127af565b8260095f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001915050919050565b5f805f8481526020019081526020015f205f015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16905092915050565b7f6a4b509b5f306a69ec99e97ff6b166daad9c0a3dfce739a6d67ad1c57143a6b281565b7f6343452265350cc926492d9bfc7710ca06328d7c328cdb091fde925c1441e7a881565b5f801b81565b5f611911670de0b6b3a7640000600d546127e990919063ffffffff16565b905090565b5f611934670de0b6b3a76400006005546127e990919063ffffffff16565b905090565b5f61194261288f565b5f600f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2080549050116119c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119bb90613d38565b60405180910390fd5b600460149054906101000a900460ff16611a13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0a90613da0565b60405180910390fd5b5f60085411611a57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4e90613e08565b60405180910390fd5b5f611b26600f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f81548110611aaa57611aa96137d3565b5b905f5260205f20906002020160010154600f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f81548110611b0957611b086137d3565b5b905f5260205f2090600202015f01546127c390919063ffffffff16565b9050600a5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660045f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166399c6d2de33836008546040518463ffffffff1660e01b8152600401611be993929190613e26565b6020604051808303815f875af1158015611c05573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c299190613e6f565b611c68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5f90613ee4565b60405180910390fd5b611cd5600a5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c259092919063ffffffff16565b6001915050611ce2612940565b90565b5f611cee61288f565b7f6a4b509b5f306a69ec99e97ff6b166daad9c0a3dfce739a6d67ad1c57143a6b2611d18816127af565b611d20611916565b611d28611fe1565b11611d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5f90613f4c565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603611dd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcd90613fb4565b60405180910390fd5b5f8311611e18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e0f90614042565b60405180910390fd5b600d54611e4a611e39670de0b6b3a76400008661280e90919063ffffffff16565b6006546127c390919063ffffffff16565b1115611e8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e82906140d0565b60405180910390fd5b600860075410611ed0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec790614138565b60405180910390fd5b5f6040518060400160405280611ef7670de0b6b3a76400008761280e90919063ffffffff16565b81526020015f8152509050600f5f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081908060018154018082558091505060019003905f5260205f2090600202015f909190919091505f820151815f0155602082015181600101555050611f8384612ca4565b50600192505050611f92612940565b92915050565b5050565b611fa582610e2e565b611fae816127af565b611fb88383612a3a565b50505050565b5f611fdc670de0b6b3a76400006006546127e990919063ffffffff16565b905090565b5f612095670de0b6b3a764000060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016120489190614156565b602060405180830381865afa158015612063573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612087919061416f565b6127e990919063ffffffff16565b905090565b5f6120a361284e565b6120ab61288f565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612127576120e7836128d3565b612126576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161211d90613b57565b60405180910390fd5b5b5f8290505f6121368287610d9a565b90505f600e5f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f81548110612188576121876137d3565b5b905f5260205f2090600302015f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506122063360095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16848473ffffffffffffffffffffffffffffffffffffffff16612d47909392919063ffffffff16565b60019350505050612215612940565b9392505050565b61222461288f565b5f801b612230816127af565b3073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361229e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122959061420a565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361231a573373ffffffffffffffffffffffffffffffffffffffff166108fc4790811502906040515f60405180830381858888f19350505050158015612314573d5f803e3d5ffd5b506123c7565b5f8290505f8173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016123589190614156565b602060405180830381865afa158015612373573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612397919061416f565b90506123c433828473ffffffffffffffffffffffffffffffffffffffff16612c259092919063ffffffff16565b50505b506123d0612940565b50565b5f7f6a4b509b5f306a69ec99e97ff6b166daad9c0a3dfce739a6d67ad1c57143a6b26123fe816127af565b612407856128d3565b612446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161243d90613b57565b60405180910390fd5b5f600f5f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f81548110612496576124956137d3565b5b905f5260205f2090600202015f0154116124e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124dc90614272565b60405180910390fd5b612570612503670de0b6b3a76400008561280e90919063ffffffff16565b600f5f8873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f81548110612552576125516137d3565b5b905f5260205f209060020201600101546127c390919063ffffffff16565b600f5f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815481106125bf576125be6137d3565b5b905f5260205f2090600202016001018190555061265d6125f0670de0b6b3a76400008561280e90919063ffffffff16565b600f5f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8154811061263f5761263e6137d3565b5b905f5260205f209060020201600101546127c390919063ffffffff16565b600f5f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815481106126ac576126ab6137d3565b5b905f5260205f209060020201600101819055508360105f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019150509392505050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6127c0816127bb612a33565b612dc9565b50565b5f8082846127d19190614290565b9050838110156127df575f80fd5b8091505092915050565b5f8082116127f5575f80fd5b5f828461280291906142f0565b90508091505092915050565b5f80830361281e575f9050612848565b5f828461282b9190614320565b905082848261283a91906142f0565b14612843575f80fd5b809150505b92915050565b612856611383565b1561288d576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b60028054036128ca576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028081905550565b5f805f600f5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f81548110612925576129246137d3565b5b905f5260205f2090600202015f015411905080915050919050565b6001600281905550565b5f6129558383611842565b612a295760015f808581526020019081526020015f205f015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055506129c6612a33565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a460019050612a2d565b5f90505b92915050565b5f33905090565b5f612a458383611842565b15612b19575f805f8581526020019081526020015f205f015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550612ab6612a33565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a460019050612b1d565b5f90505b92915050565b612b2b611383565b612b61576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b612b6b612b23565b5f60015f6101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612bad612a33565b604051612bba9190614156565b60405180910390a1565b612bcc61284e565b6001805f6101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612c0e612a33565b604051612c1b9190614156565b60405180910390a1565b612c9f838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401612c58929190613103565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e1a565b505050565b5f612cd4612cc3670de0b6b3a76400008461280e90919063ffffffff16565b6005546127c390919063ffffffff16565b600581905550612d09612cf8670de0b6b3a76400008461280e90919063ffffffff16565b6006546127c390919063ffffffff16565b600681905550600d5460065403612d3e57612d3060016007546127c390919063ffffffff16565b6007819055505f6006819055505b60019050919050565b612dc3848573ffffffffffffffffffffffffffffffffffffffff166323b872dd868686604051602401612d7c93929190614361565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e1a565b50505050565b612dd38282611842565b612e165780826040517fe2517d3f000000000000000000000000000000000000000000000000000000008152600401612e0d929190614396565b60405180910390fd5b5050565b5f612e44828473ffffffffffffffffffffffffffffffffffffffff16612eaf90919063ffffffff16565b90505f815114158015612e68575080806020019051810190612e669190613e6f565b155b15612eaa57826040517f5274afe7000000000000000000000000000000000000000000000000000000008152600401612ea19190614156565b60405180910390fd5b505050565b6060612ebc83835f612ec4565b905092915050565b606081471015612f0b57306040517fcd786059000000000000000000000000000000000000000000000000000000008152600401612f029190614156565b60405180910390fd5b5f808573ffffffffffffffffffffffffffffffffffffffff168486604051612f339190614405565b5f6040518083038185875af1925050503d805f8114612f6d576040519150601f19603f3d011682016040523d82523d5f602084013e612f72565b606091505b5091509150612f82868383612f8d565b925050509392505050565b606082612fa257612f9d8261301a565b613012565b5f8251148015612fc857505f8473ffffffffffffffffffffffffffffffffffffffff163b145b1561300a57836040517f9996b3150000000000000000000000000000000000000000000000000000000081526004016130019190614156565b60405180910390fd5b819050613013565b5b9392505050565b5f8151111561302c5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180604001604052805f81526020015f81525090565b60405180606001604052805f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f151581525090565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6130d5826130ac565b9050919050565b6130e5816130cb565b82525050565b5f819050919050565b6130fd816130eb565b82525050565b5f6040820190506131165f8301856130dc565b61312360208301846130f4565b9392505050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61316f8161313b565b8114613179575f80fd5b50565b5f8135905061318a81613166565b92915050565b5f602082840312156131a5576131a4613133565b5b5f6131b28482850161317c565b91505092915050565b5f8115159050919050565b6131cf816131bb565b82525050565b5f6020820190506131e85f8301846131c6565b92915050565b6131f7816130cb565b8114613201575f80fd5b50565b5f81359050613212816131ee565b92915050565b5f6020828403121561322d5761322c613133565b5b5f61323a84828501613204565b91505092915050565b5f6020820190506132565f8301846130f4565b92915050565b613265816130eb565b811461326f575f80fd5b50565b5f813590506132808161325c565b92915050565b5f6020828403121561329b5761329a613133565b5b5f6132a884828501613272565b91505092915050565b5f6132bb826130cb565b9050919050565b6132cb816132b1565b81146132d5575f80fd5b50565b5f813590506132e6816132c2565b92915050565b5f6020828403121561330157613300613133565b5b5f61330e848285016132d8565b91505092915050565b5f806040838503121561332d5761332c613133565b5b5f61333a858286016132d8565b925050602061334b85828601613272565b9150509250929050565b5f819050919050565b61336781613355565b8114613371575f80fd5b50565b5f813590506133828161335e565b92915050565b5f6020828403121561339d5761339c613133565b5b5f6133aa84828501613374565b91505092915050565b6133bc81613355565b82525050565b5f6020820190506133d55f8301846133b3565b92915050565b6133e4816131bb565b81146133ee575f80fd5b50565b5f813590506133ff816133db565b92915050565b5f805f6060848603121561341c5761341b613133565b5b5f61342986828701613204565b935050602061343a86828701613272565b925050604061344b868287016133f1565b9150509250925092565b5f805f6060848603121561346c5761346b613133565b5b5f61347986828701613272565b935050602061348a86828701613204565b925050604061349b86828701613204565b9150509250925092565b5f80604083850312156134bb576134ba613133565b5b5f6134c885828601613374565b92505060206134d985828601613204565b9150509250929050565b6134ec816130eb565b82525050565b604082015f8201516135065f8501826134e3565b50602082015161351960208501826134e3565b50505050565b5f6040820190506135325f8301846134f2565b92915050565b613541816130cb565b82525050565b613550816131bb565b82525050565b606082015f82015161356a5f850182613538565b50602082015161357d60208501826134e3565b5060408201516135906040850182613547565b50505050565b5f6060820190506135a95f830184613556565b92915050565b5f805f606084860312156135c6576135c5613133565b5b5f6135d386828701613204565b93505060206135e486828701613204565b92505060406135f586828701613272565b9150509250925092565b5f806040838503121561361557613614613133565b5b5f61362285828601613204565b925050602061363385828601613272565b9150509250929050565b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61368b82613645565b810181811067ffffffffffffffff821117156136aa576136a9613655565b5b80604052505050565b5f6136bc61312a565b90506136c88282613682565b919050565b5f67ffffffffffffffff8211156136e7576136e6613655565b5b6136f082613645565b9050602081019050919050565b828183375f83830152505050565b5f61371d613718846136cd565b6136b3565b90508281526020810184848401111561373957613738613641565b5b6137448482856136fd565b509392505050565b5f82601f8301126137605761375f61363d565b5b813561377084826020860161370b565b91505092915050565b5f806040838503121561378f5761378e613133565b5b5f61379c85828601613272565b925050602083013567ffffffffffffffff8111156137bd576137bc613137565b5b6137c98582860161374c565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f613837826130eb565b9150613842836130eb565b925082820390508181111561385a57613859613800565b5b92915050565b5f69ffffffffffffffffffff82169050919050565b61387e81613860565b8114613888575f80fd5b50565b5f8151905061389981613875565b92915050565b5f819050919050565b6138b18161389f565b81146138bb575f80fd5b50565b5f815190506138cc816138a8565b92915050565b5f815190506138e08161325c565b92915050565b5f805f805f60a086880312156138ff576138fe613133565b5b5f61390c8882890161388b565b955050602061391d888289016138be565b945050604061392e888289016138d2565b935050606061393f888289016138d2565b92505060806139508882890161388b565b9150509295509295909350565b5f82825260208201905092915050565b7f48504c4720496e76616c696420707269636500000000000000000000000000005f82015250565b5f6139a160128361395d565b91506139ac8261396d565b602082019050919050565b5f6020820190508181035f8301526139ce81613995565b9050919050565b7f48504c4720436f696e2070616972206e6f7420657869737400000000000000005f82015250565b5f613a0960188361395d565b9150613a14826139d5565b602082019050919050565b5f6020820190508181035f830152613a36816139fd565b9050919050565b7f48504c4720436f696e207061697220616c7265616479206163746976650000005f82015250565b5f613a71601d8361395d565b9150613a7c82613a3d565b602082019050919050565b5f6020820190508181035f830152613a9e81613a65565b9050919050565b7f48504c472050726573616c6520686173206e6f7420656e6465640000000000005f82015250565b5f613ad9601a8361395d565b9150613ae482613aa5565b602082019050919050565b5f6020820190508181035f830152613b0681613acd565b9050919050565b7f48504c4720696e76616c696420726566657272657200000000000000000000005f82015250565b5f613b4160158361395d565b9150613b4c82613b0d565b602082019050919050565b5f6020820190508181035f830152613b6e81613b35565b9050919050565b5f81905092915050565b50565b5f613b8d5f83613b75565b9150613b9882613b7f565b5f82019050919050565b5f613bac82613b82565b9150819050919050565b7f48504c47205472616e73616374696f6e206661696c65640000000000000000005f82015250565b5f613bea60178361395d565b9150613bf582613bb6565b602082019050919050565b5f6020820190508181035f830152613c1781613bde565b9050919050565b7f48504c47204e6f20746f6b656e20617661696c61626c650000000000000000005f82015250565b5f613c5260178361395d565b9150613c5d82613c1e565b602082019050919050565b5f6020820190508181035f830152613c7f81613c46565b9050919050565b7f48504c4720436f696e207061697220616c72656164792064697361626c6564005f82015250565b5f613cba601f8361395d565b9150613cc582613c86565b602082019050919050565b5f6020820190508181035f830152613ce781613cae565b9050919050565b7f48504c47204e6f206461746120617661696c61626c65000000000000000000005f82015250565b5f613d2260168361395d565b9150613d2d82613cee565b602082019050919050565b5f6020820190508181035f830152613d4f81613d16565b9050919050565b7f48504c4720436c61696d696e67206e6f7420617661696c61626c6500000000005f82015250565b5f613d8a601b8361395d565b9150613d9582613d56565b602082019050919050565b5f6020820190508181035f830152613db781613d7e565b9050919050565b7f48504c472056657374696e67206461746120736574206572726f7200000000005f82015250565b5f613df2601b8361395d565b9150613dfd82613dbe565b602082019050919050565b5f6020820190508181035f830152613e1f81613de6565b9050919050565b5f606082019050613e395f8301866130dc565b613e4660208301856130f4565b613e5360408301846130f4565b949350505050565b5f81519050613e69816133db565b92915050565b5f60208284031215613e8457613e83613133565b5b5f613e9184828501613e5b565b91505092915050565b7f48504c472056657374696e6720636f756c64206e6f74206265207365740000005f82015250565b5f613ece601d8361395d565b9150613ed982613e9a565b602082019050919050565b5f6020820190508181035f830152613efb81613ec2565b9050919050565b7f48504c4720416c6c20546f6b656e7320536f6c646564204f75740000000000005f82015250565b5f613f36601a8361395d565b9150613f4182613f02565b602082019050919050565b5f6020820190508181035f830152613f6381613f2a565b9050919050565b7f48504c472043616e2774207573652041646472657373203000000000000000005f82015250565b5f613f9e60188361395d565b9150613fa982613f6a565b602082019050919050565b5f6020820190508181035f830152613fcb81613f92565b9050919050565b7f48504c4720546f6b656e207175616e74697479206d75737420626520677265615f8201527f746572207468616e203000000000000000000000000000000000000000000000602082015250565b5f61402c602a8361395d565b915061403782613fd2565b604082019050919050565b5f6020820190508181035f83015261405981614020565b9050919050565b7f48504c47204e6f7420656e6f75676820746f6b656e204c65667420696e2074685f8201527f6973207374616765000000000000000000000000000000000000000000000000602082015250565b5f6140ba60288361395d565b91506140c582614060565b604082019050919050565b5f6020820190508181035f8301526140e7816140ae565b9050919050565b7f48504c472050726573616c652068617320656e646564000000000000000000005f82015250565b5f61412260168361395d565b915061412d826140ee565b602082019050919050565b5f6020820190508181035f83015261414f81614116565b9050919050565b5f6020820190506141695f8301846130dc565b92915050565b5f6020828403121561418457614183613133565b5b5f614191848285016138d2565b91505092915050565b7f48504c47204f776e65722063616e6e6f7420636c61696d206e617469766520745f8201527f6f6b656e73000000000000000000000000000000000000000000000000000000602082015250565b5f6141f460258361395d565b91506141ff8261419a565b604082019050919050565b5f6020820190508181035f830152614221816141e8565b9050919050565b7f48504c4720696e76616c6964206e6577206275796572000000000000000000005f82015250565b5f61425c60168361395d565b915061426782614228565b602082019050919050565b5f6020820190508181035f83015261428981614250565b9050919050565b5f61429a826130eb565b91506142a5836130eb565b92508282019050808211156142bd576142bc613800565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6142fa826130eb565b9150614305836130eb565b925082614315576143146142c3565b5b828204905092915050565b5f61432a826130eb565b9150614335836130eb565b9250828202614343816130eb565b9150828204841483151761435a57614359613800565b5b5092915050565b5f6060820190506143745f8301866130dc565b61438160208301856130dc565b61438e60408301846130f4565b949350505050565b5f6040820190506143a95f8301856130dc565b6143b660208301846133b3565b9392505050565b5f81519050919050565b8281835e5f83830152505050565b5f6143df826143bd565b6143e98185613b75565b93506143f98185602086016143c7565b80840191505092915050565b5f61441082846143d5565b91508190509291505056fea2646970667358221220dd03571073c7912efda0334b7ea483f0ecb973250b138fe5c5428de2d2570fdc64736f6c634300081a0033000000000000000000000000ea881453b33567bb8d3de381d9e6acda8acf656800000000000000000000000048b97325e6559ffef92966bdd7840bb04c3e87cf000000000000000000000000dd058d128fcf64685c4495224214ab79c19c57a8000000000000000000000000bd9d6f5611b5dcb5b7ed1ec23e5505eecbf070c5
608060405260043610610233575f3560e01c80635c975abb1161012d578063b5f7f636116100aa578063de1ea8661161006e578063de1ea866146108b5578063ecb499e0146108df578063f283439214610909578063f9d0831a14610939578063fa8bf0751461096157610273565b8063b5f7f636146107d5578063b8bb1c57146107ff578063ba0317d114610829578063d11e662d14610865578063d547741f1461088d57610273565b806391d14854116100f157806391d14854146106f15780639326197a1461072d578063a1c1418c14610757578063a217fddf14610781578063a646b909146107ab57610273565b80635c975abb146105fd5780635db7060f146106275780636fac731a146106635780638456cb591461069f5780638e17c017146106b557610273565b8063248a9ca3116101bb57806336568abe1161017f57806336568abe1461052f5780633f4ba83a1461055757806355440fc11461056d57806359995cdb146105975780635bf5d54c146105d357610273565b8063248a9ca31461045d57806328814c301461049957806328dae6e3146104c15780632b836261146104d75780632f2ff15d1461050757610273565b80630ffbdcaa116102025780630ffbdcaa1461034357806313e9924c1461037f57806316345f18146103a957806317274bdc146103e557806318f52ff21461042157610273565b806301ffc9a71461027757806307a3a067146102b357806307c52d83146102ef5780630e5f27741461031957610273565b36610273577f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258743334604051610269929190613103565b60405180910390a1005b5f80fd5b348015610282575f80fd5b5061029d60048036038101906102989190613190565b61099d565b6040516102aa91906131d5565b60405180910390f35b3480156102be575f80fd5b506102d960048036038101906102d49190613218565b610a16565b6040516102e691906131d5565b60405180910390f35b3480156102fa575f80fd5b50610303610a6d565b6040516103109190613243565b60405180910390f35b348015610324575f80fd5b5061032d610a92565b60405161033a91906131d5565b60405180910390f35b34801561034e575f80fd5b5061036960048036038101906103649190613286565b610ac3565b60405161037691906131d5565b60405180910390f35b34801561038a575f80fd5b50610393610ae1565b6040516103a09190613243565b60405180910390f35b3480156103b4575f80fd5b506103cf60048036038101906103ca91906132ec565b610b16565b6040516103dc9190613243565b60405180910390f35b3480156103f0575f80fd5b5061040b60048036038101906104069190613218565b610bd6565b60405161041891906131d5565b60405180910390f35b34801561042c575f80fd5b5061044760048036038101906104429190613317565b610d9a565b6040516104549190613243565b60405180910390f35b348015610468575f80fd5b50610483600480360381019061047e9190613388565b610e2e565b60405161049091906133c2565b60405180910390f35b3480156104a4575f80fd5b506104bf60048036038101906104ba9190613405565b610e4a565b005b3480156104cc575f80fd5b506104d5610e4f565b005b6104f160048036038101906104ec9190613455565b610ebe565b6040516104fe91906131d5565b60405180910390f35b348015610512575f80fd5b5061052d600480360381019061052891906134a5565b61103b565b005b34801561053a575f80fd5b50610555600480360381019061055091906134a5565b61105d565b005b348015610562575f80fd5b5061056b6110d8565b005b348015610578575f80fd5b506105816110f7565b60405161058e919061351f565b60405180910390f35b3480156105a2575f80fd5b506105bd60048036038101906105b89190613218565b6111ff565b6040516105ca9190613596565b60405180910390f35b3480156105de575f80fd5b506105e761137d565b6040516105f49190613243565b60405180910390f35b348015610608575f80fd5b50610611611383565b60405161061e91906131d5565b60405180910390f35b348015610632575f80fd5b5061064d600480360381019061064891906135af565b611398565b60405161065a91906131d5565b60405180910390f35b34801561066e575f80fd5b5061068960048036038101906106849190613218565b611608565b60405161069691906131d5565b60405180910390f35b3480156106aa575f80fd5b506106b36117cc565b005b3480156106c0575f80fd5b506106db60048036038101906106d69190613218565b6117eb565b6040516106e891906131d5565b60405180910390f35b3480156106fc575f80fd5b50610717600480360381019061071291906134a5565b611842565b60405161072491906131d5565b60405180910390f35b348015610738575f80fd5b506107416118a5565b60405161074e91906133c2565b60405180910390f35b348015610762575f80fd5b5061076b6118c9565b60405161077891906133c2565b60405180910390f35b34801561078c575f80fd5b506107956118ed565b6040516107a291906133c2565b60405180910390f35b3480156107b6575f80fd5b506107bf6118f3565b6040516107cc9190613243565b60405180910390f35b3480156107e0575f80fd5b506107e9611916565b6040516107f69190613243565b60405180910390f35b34801561080a575f80fd5b50610813611939565b60405161082091906131d5565b60405180910390f35b348015610834575f80fd5b5061084f600480360381019061084a91906135ff565b611ce5565b60405161085c91906131d5565b60405180910390f35b348015610870575f80fd5b5061088b60048036038101906108869190613779565b611f98565b005b348015610898575f80fd5b506108b360048036038101906108ae91906134a5565b611f9c565b005b3480156108c0575f80fd5b506108c9611fbe565b6040516108d69190613243565b60405180910390f35b3480156108ea575f80fd5b506108f3611fe1565b6040516109009190613243565b60405180910390f35b610923600480360381019061091e9190613455565b61209a565b60405161093091906131d5565b60405180910390f35b348015610944575f80fd5b5061095f600480360381019061095a9190613218565b61221c565b005b34801561096c575f80fd5b50610987600480360381019061098291906135af565b6123d3565b60405161099491906131d5565b60405180910390f35b5f7f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610a0f5750610a0e82612746565b5b9050919050565b5f805f1b610a23816127af565b82600a5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001915050919050565b5f600c60075481548110610a8457610a836137d3565b5b905f5260205f200154905090565b5f805f1b610a9f816127af565b610ab560016007546127c390919063ffffffff16565b600781905550600191505090565b5f805f1b610ad0816127af565b826008819055506001915050919050565b5f80600654600d54610af3919061382d565b9050610b10670de0b6b3a7640000826127e990919063ffffffff16565b91505090565b5f808273ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610b61573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b8591906138e6565b5050509150505f8113610bcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc4906139b7565b60405180910390fd5b80915050919050565b5f805f1b610be3816127af565b6001600e5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490501015610c67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5e90613a1f565b60405180910390fd5b5f600e5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f81548110610cb757610cb66137d3565b5b905f5260205f2090600302016002015f6101000a81548160ff0219169083151502179055610d1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1190613a87565b60405180910390fd5b6001600e5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f81548110610d6b57610d6a6137d3565b5b905f5260205f2090600302016002015f6101000a81548160ff0219169083151502179055506001915050919050565b5f80610da4610a6d565b90505f610db085610b16565b90505f610e20610dce6402540be4008461280e90919063ffffffff16565b610e12610dec670de0b6b3a76400008961280e90919063ffffffff16565b610e046402540be4008861280e90919063ffffffff16565b61280e90919063ffffffff16565b6127e990919063ffffffff16565b905080935050505092915050565b5f805f8381526020019081526020015f20600101549050919050565b505050565b5f801b610e5b816127af565b600780541015610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790613aef565b60405180910390fd5b6001600460146101000a81548160ff02191690831515021790555050565b5f610ec761284e565b610ecf61288f565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610f4b57610f0b836128d3565b610f4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4190613b57565b60405180910390fd5b5b5f8290505f610f5a8287610d9a565b90505f60095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682604051610fa290613ba2565b5f6040518083038185875af1925050503d805f8114610fdc576040519150601f19603f3d011682016040523d82523d5f602084013e610fe1565b606091505b5050905080611025576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101c90613c00565b60405180910390fd5b60019350505050611034612940565b9392505050565b61104482610e2e565b61104d816127af565b611057838361294a565b50505050565b611065612a33565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146110c9576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110d38282612a3a565b505050565b6110e0612b23565b5f801b6110ec816127af565b6110f4612b63565b50565b6110ff61305e565b5f600f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208054905011611181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117890613c68565b60405180910390fd5b600f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815481106111d0576111cf6137d3565b5b905f5260205f2090600202016040518060400160405290815f8201548152602001600182015481525050905090565b611207613076565b5f801b611213816127af565b6001600e5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490501015611297576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128e90613a1f565b60405180910390fd5b600e5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815481106112e6576112e56137d3565b5b905f5260205f2090600302016040518060600160405290815f82015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015f9054906101000a900460ff161515151581525050915050919050565b60075481565b5f60015f9054906101000a900460ff16905090565b5f805f1b6113a5816127af565b5f600e5f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208054905011156114f05783600e5f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8154811061143d5761143c6137d3565b5b905f5260205f2090600302015f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600e5f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815481106114d8576114d76137d3565b5b905f5260205f209060030201600101819055506115fc565b5f60405180606001604052808673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001600115158152509050600e5f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002015f6101000a81548160ff0219169083151502179055505050505b60019150509392505050565b5f805f1b611615816127af565b6001600e5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490501015611699576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169090613a1f565b60405180910390fd5b6001600e5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815481106116ea576116e96137d3565b5b905f5260205f2090600302016002015f6101000a81548160ff021916908315150217905561174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174490613cd0565b60405180910390fd5b5f600e5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8154811061179d5761179c6137d3565b5b905f5260205f2090600302016002015f6101000a81548160ff0219169083151502179055506001915050919050565b6117d461284e565b5f801b6117e0816127af565b6117e8612bc4565b50565b5f805f1b6117f8816127af565b8260095f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001915050919050565b5f805f8481526020019081526020015f205f015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16905092915050565b7f6a4b509b5f306a69ec99e97ff6b166daad9c0a3dfce739a6d67ad1c57143a6b281565b7f6343452265350cc926492d9bfc7710ca06328d7c328cdb091fde925c1441e7a881565b5f801b81565b5f611911670de0b6b3a7640000600d546127e990919063ffffffff16565b905090565b5f611934670de0b6b3a76400006005546127e990919063ffffffff16565b905090565b5f61194261288f565b5f600f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2080549050116119c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119bb90613d38565b60405180910390fd5b600460149054906101000a900460ff16611a13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0a90613da0565b60405180910390fd5b5f60085411611a57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4e90613e08565b60405180910390fd5b5f611b26600f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f81548110611aaa57611aa96137d3565b5b905f5260205f20906002020160010154600f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f81548110611b0957611b086137d3565b5b905f5260205f2090600202015f01546127c390919063ffffffff16565b9050600a5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660045f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166399c6d2de33836008546040518463ffffffff1660e01b8152600401611be993929190613e26565b6020604051808303815f875af1158015611c05573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c299190613e6f565b611c68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5f90613ee4565b60405180910390fd5b611cd5600a5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c259092919063ffffffff16565b6001915050611ce2612940565b90565b5f611cee61288f565b7f6a4b509b5f306a69ec99e97ff6b166daad9c0a3dfce739a6d67ad1c57143a6b2611d18816127af565b611d20611916565b611d28611fe1565b11611d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5f90613f4c565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603611dd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcd90613fb4565b60405180910390fd5b5f8311611e18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e0f90614042565b60405180910390fd5b600d54611e4a611e39670de0b6b3a76400008661280e90919063ffffffff16565b6006546127c390919063ffffffff16565b1115611e8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e82906140d0565b60405180910390fd5b600860075410611ed0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec790614138565b60405180910390fd5b5f6040518060400160405280611ef7670de0b6b3a76400008761280e90919063ffffffff16565b81526020015f8152509050600f5f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081908060018154018082558091505060019003905f5260205f2090600202015f909190919091505f820151815f0155602082015181600101555050611f8384612ca4565b50600192505050611f92612940565b92915050565b5050565b611fa582610e2e565b611fae816127af565b611fb88383612a3a565b50505050565b5f611fdc670de0b6b3a76400006006546127e990919063ffffffff16565b905090565b5f612095670de0b6b3a764000060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016120489190614156565b602060405180830381865afa158015612063573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612087919061416f565b6127e990919063ffffffff16565b905090565b5f6120a361284e565b6120ab61288f565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612127576120e7836128d3565b612126576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161211d90613b57565b60405180910390fd5b5b5f8290505f6121368287610d9a565b90505f600e5f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f81548110612188576121876137d3565b5b905f5260205f2090600302015f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506122063360095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16848473ffffffffffffffffffffffffffffffffffffffff16612d47909392919063ffffffff16565b60019350505050612215612940565b9392505050565b61222461288f565b5f801b612230816127af565b3073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361229e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122959061420a565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361231a573373ffffffffffffffffffffffffffffffffffffffff166108fc4790811502906040515f60405180830381858888f19350505050158015612314573d5f803e3d5ffd5b506123c7565b5f8290505f8173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016123589190614156565b602060405180830381865afa158015612373573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612397919061416f565b90506123c433828473ffffffffffffffffffffffffffffffffffffffff16612c259092919063ffffffff16565b50505b506123d0612940565b50565b5f7f6a4b509b5f306a69ec99e97ff6b166daad9c0a3dfce739a6d67ad1c57143a6b26123fe816127af565b612407856128d3565b612446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161243d90613b57565b60405180910390fd5b5f600f5f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f81548110612496576124956137d3565b5b905f5260205f2090600202015f0154116124e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124dc90614272565b60405180910390fd5b612570612503670de0b6b3a76400008561280e90919063ffffffff16565b600f5f8873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f81548110612552576125516137d3565b5b905f5260205f209060020201600101546127c390919063ffffffff16565b600f5f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815481106125bf576125be6137d3565b5b905f5260205f2090600202016001018190555061265d6125f0670de0b6b3a76400008561280e90919063ffffffff16565b600f5f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8154811061263f5761263e6137d3565b5b905f5260205f209060020201600101546127c390919063ffffffff16565b600f5f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815481106126ac576126ab6137d3565b5b905f5260205f209060020201600101819055508360105f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019150509392505050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6127c0816127bb612a33565b612dc9565b50565b5f8082846127d19190614290565b9050838110156127df575f80fd5b8091505092915050565b5f8082116127f5575f80fd5b5f828461280291906142f0565b90508091505092915050565b5f80830361281e575f9050612848565b5f828461282b9190614320565b905082848261283a91906142f0565b14612843575f80fd5b809150505b92915050565b612856611383565b1561288d576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b60028054036128ca576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028081905550565b5f805f600f5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f81548110612925576129246137d3565b5b905f5260205f2090600202015f015411905080915050919050565b6001600281905550565b5f6129558383611842565b612a295760015f808581526020019081526020015f205f015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055506129c6612a33565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a460019050612a2d565b5f90505b92915050565b5f33905090565b5f612a458383611842565b15612b19575f805f8581526020019081526020015f205f015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550612ab6612a33565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a460019050612b1d565b5f90505b92915050565b612b2b611383565b612b61576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b612b6b612b23565b5f60015f6101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612bad612a33565b604051612bba9190614156565b60405180910390a1565b612bcc61284e565b6001805f6101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612c0e612a33565b604051612c1b9190614156565b60405180910390a1565b612c9f838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401612c58929190613103565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e1a565b505050565b5f612cd4612cc3670de0b6b3a76400008461280e90919063ffffffff16565b6005546127c390919063ffffffff16565b600581905550612d09612cf8670de0b6b3a76400008461280e90919063ffffffff16565b6006546127c390919063ffffffff16565b600681905550600d5460065403612d3e57612d3060016007546127c390919063ffffffff16565b6007819055505f6006819055505b60019050919050565b612dc3848573ffffffffffffffffffffffffffffffffffffffff166323b872dd868686604051602401612d7c93929190614361565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e1a565b50505050565b612dd38282611842565b612e165780826040517fe2517d3f000000000000000000000000000000000000000000000000000000008152600401612e0d929190614396565b60405180910390fd5b5050565b5f612e44828473ffffffffffffffffffffffffffffffffffffffff16612eaf90919063ffffffff16565b90505f815114158015612e68575080806020019051810190612e669190613e6f565b155b15612eaa57826040517f5274afe7000000000000000000000000000000000000000000000000000000008152600401612ea19190614156565b60405180910390fd5b505050565b6060612ebc83835f612ec4565b905092915050565b606081471015612f0b57306040517fcd786059000000000000000000000000000000000000000000000000000000008152600401612f029190614156565b60405180910390fd5b5f808573ffffffffffffffffffffffffffffffffffffffff168486604051612f339190614405565b5f6040518083038185875af1925050503d805f8114612f6d576040519150601f19603f3d011682016040523d82523d5f602084013e612f72565b606091505b5091509150612f82868383612f8d565b925050509392505050565b606082612fa257612f9d8261301a565b613012565b5f8251148015612fc857505f8473ffffffffffffffffffffffffffffffffffffffff163b145b1561300a57836040517f9996b3150000000000000000000000000000000000000000000000000000000081526004016130019190614156565b60405180910390fd5b819050613013565b5b9392505050565b5f8151111561302c5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180604001604052805f81526020015f81525090565b60405180606001604052805f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f151581525090565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6130d5826130ac565b9050919050565b6130e5816130cb565b82525050565b5f819050919050565b6130fd816130eb565b82525050565b5f6040820190506131165f8301856130dc565b61312360208301846130f4565b9392505050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61316f8161313b565b8114613179575f80fd5b50565b5f8135905061318a81613166565b92915050565b5f602082840312156131a5576131a4613133565b5b5f6131b28482850161317c565b91505092915050565b5f8115159050919050565b6131cf816131bb565b82525050565b5f6020820190506131e85f8301846131c6565b92915050565b6131f7816130cb565b8114613201575f80fd5b50565b5f81359050613212816131ee565b92915050565b5f6020828403121561322d5761322c613133565b5b5f61323a84828501613204565b91505092915050565b5f6020820190506132565f8301846130f4565b92915050565b613265816130eb565b811461326f575f80fd5b50565b5f813590506132808161325c565b92915050565b5f6020828403121561329b5761329a613133565b5b5f6132a884828501613272565b91505092915050565b5f6132bb826130cb565b9050919050565b6132cb816132b1565b81146132d5575f80fd5b50565b5f813590506132e6816132c2565b92915050565b5f6020828403121561330157613300613133565b5b5f61330e848285016132d8565b91505092915050565b5f806040838503121561332d5761332c613133565b5b5f61333a858286016132d8565b925050602061334b85828601613272565b9150509250929050565b5f819050919050565b61336781613355565b8114613371575f80fd5b50565b5f813590506133828161335e565b92915050565b5f6020828403121561339d5761339c613133565b5b5f6133aa84828501613374565b91505092915050565b6133bc81613355565b82525050565b5f6020820190506133d55f8301846133b3565b92915050565b6133e4816131bb565b81146133ee575f80fd5b50565b5f813590506133ff816133db565b92915050565b5f805f6060848603121561341c5761341b613133565b5b5f61342986828701613204565b935050602061343a86828701613272565b925050604061344b868287016133f1565b9150509250925092565b5f805f6060848603121561346c5761346b613133565b5b5f61347986828701613272565b935050602061348a86828701613204565b925050604061349b86828701613204565b9150509250925092565b5f80604083850312156134bb576134ba613133565b5b5f6134c885828601613374565b92505060206134d985828601613204565b9150509250929050565b6134ec816130eb565b82525050565b604082015f8201516135065f8501826134e3565b50602082015161351960208501826134e3565b50505050565b5f6040820190506135325f8301846134f2565b92915050565b613541816130cb565b82525050565b613550816131bb565b82525050565b606082015f82015161356a5f850182613538565b50602082015161357d60208501826134e3565b5060408201516135906040850182613547565b50505050565b5f6060820190506135a95f830184613556565b92915050565b5f805f606084860312156135c6576135c5613133565b5b5f6135d386828701613204565b93505060206135e486828701613204565b92505060406135f586828701613272565b9150509250925092565b5f806040838503121561361557613614613133565b5b5f61362285828601613204565b925050602061363385828601613272565b9150509250929050565b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61368b82613645565b810181811067ffffffffffffffff821117156136aa576136a9613655565b5b80604052505050565b5f6136bc61312a565b90506136c88282613682565b919050565b5f67ffffffffffffffff8211156136e7576136e6613655565b5b6136f082613645565b9050602081019050919050565b828183375f83830152505050565b5f61371d613718846136cd565b6136b3565b90508281526020810184848401111561373957613738613641565b5b6137448482856136fd565b509392505050565b5f82601f8301126137605761375f61363d565b5b813561377084826020860161370b565b91505092915050565b5f806040838503121561378f5761378e613133565b5b5f61379c85828601613272565b925050602083013567ffffffffffffffff8111156137bd576137bc613137565b5b6137c98582860161374c565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f613837826130eb565b9150613842836130eb565b925082820390508181111561385a57613859613800565b5b92915050565b5f69ffffffffffffffffffff82169050919050565b61387e81613860565b8114613888575f80fd5b50565b5f8151905061389981613875565b92915050565b5f819050919050565b6138b18161389f565b81146138bb575f80fd5b50565b5f815190506138cc816138a8565b92915050565b5f815190506138e08161325c565b92915050565b5f805f805f60a086880312156138ff576138fe613133565b5b5f61390c8882890161388b565b955050602061391d888289016138be565b945050604061392e888289016138d2565b935050606061393f888289016138d2565b92505060806139508882890161388b565b9150509295509295909350565b5f82825260208201905092915050565b7f48504c4720496e76616c696420707269636500000000000000000000000000005f82015250565b5f6139a160128361395d565b91506139ac8261396d565b602082019050919050565b5f6020820190508181035f8301526139ce81613995565b9050919050565b7f48504c4720436f696e2070616972206e6f7420657869737400000000000000005f82015250565b5f613a0960188361395d565b9150613a14826139d5565b602082019050919050565b5f6020820190508181035f830152613a36816139fd565b9050919050565b7f48504c4720436f696e207061697220616c7265616479206163746976650000005f82015250565b5f613a71601d8361395d565b9150613a7c82613a3d565b602082019050919050565b5f6020820190508181035f830152613a9e81613a65565b9050919050565b7f48504c472050726573616c6520686173206e6f7420656e6465640000000000005f82015250565b5f613ad9601a8361395d565b9150613ae482613aa5565b602082019050919050565b5f6020820190508181035f830152613b0681613acd565b9050919050565b7f48504c4720696e76616c696420726566657272657200000000000000000000005f82015250565b5f613b4160158361395d565b9150613b4c82613b0d565b602082019050919050565b5f6020820190508181035f830152613b6e81613b35565b9050919050565b5f81905092915050565b50565b5f613b8d5f83613b75565b9150613b9882613b7f565b5f82019050919050565b5f613bac82613b82565b9150819050919050565b7f48504c47205472616e73616374696f6e206661696c65640000000000000000005f82015250565b5f613bea60178361395d565b9150613bf582613bb6565b602082019050919050565b5f6020820190508181035f830152613c1781613bde565b9050919050565b7f48504c47204e6f20746f6b656e20617661696c61626c650000000000000000005f82015250565b5f613c5260178361395d565b9150613c5d82613c1e565b602082019050919050565b5f6020820190508181035f830152613c7f81613c46565b9050919050565b7f48504c4720436f696e207061697220616c72656164792064697361626c6564005f82015250565b5f613cba601f8361395d565b9150613cc582613c86565b602082019050919050565b5f6020820190508181035f830152613ce781613cae565b9050919050565b7f48504c47204e6f206461746120617661696c61626c65000000000000000000005f82015250565b5f613d2260168361395d565b9150613d2d82613cee565b602082019050919050565b5f6020820190508181035f830152613d4f81613d16565b9050919050565b7f48504c4720436c61696d696e67206e6f7420617661696c61626c6500000000005f82015250565b5f613d8a601b8361395d565b9150613d9582613d56565b602082019050919050565b5f6020820190508181035f830152613db781613d7e565b9050919050565b7f48504c472056657374696e67206461746120736574206572726f7200000000005f82015250565b5f613df2601b8361395d565b9150613dfd82613dbe565b602082019050919050565b5f6020820190508181035f830152613e1f81613de6565b9050919050565b5f606082019050613e395f8301866130dc565b613e4660208301856130f4565b613e5360408301846130f4565b949350505050565b5f81519050613e69816133db565b92915050565b5f60208284031215613e8457613e83613133565b5b5f613e9184828501613e5b565b91505092915050565b7f48504c472056657374696e6720636f756c64206e6f74206265207365740000005f82015250565b5f613ece601d8361395d565b9150613ed982613e9a565b602082019050919050565b5f6020820190508181035f830152613efb81613ec2565b9050919050565b7f48504c4720416c6c20546f6b656e7320536f6c646564204f75740000000000005f82015250565b5f613f36601a8361395d565b9150613f4182613f02565b602082019050919050565b5f6020820190508181035f830152613f6381613f2a565b9050919050565b7f48504c472043616e2774207573652041646472657373203000000000000000005f82015250565b5f613f9e60188361395d565b9150613fa982613f6a565b602082019050919050565b5f6020820190508181035f830152613fcb81613f92565b9050919050565b7f48504c4720546f6b656e207175616e74697479206d75737420626520677265615f8201527f746572207468616e203000000000000000000000000000000000000000000000602082015250565b5f61402c602a8361395d565b915061403782613fd2565b604082019050919050565b5f6020820190508181035f83015261405981614020565b9050919050565b7f48504c47204e6f7420656e6f75676820746f6b656e204c65667420696e2074685f8201527f6973207374616765000000000000000000000000000000000000000000000000602082015250565b5f6140ba60288361395d565b91506140c582614060565b604082019050919050565b5f6020820190508181035f8301526140e7816140ae565b9050919050565b7f48504c472050726573616c652068617320656e646564000000000000000000005f82015250565b5f61412260168361395d565b915061412d826140ee565b602082019050919050565b5f6020820190508181035f83015261414f81614116565b9050919050565b5f6020820190506141695f8301846130dc565b92915050565b5f6020828403121561418457614183613133565b5b5f614191848285016138d2565b91505092915050565b7f48504c47204f776e65722063616e6e6f7420636c61696d206e617469766520745f8201527f6f6b656e73000000000000000000000000000000000000000000000000000000602082015250565b5f6141f460258361395d565b91506141ff8261419a565b604082019050919050565b5f6020820190508181035f830152614221816141e8565b9050919050565b7f48504c4720696e76616c6964206e6577206275796572000000000000000000005f82015250565b5f61425c60168361395d565b915061426782614228565b602082019050919050565b5f6020820190508181035f83015261428981614250565b9050919050565b5f61429a826130eb565b91506142a5836130eb565b92508282019050808211156142bd576142bc613800565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6142fa826130eb565b9150614305836130eb565b925082614315576143146142c3565b5b828204905092915050565b5f61432a826130eb565b9150614335836130eb565b9250828202614343816130eb565b9150828204841483151761435a57614359613800565b5b5092915050565b5f6060820190506143745f8301866130dc565b61438160208301856130dc565b61438e60408301846130f4565b949350505050565b5f6040820190506143a95f8301856130dc565b6143b660208301846133b3565b9392505050565b5f81519050919050565b8281835e5f83830152505050565b5f6143df826143bd565b6143e98185613b75565b93506143f98185602086016143c7565b80840191505092915050565b5f61441082846143d5565b91508190509291505056fea2646970667358221220dd03571073c7912efda0334b7ea483f0ecb973250b138fe5c5428de2d2570fdc64736f6c634300081a0033
1
20,291,017
874c3900e665658924da81b7c8705d71dc089ddbfb0e02d4ecb905cf49d8e674
55de22266ce8f57cd01cafb31f371aa1692b7b64f152a6ea1942467f3ce85561
000099b4a4d3ceb370d3a8a6235d24e07a8c0000
ee2a0343e825b2e5981851299787a679ce08216d
ebfa68bfc54c24752c0b835e599b016fc715721e
6080604052348015600f57600080fd5b50604051610211380380610211833981016040819052602c916059565b600080546001600160a01b039092166001600160a01b031992831617905560018054909116331790556087565b600060208284031215606a57600080fd5b81516001600160a01b0381168114608057600080fd5b9392505050565b61017b806100966000396000f3fe60806040526004361061002d5760003560e01c80638da5cb5b146100d9578063d4b839921461011557610034565b3661003457005b600154336001600160a01b03909116036100a257600080546040516001600160a01b03909116906100689083903690610135565b600060405180830381855af49150503d80600081146100a0576040519150601f19603f3d011682016040523d82523d6000602084013e005b005b60405134815233907f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258749060200160405180910390a2005b3480156100e557600080fd5b506001546100f9906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b34801561012157600080fd5b506000546100f9906001600160a01b031681565b818382376000910190815291905056fea264697066735822122072fb1ca36d430fdff59e91c1f28c88a6d1e6ee148f01591a2f4693fddcfb655264736f6c634300081900330000000000000000000000008906668094934bbfd0f787010fac65d8438019f5
60806040526004361061002d5760003560e01c80638da5cb5b146100d9578063d4b839921461011557610034565b3661003457005b600154336001600160a01b03909116036100a257600080546040516001600160a01b03909116906100689083903690610135565b600060405180830381855af49150503d80600081146100a0576040519150601f19603f3d011682016040523d82523d6000602084013e005b005b60405134815233907f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258749060200160405180910390a2005b3480156100e557600080fd5b506001546100f9906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b34801561012157600080fd5b506000546100f9906001600160a01b031681565b818382376000910190815291905056fea264697066735822122072fb1ca36d430fdff59e91c1f28c88a6d1e6ee148f01591a2f4693fddcfb655264736f6c63430008190033
1
20,291,017
874c3900e665658924da81b7c8705d71dc089ddbfb0e02d4ecb905cf49d8e674
62e38c33ef2038a5c17356651aec687269f8bdc30d6b343477aa3fa18d39db81
a7fb5ca286fc3fd67525629048a4de3ba24cba2e
c77ad0a71008d7094a62cfbd250a2eb2afdf2776
b72b91615d57f1f7702e501c4e4a16da6b15bb26
608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe
1
20,291,018
21135714ea26b0cc8cfac6de3a32ce7544d2ddd25a3bf26f10f853513cdaa087
e54c29b26e0e7f8ee03f488e867dd1d2c0082263284804cec951221ff64e84dc
c5533be6e51460c47e2e6ee214ca70d3678dd417
c5533be6e51460c47e2e6ee214ca70d3678dd417
359383fb2c1003e54e6a4049d16fbd4d1e9b01c7
608060405234801561001057600080fd5b506040516105f33803806105f383398101604081905261002f91610251565b81518151146100845760405162461bcd60e51b815260206004820152601c60248201527f6172726179206c656e6774682073686f756c6420626520657175616c00000000604482015260640160405180910390fd5b63a973ec9360e01b60009081526020527fd777efdeb12ce631e4e7bb4096e8e44d294f90a879efcd2b8ba060ee12cec7fc80546001600160a01b0319163317905560005b8151811015610125576101138382815181106100e6576100e6610323565b602002602001015183838151811061010057610100610323565b602002602001015161012d60201b60201c565b8061011d81610339565b9150506100c8565b505050610362565b6001600160e01b031991909116600090815260208190526040902080546001600160a01b0319166001600160a01b03909216919091179055565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156101a5576101a5610167565b604052919050565b60006001600160401b038211156101c6576101c6610167565b5060051b60200190565b600082601f8301126101e157600080fd5b815160206101f66101f1836101ad565b61017d565b82815260059290921b8401810191818101908684111561021557600080fd5b8286015b848110156102465780516001600160a01b03811681146102395760008081fd5b8352918301918301610219565b509695505050505050565b6000806040838503121561026457600080fd5b82516001600160401b038082111561027b57600080fd5b818501915085601f83011261028f57600080fd5b8151602061029f6101f1836101ad565b82815260059290921b840181019181810190898411156102be57600080fd5b948201945b838610156102f35785516001600160e01b0319811681146102e45760008081fd5b825294820194908201906102c3565b9188015191965090935050508082111561030c57600080fd5b50610319858286016101d0565b9150509250929050565b634e487b7160e01b600052603260045260246000fd5b600060001982141561035b57634e487b7160e01b600052601160045260246000fd5b5060010190565b610282806103716000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806371c9521c146100515780639bec8dd314610079578063a973ec93146100a0578063f2bff788146100b5575b600080fd5b61006461005f3660046101e7565b6100f6565b60405190151581526020015b60405180910390f35b61008763a973ec9360e01b81565b6040516001600160e01b03199091168152602001610070565b6100b36100ae3660046101e7565b610123565b005b6100de6100c336600461022a565b6000602081905290815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610070565b6001600160e01b0319919091166000908152602081905260409020546001600160a01b0391821691161490565b61013463a973ec9360e01b336100f6565b6101945760405162461bcd60e51b815260206004820152602760248201527f73656e64657220646f65736e27742068617665206772616e74206163636573736044820152662072696768747360c81b606482015260840160405180910390fd5b6001600160e01b03198216600090815260208190526040902080546001600160a01b0319166001600160a01b0383161790555050565b80356001600160e01b0319811681146101e257600080fd5b919050565b600080604083850312156101fa57600080fd5b610203836101ca565b915060208301356001600160a01b038116811461021f57600080fd5b809150509250929050565b60006020828403121561023c57600080fd5b610245826101ca565b939250505056fea26469706673582212206ab6b18c4172d4d566ddbc440de2f915b1f8489fdef188f1df9aa3e89a18a6ac64736f6c634300080b003300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000d9d33b6d4000000000000000000000000000000000000000000000000000000008b63aebf0000000000000000000000000000000000000000000000000000000080ae1c28000000000000000000000000000000000000000000000000000000008c0c263100000000000000000000000000000000000000000000000000000000edc20c3c00000000000000000000000000000000000000000000000000000000d15ef64e000000000000000000000000000000000000000000000000000000008a3234c700000000000000000000000000000000000000000000000000000000ffaac0eb00000000000000000000000000000000000000000000000000000000bd2a182000000000000000000000000000000000000000000000000000000000d2e5fae900000000000000000000000000000000000000000000000000000000d823674400000000000000000000000000000000000000000000000000000000366b4885000000000000000000000000000000000000000000000000000000006ba6db6b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417000000000000000000000000c5533be6e51460c47e2e6ee214ca70d3678dd417
608060405234801561001057600080fd5b506004361061004c5760003560e01c806371c9521c146100515780639bec8dd314610079578063a973ec93146100a0578063f2bff788146100b5575b600080fd5b61006461005f3660046101e7565b6100f6565b60405190151581526020015b60405180910390f35b61008763a973ec9360e01b81565b6040516001600160e01b03199091168152602001610070565b6100b36100ae3660046101e7565b610123565b005b6100de6100c336600461022a565b6000602081905290815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610070565b6001600160e01b0319919091166000908152602081905260409020546001600160a01b0391821691161490565b61013463a973ec9360e01b336100f6565b6101945760405162461bcd60e51b815260206004820152602760248201527f73656e64657220646f65736e27742068617665206772616e74206163636573736044820152662072696768747360c81b606482015260840160405180910390fd5b6001600160e01b03198216600090815260208190526040902080546001600160a01b0319166001600160a01b0383161790555050565b80356001600160e01b0319811681146101e257600080fd5b919050565b600080604083850312156101fa57600080fd5b610203836101ca565b915060208301356001600160a01b038116811461021f57600080fd5b809150509250929050565b60006020828403121561023c57600080fd5b610245826101ca565b939250505056fea26469706673582212206ab6b18c4172d4d566ddbc440de2f915b1f8489fdef188f1df9aa3e89a18a6ac64736f6c634300080b0033
1
20,291,019
5b81f281e412a9e6802f92654d739fac5129e463a1e59fe3691f85b930c6bfb7
dec8159318d4c04a226ab8d062b9efbe9e120b879f7b9b1b130ef841c4261c14
c5533be6e51460c47e2e6ee214ca70d3678dd417
c5533be6e51460c47e2e6ee214ca70d3678dd417
0f41ab8fa5898fee6eb14b042571e99a8460a24e
6080604052348015600f57600080fd5b506000805460ff19169055607d806100286000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80635c975abb14602d575b600080fd5b60005460ff16604051901515815260200160405180910390f3fea264697066735822122012046f7e0f6ca37a797c9368e71e8014efc31f8225e7951d9ba6cfb12352a4e364736f6c634300080b0033
6080604052348015600f57600080fd5b506004361060285760003560e01c80635c975abb14602d575b600080fd5b60005460ff16604051901515815260200160405180910390f3fea264697066735822122012046f7e0f6ca37a797c9368e71e8014efc31f8225e7951d9ba6cfb12352a4e364736f6c634300080b0033
1
20,291,020
f21a10103658fd9505782e9f8cf9f482424bb69f3c53b6a6aa03d2b112233666
4aae890757e7db4643f9bd1122bbc644529f3d4aa13454d70d019554149de5c1
c5533be6e51460c47e2e6ee214ca70d3678dd417
c5533be6e51460c47e2e6ee214ca70d3678dd417
cc75624b8ddfabccff6a6269f31409e4adf38bcb
6101606040523480156200001257600080fd5b5060405162002cde38038062002cde833981016040819052620000359162000279565b604080518082018252600681526542726964676560d01b6020808301918252835180850190945260058452640332e312e360dc1b908401526000805460ff191690558151902060e08190527f0e23d0b508e2034d01a5c31f12e9d9bbb31708c5518057dde31201ab93b17cef6101008190524660a0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6200011f8184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6080523060c052610120525050505060ff821661014052600380546001600160a01b0319166001600160a01b038316179055620001656200015f62000193565b620001d6565b5050600180546001600160a01b03191673b6c5b59374763ea232bc7cd7f25a650b063e3368179055620002c8565b60003360143610801590620001c057506001600160a01b03811660009081526006602052604090205460ff165b15620001d1575060131936013560601c5b919050565b620001e06200022c565b6000805460ff191660011790556040516001600160a01b03821681527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589060200160405180910390a150565b60005460ff1615620002775760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640160405180910390fd5b565b600080604083850312156200028d57600080fd5b825160ff811681146200029f57600080fd5b60208401519092506001600160a01b0381168114620002bd57600080fd5b809150509250929050565b60805160a05160c05160e0516101005161012051610140516129ad62000331600039600081816104a101528181610cd10152610db201526000611abe01526000611b0d01526000611ae801526000611a4101526000611a6b01526000611a9501526129ad6000f3fe6080604052600436106101cd5760003560e01c80638c0c2631116100f7578063d2e5fae911610095578063f5a88e5311610064578063f5a88e53146105b5578063f8c39e44146105d5578063fe4648f414610605578063ffaac0eb1461062557600080fd5b8063d2e5fae914610535578063d823674414610555578063edc20c3c14610575578063f0ead51e1461059557600080fd5b80639dd694f4116100d15780639dd694f41461048f578063a546e8a1146104d5578063bd2a1820146104f5578063d15ef64e1461051557600080fd5b80638c0c26311461042f5780639ae0bf451461044f5780639d33b6d41461046f57600080fd5b8063695a35bd1161016f57806380ae1c281161013e57806380ae1c28146103a457806384db809f146103b95780638a3234c7146103ef5780638b63aebf1461040f57600080fd5b8063695a35bd1461032e5780636ba6db6b1461034e57806370b0a8431461036357806373c45c981461038357600080fd5b8063366b4885116101ab578063366b48851461027c57806344e8e4301461029c5780634b0b919d146102bc5780635c975abb1461030a57600080fd5b8063059972d2146101d257806308a64104146102145780631f5c64c11461025a575b600080fd5b3480156101de57600080fd5b506000546101f79061010090046001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561022057600080fd5b5061024c61022f366004611f09565b600760209081526000928352604080842090915290825290205481565b60405190815260200161020b565b34801561026657600080fd5b5061027a6102753660046120ed565b61063a565b005b34801561028857600080fd5b5061027a6102973660046121d7565b610aed565b3480156102a857600080fd5b506003546101f7906001600160a01b031681565b3480156102c857600080fd5b506102f26102d7366004612227565b6004602052600090815260409020546001600160401b031681565b6040516001600160401b03909116815260200161020b565b34801561031657600080fd5b5060005460ff165b604051901515815260200161020b565b34801561033a57600080fd5b5061027a610349366004612259565b610b44565b34801561035a57600080fd5b5061027a610c51565b34801561036f57600080fd5b506001546101f7906001600160a01b031681565b6103966103913660046122d1565b610cc3565b60405161020b9291906123b2565b3480156103b057600080fd5b5061027a610f76565b3480156103c557600080fd5b506101f76103d43660046123d4565b6005602052600090815260409020546001600160a01b031681565b3480156103fb57600080fd5b5061027a61040a3660046123ed565b610fa0565b34801561041b57600080fd5b5061027a61042a36600461245b565b611047565b34801561043b57600080fd5b5061027a61044a366004612476565b6110ad565b34801561045b57600080fd5b5061031e61046a366004611f09565b611129565b34801561047b57600080fd5b5061027a61048a36600461245b565b611178565b34801561049b57600080fd5b506104c37f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff909116815260200161020b565b3480156104e157600080fd5b5061031e6104f03660046120ed565b6111de565b34801561050157600080fd5b5061027a6105103660046124a9565b611439565b34801561052157600080fd5b5061027a610530366004612504565b61147f565b34801561054157600080fd5b5061027a61055036600461245b565b6114c2565b34801561056157600080fd5b5061027a6105703660046121d7565b61158c565b34801561058157600080fd5b5061027a61059036600461253b565b6115d3565b3480156105a157600080fd5b5061027a6105b0366004612565565b61169c565b3480156105c157600080fd5b5061027a6105d036600461245b565b611712565b3480156105e157600080fd5b5061031e6105f036600461245b565b60066020526000908152604090205460ff1681565b34801561061157600080fd5b506002546101f7906001600160a01b031681565b34801561063157600080fd5b5061027a611791565b6106426117e2565b8251610661576040516363e60a4960e01b815260040160405180910390fd5b61066c8383836111de565b610689576040516337077ca360e01b815260040160405180910390fd5b60005b8351811015610ae7576106e28482815181106106aa576106aa6125b3565b6020026020010151600001518583815181106106c8576106c86125b3565b6020026020010151602001516001600160401b0316611129565b156106ec57610ad5565b600060056000868481518110610704576107046125b3565b602002602001015160400151815260200190815260200160002060009054906101000a90046001600160a01b03169050600081868481518110610749576107496125b3565b6020026020010151606001516040516020016107669291906125c9565b6040516020818303038152906040528051906020012090506000829050610100878581518110610798576107986125b3565b6020026020010151602001516107ae9190612617565b6001600160401b03166001901b600760008987815181106107d1576107d16125b3565b60200260200101516000015160ff1660ff16815260200190815260200160002060006101008a8881518110610808576108086125b3565b60200260200101516020015161081e9190612653565b6001600160401b0316815260200190815260200160002060008282541792505081905550806001600160a01b031663e248cff2888681518110610863576108636125b3565b602002602001015160400151898781518110610881576108816125b3565b6020026020010151606001516040518363ffffffff1660e01b81526004016108aa929190612679565b6000604051808303816000875af19250505080156108ea57506040513d6000823e601f3d908101601f191682016040526108e79190810190612692565b60015b610a59573d808015610918576040519150601f19603f3d011682016040523d82523d6000602084013e61091d565b606091505b507f19f774a63ee465292252a9981ae52051acc13da671c698ac4b5bf25b38c5b6fc81898781518110610952576109526125b3565b6020026020010151600001518a8881518110610970576109706125b3565b60200260200101516020015160405161098b93929190612708565b60405180910390a16101008886815181106109a8576109a86125b3565b6020026020010151602001516109be9190612617565b6001600160401b03166001901b19600760008a88815181106109e2576109e26125b3565b60200260200101516000015160ff1660ff16815260200190815260200160002060006101008b8981518110610a1957610a196125b3565b602002602001015160200151610a2f9190612653565b6001600160401b0316815260208101919091526040016000208054909116905550610ad592505050565b7fb83128682faafdf78efbb57c4c9acdc12ba648a50eca00b8b72818ea2d8e5cf9888681518110610a8c57610a8c6125b3565b602002602001015160000151898781518110610aaa57610aaa6125b3565b6020026020010151602001518584604051610ac8949392919061273d565b60405180910390a1505050505b80610adf81612778565b91505061068c565b50505050565b610b0a6000356001600160e01b031916610b05611828565b611869565b7f9069464c059b9a90135a3fdf2c47855263346b912894ad7562d989532c3fad4c81604051610b399190612793565b60405180910390a150565b6001546001600160a01b03163314610b915760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd08185b1b1bddd95960aa1b60448201526064015b60405180910390fd5b60405163025a3c9960e21b815282906001600160a01b03821690630968f26490610bbf908590600401612793565b600060405180830381600087803b158015610bd957600080fd5b505af1158015610bed573d6000803e3d6000fd5b50506040805180820182526002815261060f60f31b602082015290519092507fb83128682faafdf78efbb57c4c9acdc12ba648a50eca00b8b72818ea2d8e5cf99150610c4090899089908990869061273d565b60405180910390a150505050505050565b610c696000356001600160e01b031916610b05611828565b60005461010090046001600160a01b031615610c985760405163229924e160e01b815260040160405180910390fd5b6040517f24e723a5c27b62883404028b8dee9965934de6a46828cda2ff63bf9a5e65ce4390600090a1565b60006060610ccf6117e2565b7f000000000000000000000000000000000000000000000000000000000000000060ff168860ff161415610d1657604051630137058b60e61b815260040160405180910390fd5b6000610d20611828565b6002549091506001600160a01b0316610d86573415610d815760405162461bcd60e51b815260206004820152601d60248201527f6e6f2046656548616e646c65722c206d73672e76616c756520213d20300000006044820152606401610b88565b610e19565b600254604051632530706560e01b81526001600160a01b03909116906325307065903490610de69085907f0000000000000000000000000000000000000000000000000000000000000000908f908f908f908f908f908f906004016127cf565b6000604051808303818588803b158015610dff57600080fd5b505af1158015610e13573d6000803e3d6000fd5b50505050505b6000888152600560205260409020546001600160a01b031680610e4f576040516308c231dd60e31b815260040160405180910390fd5b60ff8a1660009081526004602052604081208054909190610e78906001600160401b031661282b565b91906101000a8154816001600160401b0302191690836001600160401b03160217905593506000819050806001600160a01b031663b07e54bb8b858c8c6040518563ffffffff1660e01b8152600401610ed49493929190612852565b6000604051808303816000875af1158015610ef3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f1b9190810190612692565b9350826001600160a01b03167f17bc3181e17a9620a479c24e6c606e474ba84fc036877b768926872e8cd0e11f8c8c888d8d8a604051610f609695949392919061287d565b60405180910390a2505050965096945050505050565b610f8e6000356001600160e01b031916610b05611828565b610f9e610f99611828565b611923565b565b610fb86000356001600160e01b031916610b05611828565b6000848152600560205260409081902080546001600160a01b0319166001600160a01b0388169081179091559051630fa8675b60e41b815286919063fa8675b09061100d908890889088908890600401612852565b600060405180830381600087803b15801561102757600080fd5b505af115801561103b573d6000803e3d6000fd5b50505050505050505050565b61105f6000356001600160e01b031916610b05611828565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f729170bd142e4965055b26a285faeedf03baf2b915bfc5a7c75d24b45815ff2c90602001610b39565b6110c56000356001600160e01b031916610b05611828565b6040516307b7ed9960e01b81526001600160a01b0382811660048301528391908216906307b7ed99906024015b600060405180830381600087803b15801561110c57600080fd5b505af1158015611120573d6000803e3d6000fd5b50505050505050565b6000611137610100836128ce565b60ff84166000908152600760205260408120600190921b919061115c610100866128e2565b8152602001908152602001600020541660001415905092915050565b6111906000356001600160e01b031916610b05611828565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527f497acaa34ac19c2a2a579ad43eca493b4fea820459e254e9383e7dda216b0f0490602001610b39565b60008084516001600160401b038111156111fa576111fa611f33565b604051908082528060200260200182016040528015611223578160200160208202803683370190505b50905060005b8551811015611355577fcc13634e956dd3d4ec8d808ee8bf294e1cd05a38f63fe7f234b079a0a4c36a70868281518110611265576112656125b3565b602002602001015160000151878381518110611283576112836125b3565b6020026020010151602001518884815181106112a1576112a16125b3565b6020026020010151604001518985815181106112bf576112bf6125b3565b6020026020010151606001518051906020012060405160200161131095949392919094855260ff9390931660208501526001600160401b039190911660408401526060830152608082015260a00190565b60405160208183030381529060405280519060200120828281518110611338576113386125b3565b60209081029190910101528061134d81612778565b915050611229565b50600061141985858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161141392507f989d14110ba109ccad392cc18511d1f6ae3a85165c5960e49d72c2c67682fde591506113c89087906020016128f6565b604051602081830303815290604052805190602001206040516020016113f8929190918252602082015260400190565b60405160208183030381529060405280519060200120611971565b906119c5565b60005461010090046001600160a01b039081169116149695505050505050565b6114516000356001600160e01b031916610b05611828565b60405163025a3c9960e21b815282906001600160a01b03821690630968f264906110f2908590600401612793565b6114976000356001600160e01b031916610b05611828565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6114da6000356001600160e01b031916610b05611828565b6001600160a01b03811661150157604051631449e68f60e01b815260040160405180910390fd5b60005461010090046001600160a01b03161561153057604051632748fb3360e21b815260040160405180910390fd5b60008054610100600160a81b0319166101006001600160a01b0384160217905561156061155b611828565b6119e9565b6040517f4187686ceef7b541a1f224d48d4cded8f2c535e0e58ac0f0514071b1de3dad5790600090a150565b6115a46000356001600160e01b031916610b05611828565b7fe78d813a9260522f81d6c761e311727b2e19008daadd2b9e174be86bc4f06a4b81604051610b399190612793565b6115eb6000356001600160e01b031916610b05611828565b60ff82166000908152600460205260409020546001600160401b03908116908216116116685760405162461bcd60e51b815260206004820152602660248201527f446f6573206e6f7420616c6c6f772064656372656d656e7473206f6620746865604482015265206e6f6e636560d01b6064820152608401610b88565b60ff919091166000908152600460205260409020805467ffffffffffffffff19166001600160401b03909216919091179055565b604080516001808252818301909252600091816020015b60408051608081018252600080825260208083018290529282015260608082015282526000199092019101816116b357905050905083816000815181106116fc576116fc6125b3565b6020026020010181905250610ae781848461063a565b61172a6000356001600160e01b031916610b05611828565b6001600160a01b03811661176f5760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b6044820152606401610b88565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6117a96000356001600160e01b031916610b05611828565b60005461010090046001600160a01b03166117d75760405163cca785b960e01b815260040160405180910390fd5b610f9e61155b611828565b60005460ff1615610f9e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b88565b6000336014361080159061185457506001600160a01b03811660009081526006602052604090205460ff165b15611864575060131936013560601c5b919050565b600354604051631c72548760e21b81526001600160e01b0319841660048201526001600160a01b038381166024830152909116906371c9521c90604401602060405180830381865afa1580156118c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e7919061292c565b61191f5760405163039d370b60e01b81526001600160a01b03821660048201526001600160e01b031983166024820152604401610b88565b5050565b61192b6117e2565b6000805460ff191660011790556040516001600160a01b03821681527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602001610b39565b60006119bf61197e611a34565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b92915050565b60008060006119d48585611b5b565b915091506119e181611bcb565b509392505050565b6119f1611d89565b6000805460ff191690556040516001600160a01b03821681527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602001610b39565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015611a8d57507f000000000000000000000000000000000000000000000000000000000000000046145b15611ab757507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b600080825160411415611b925760208301516040840151606085015160001a611b8687828585611dd2565b94509450505050611bc4565b825160401415611bbc5760208301516040840151611bb1868383611ebf565b935093505050611bc4565b506000905060025b9250929050565b6000816004811115611bdf57611bdf612949565b1415611be85750565b6001816004811115611bfc57611bfc612949565b1415611c4a5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b88565b6002816004811115611c5e57611c5e612949565b1415611cac5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b88565b6003816004811115611cc057611cc0612949565b1415611d195760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b88565b6004816004811115611d2d57611d2d612949565b1415611d865760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610b88565b50565b60005460ff16610f9e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b88565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611e095750600090506003611eb6565b8460ff16601b14158015611e2157508460ff16601c14155b15611e325750600090506004611eb6565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611e86573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611eaf57600060019250925050611eb6565b9150600090505b94509492505050565b6000806001600160ff1b03831681611edc60ff86901c601b61295f565b9050611eea87828885611dd2565b935093505050935093915050565b803560ff8116811461186457600080fd5b60008060408385031215611f1c57600080fd5b611f2583611ef8565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611f7157611f71611f33565b604052919050565b80356001600160401b038116811461186457600080fd5b60006001600160401b03821115611fa957611fa9611f33565b50601f01601f191660200190565b6000611fca611fc584611f90565b611f49565b9050828152838383011115611fde57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261200657600080fd5b61201583833560208501611fb7565b9392505050565b60006080828403121561202e57600080fd5b604051608081016001600160401b03828210818311171561205157612051611f33565b8160405282935061206185611ef8565b835261206f60208601611f79565b602084015260408501356040840152606085013591508082111561209257600080fd5b5061209f85828601611ff5565b6060830152505092915050565b60008083601f8401126120be57600080fd5b5081356001600160401b038111156120d557600080fd5b602083019150836020828501011115611bc457600080fd5b60008060006040848603121561210257600080fd5b83356001600160401b038082111561211957600080fd5b818601915086601f83011261212d57600080fd5b813560208282111561214157612141611f33565b8160051b612150828201611f49565b928352848101820192828101908b85111561216a57600080fd5b83870192505b848310156121a6578235868111156121885760008081fd5b6121968d86838b010161201c565b8352509183019190830190612170565b98505050870135925050808211156121bd57600080fd5b506121ca868287016120ac565b9497909650939450505050565b6000602082840312156121e957600080fd5b81356001600160401b038111156121ff57600080fd5b8201601f8101841361221057600080fd5b61221f84823560208401611fb7565b949350505050565b60006020828403121561223957600080fd5b61201582611ef8565b80356001600160a01b038116811461186457600080fd5b600080600080600060a0868803121561227157600080fd5b61227a86611ef8565b945061228860208701611f79565b93506040860135925061229d60608701612242565b915060808601356001600160401b038111156122b857600080fd5b6122c488828901611ff5565b9150509295509295909350565b600080600080600080608087890312156122ea57600080fd5b6122f387611ef8565b95506020870135945060408701356001600160401b038082111561231657600080fd5b6123228a838b016120ac565b9096509450606089013591508082111561233b57600080fd5b5061234889828a016120ac565b979a9699509497509295939492505050565b60005b8381101561237557818101518382015260200161235d565b83811115610ae75750506000910152565b6000815180845261239e81602086016020860161235a565b601f01601f19169290920160200192915050565b6001600160401b038316815260406020820152600061221f6040830184612386565b6000602082840312156123e657600080fd5b5035919050565b60008060008060006080868803121561240557600080fd5b61240e86612242565b94506020860135935061242360408701612242565b925060608601356001600160401b0381111561243e57600080fd5b61244a888289016120ac565b969995985093965092949392505050565b60006020828403121561246d57600080fd5b61201582612242565b6000806040838503121561248957600080fd5b61249283612242565b91506124a060208401612242565b90509250929050565b600080604083850312156124bc57600080fd5b6124c583612242565b915060208301356001600160401b038111156124e057600080fd5b6124ec85828601611ff5565b9150509250929050565b8015158114611d8657600080fd5b6000806040838503121561251757600080fd5b61252083612242565b91506020830135612530816124f6565b809150509250929050565b6000806040838503121561254e57600080fd5b61255783611ef8565b91506124a060208401611f79565b60008060006040848603121561257a57600080fd5b83356001600160401b038082111561259157600080fd5b61259d8783880161201c565b945060208601359150808211156121bd57600080fd5b634e487b7160e01b600052603260045260246000fd5b6bffffffffffffffffffffffff198360601b168152600082516125f381601485016020870161235a565b919091016014019392505050565b634e487b7160e01b600052601260045260246000fd5b60006001600160401b038084168061263157612631612601565b92169190910692915050565b634e487b7160e01b600052601160045260246000fd5b60006001600160401b038084168061266d5761266d612601565b92169190910492915050565b82815260406020820152600061221f6040830184612386565b6000602082840312156126a457600080fd5b81516001600160401b038111156126ba57600080fd5b8201601f810184136126cb57600080fd5b80516126d9611fc582611f90565b8181528560208385010111156126ee57600080fd5b6126ff82602083016020860161235a565b95945050505050565b60608152600061271b6060830186612386565b905060ff841660208301526001600160401b0383166040830152949350505050565b60ff851681526001600160401b038416602082015282604082015260806060820152600061276e6080830184612386565b9695505050505050565b600060001982141561278c5761278c61263d565b5060010190565b6020815260006120156020830184612386565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60018060a01b038916815260ff8816602082015260ff8716604082015285606082015260c06080820152600061280960c0830186886127a6565b82810360a084015261281c8185876127a6565b9b9a5050505050505050505050565b60006001600160401b03808316818114156128485761284861263d565b6001019392505050565b8481526001600160a01b038416602082015260606040820181905260009061276e90830184866127a6565b60ff871681528560208201526001600160401b038516604082015260a0606082015260006128af60a0830185876127a6565b82810360808401526128c18185612386565b9998505050505050505050565b6000826128dd576128dd612601565b500690565b6000826128f1576128f1612601565b500490565b815160009082906020808601845b8381101561292057815185529382019390820190600101612904565b50929695505050505050565b60006020828403121561293e57600080fd5b8151612015816124f6565b634e487b7160e01b600052602160045260246000fd5b600082198211156129725761297261263d565b50019056fea2646970667358221220e99dc6ec3ba19353825dc1886238c0c1022edc4ea0c5a5518b564a0e52cce17064736f6c634300080b00330000000000000000000000000000000000000000000000000000000000000004000000000000000000000000359383fb2c1003e54e6a4049d16fbd4d1e9b01c7
6080604052600436106101cd5760003560e01c80638c0c2631116100f7578063d2e5fae911610095578063f5a88e5311610064578063f5a88e53146105b5578063f8c39e44146105d5578063fe4648f414610605578063ffaac0eb1461062557600080fd5b8063d2e5fae914610535578063d823674414610555578063edc20c3c14610575578063f0ead51e1461059557600080fd5b80639dd694f4116100d15780639dd694f41461048f578063a546e8a1146104d5578063bd2a1820146104f5578063d15ef64e1461051557600080fd5b80638c0c26311461042f5780639ae0bf451461044f5780639d33b6d41461046f57600080fd5b8063695a35bd1161016f57806380ae1c281161013e57806380ae1c28146103a457806384db809f146103b95780638a3234c7146103ef5780638b63aebf1461040f57600080fd5b8063695a35bd1461032e5780636ba6db6b1461034e57806370b0a8431461036357806373c45c981461038357600080fd5b8063366b4885116101ab578063366b48851461027c57806344e8e4301461029c5780634b0b919d146102bc5780635c975abb1461030a57600080fd5b8063059972d2146101d257806308a64104146102145780631f5c64c11461025a575b600080fd5b3480156101de57600080fd5b506000546101f79061010090046001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561022057600080fd5b5061024c61022f366004611f09565b600760209081526000928352604080842090915290825290205481565b60405190815260200161020b565b34801561026657600080fd5b5061027a6102753660046120ed565b61063a565b005b34801561028857600080fd5b5061027a6102973660046121d7565b610aed565b3480156102a857600080fd5b506003546101f7906001600160a01b031681565b3480156102c857600080fd5b506102f26102d7366004612227565b6004602052600090815260409020546001600160401b031681565b6040516001600160401b03909116815260200161020b565b34801561031657600080fd5b5060005460ff165b604051901515815260200161020b565b34801561033a57600080fd5b5061027a610349366004612259565b610b44565b34801561035a57600080fd5b5061027a610c51565b34801561036f57600080fd5b506001546101f7906001600160a01b031681565b6103966103913660046122d1565b610cc3565b60405161020b9291906123b2565b3480156103b057600080fd5b5061027a610f76565b3480156103c557600080fd5b506101f76103d43660046123d4565b6005602052600090815260409020546001600160a01b031681565b3480156103fb57600080fd5b5061027a61040a3660046123ed565b610fa0565b34801561041b57600080fd5b5061027a61042a36600461245b565b611047565b34801561043b57600080fd5b5061027a61044a366004612476565b6110ad565b34801561045b57600080fd5b5061031e61046a366004611f09565b611129565b34801561047b57600080fd5b5061027a61048a36600461245b565b611178565b34801561049b57600080fd5b506104c37f000000000000000000000000000000000000000000000000000000000000000481565b60405160ff909116815260200161020b565b3480156104e157600080fd5b5061031e6104f03660046120ed565b6111de565b34801561050157600080fd5b5061027a6105103660046124a9565b611439565b34801561052157600080fd5b5061027a610530366004612504565b61147f565b34801561054157600080fd5b5061027a61055036600461245b565b6114c2565b34801561056157600080fd5b5061027a6105703660046121d7565b61158c565b34801561058157600080fd5b5061027a61059036600461253b565b6115d3565b3480156105a157600080fd5b5061027a6105b0366004612565565b61169c565b3480156105c157600080fd5b5061027a6105d036600461245b565b611712565b3480156105e157600080fd5b5061031e6105f036600461245b565b60066020526000908152604090205460ff1681565b34801561061157600080fd5b506002546101f7906001600160a01b031681565b34801561063157600080fd5b5061027a611791565b6106426117e2565b8251610661576040516363e60a4960e01b815260040160405180910390fd5b61066c8383836111de565b610689576040516337077ca360e01b815260040160405180910390fd5b60005b8351811015610ae7576106e28482815181106106aa576106aa6125b3565b6020026020010151600001518583815181106106c8576106c86125b3565b6020026020010151602001516001600160401b0316611129565b156106ec57610ad5565b600060056000868481518110610704576107046125b3565b602002602001015160400151815260200190815260200160002060009054906101000a90046001600160a01b03169050600081868481518110610749576107496125b3565b6020026020010151606001516040516020016107669291906125c9565b6040516020818303038152906040528051906020012090506000829050610100878581518110610798576107986125b3565b6020026020010151602001516107ae9190612617565b6001600160401b03166001901b600760008987815181106107d1576107d16125b3565b60200260200101516000015160ff1660ff16815260200190815260200160002060006101008a8881518110610808576108086125b3565b60200260200101516020015161081e9190612653565b6001600160401b0316815260200190815260200160002060008282541792505081905550806001600160a01b031663e248cff2888681518110610863576108636125b3565b602002602001015160400151898781518110610881576108816125b3565b6020026020010151606001516040518363ffffffff1660e01b81526004016108aa929190612679565b6000604051808303816000875af19250505080156108ea57506040513d6000823e601f3d908101601f191682016040526108e79190810190612692565b60015b610a59573d808015610918576040519150601f19603f3d011682016040523d82523d6000602084013e61091d565b606091505b507f19f774a63ee465292252a9981ae52051acc13da671c698ac4b5bf25b38c5b6fc81898781518110610952576109526125b3565b6020026020010151600001518a8881518110610970576109706125b3565b60200260200101516020015160405161098b93929190612708565b60405180910390a16101008886815181106109a8576109a86125b3565b6020026020010151602001516109be9190612617565b6001600160401b03166001901b19600760008a88815181106109e2576109e26125b3565b60200260200101516000015160ff1660ff16815260200190815260200160002060006101008b8981518110610a1957610a196125b3565b602002602001015160200151610a2f9190612653565b6001600160401b0316815260208101919091526040016000208054909116905550610ad592505050565b7fb83128682faafdf78efbb57c4c9acdc12ba648a50eca00b8b72818ea2d8e5cf9888681518110610a8c57610a8c6125b3565b602002602001015160000151898781518110610aaa57610aaa6125b3565b6020026020010151602001518584604051610ac8949392919061273d565b60405180910390a1505050505b80610adf81612778565b91505061068c565b50505050565b610b0a6000356001600160e01b031916610b05611828565b611869565b7f9069464c059b9a90135a3fdf2c47855263346b912894ad7562d989532c3fad4c81604051610b399190612793565b60405180910390a150565b6001546001600160a01b03163314610b915760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd08185b1b1bddd95960aa1b60448201526064015b60405180910390fd5b60405163025a3c9960e21b815282906001600160a01b03821690630968f26490610bbf908590600401612793565b600060405180830381600087803b158015610bd957600080fd5b505af1158015610bed573d6000803e3d6000fd5b50506040805180820182526002815261060f60f31b602082015290519092507fb83128682faafdf78efbb57c4c9acdc12ba648a50eca00b8b72818ea2d8e5cf99150610c4090899089908990869061273d565b60405180910390a150505050505050565b610c696000356001600160e01b031916610b05611828565b60005461010090046001600160a01b031615610c985760405163229924e160e01b815260040160405180910390fd5b6040517f24e723a5c27b62883404028b8dee9965934de6a46828cda2ff63bf9a5e65ce4390600090a1565b60006060610ccf6117e2565b7f000000000000000000000000000000000000000000000000000000000000000460ff168860ff161415610d1657604051630137058b60e61b815260040160405180910390fd5b6000610d20611828565b6002549091506001600160a01b0316610d86573415610d815760405162461bcd60e51b815260206004820152601d60248201527f6e6f2046656548616e646c65722c206d73672e76616c756520213d20300000006044820152606401610b88565b610e19565b600254604051632530706560e01b81526001600160a01b03909116906325307065903490610de69085907f0000000000000000000000000000000000000000000000000000000000000004908f908f908f908f908f908f906004016127cf565b6000604051808303818588803b158015610dff57600080fd5b505af1158015610e13573d6000803e3d6000fd5b50505050505b6000888152600560205260409020546001600160a01b031680610e4f576040516308c231dd60e31b815260040160405180910390fd5b60ff8a1660009081526004602052604081208054909190610e78906001600160401b031661282b565b91906101000a8154816001600160401b0302191690836001600160401b03160217905593506000819050806001600160a01b031663b07e54bb8b858c8c6040518563ffffffff1660e01b8152600401610ed49493929190612852565b6000604051808303816000875af1158015610ef3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f1b9190810190612692565b9350826001600160a01b03167f17bc3181e17a9620a479c24e6c606e474ba84fc036877b768926872e8cd0e11f8c8c888d8d8a604051610f609695949392919061287d565b60405180910390a2505050965096945050505050565b610f8e6000356001600160e01b031916610b05611828565b610f9e610f99611828565b611923565b565b610fb86000356001600160e01b031916610b05611828565b6000848152600560205260409081902080546001600160a01b0319166001600160a01b0388169081179091559051630fa8675b60e41b815286919063fa8675b09061100d908890889088908890600401612852565b600060405180830381600087803b15801561102757600080fd5b505af115801561103b573d6000803e3d6000fd5b50505050505050505050565b61105f6000356001600160e01b031916610b05611828565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f729170bd142e4965055b26a285faeedf03baf2b915bfc5a7c75d24b45815ff2c90602001610b39565b6110c56000356001600160e01b031916610b05611828565b6040516307b7ed9960e01b81526001600160a01b0382811660048301528391908216906307b7ed99906024015b600060405180830381600087803b15801561110c57600080fd5b505af1158015611120573d6000803e3d6000fd5b50505050505050565b6000611137610100836128ce565b60ff84166000908152600760205260408120600190921b919061115c610100866128e2565b8152602001908152602001600020541660001415905092915050565b6111906000356001600160e01b031916610b05611828565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527f497acaa34ac19c2a2a579ad43eca493b4fea820459e254e9383e7dda216b0f0490602001610b39565b60008084516001600160401b038111156111fa576111fa611f33565b604051908082528060200260200182016040528015611223578160200160208202803683370190505b50905060005b8551811015611355577fcc13634e956dd3d4ec8d808ee8bf294e1cd05a38f63fe7f234b079a0a4c36a70868281518110611265576112656125b3565b602002602001015160000151878381518110611283576112836125b3565b6020026020010151602001518884815181106112a1576112a16125b3565b6020026020010151604001518985815181106112bf576112bf6125b3565b6020026020010151606001518051906020012060405160200161131095949392919094855260ff9390931660208501526001600160401b039190911660408401526060830152608082015260a00190565b60405160208183030381529060405280519060200120828281518110611338576113386125b3565b60209081029190910101528061134d81612778565b915050611229565b50600061141985858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161141392507f989d14110ba109ccad392cc18511d1f6ae3a85165c5960e49d72c2c67682fde591506113c89087906020016128f6565b604051602081830303815290604052805190602001206040516020016113f8929190918252602082015260400190565b60405160208183030381529060405280519060200120611971565b906119c5565b60005461010090046001600160a01b039081169116149695505050505050565b6114516000356001600160e01b031916610b05611828565b60405163025a3c9960e21b815282906001600160a01b03821690630968f264906110f2908590600401612793565b6114976000356001600160e01b031916610b05611828565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6114da6000356001600160e01b031916610b05611828565b6001600160a01b03811661150157604051631449e68f60e01b815260040160405180910390fd5b60005461010090046001600160a01b03161561153057604051632748fb3360e21b815260040160405180910390fd5b60008054610100600160a81b0319166101006001600160a01b0384160217905561156061155b611828565b6119e9565b6040517f4187686ceef7b541a1f224d48d4cded8f2c535e0e58ac0f0514071b1de3dad5790600090a150565b6115a46000356001600160e01b031916610b05611828565b7fe78d813a9260522f81d6c761e311727b2e19008daadd2b9e174be86bc4f06a4b81604051610b399190612793565b6115eb6000356001600160e01b031916610b05611828565b60ff82166000908152600460205260409020546001600160401b03908116908216116116685760405162461bcd60e51b815260206004820152602660248201527f446f6573206e6f7420616c6c6f772064656372656d656e7473206f6620746865604482015265206e6f6e636560d01b6064820152608401610b88565b60ff919091166000908152600460205260409020805467ffffffffffffffff19166001600160401b03909216919091179055565b604080516001808252818301909252600091816020015b60408051608081018252600080825260208083018290529282015260608082015282526000199092019101816116b357905050905083816000815181106116fc576116fc6125b3565b6020026020010181905250610ae781848461063a565b61172a6000356001600160e01b031916610b05611828565b6001600160a01b03811661176f5760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b6044820152606401610b88565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6117a96000356001600160e01b031916610b05611828565b60005461010090046001600160a01b03166117d75760405163cca785b960e01b815260040160405180910390fd5b610f9e61155b611828565b60005460ff1615610f9e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b88565b6000336014361080159061185457506001600160a01b03811660009081526006602052604090205460ff165b15611864575060131936013560601c5b919050565b600354604051631c72548760e21b81526001600160e01b0319841660048201526001600160a01b038381166024830152909116906371c9521c90604401602060405180830381865afa1580156118c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e7919061292c565b61191f5760405163039d370b60e01b81526001600160a01b03821660048201526001600160e01b031983166024820152604401610b88565b5050565b61192b6117e2565b6000805460ff191660011790556040516001600160a01b03821681527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602001610b39565b60006119bf61197e611a34565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b92915050565b60008060006119d48585611b5b565b915091506119e181611bcb565b509392505050565b6119f1611d89565b6000805460ff191690556040516001600160a01b03821681527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602001610b39565b6000306001600160a01b037f000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb16148015611a8d57507f000000000000000000000000000000000000000000000000000000000000000146145b15611ab757507f95c5d910099e9e2c482053ac81d941537b75c387667ade3150fb5ef0b3661c2090565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f7aa5ae620294318af92bf4e2b2a729646c932a80312a5fa630da993a2ef5cc10828401527f0e23d0b508e2034d01a5c31f12e9d9bbb31708c5518057dde31201ab93b17cef60608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b600080825160411415611b925760208301516040840151606085015160001a611b8687828585611dd2565b94509450505050611bc4565b825160401415611bbc5760208301516040840151611bb1868383611ebf565b935093505050611bc4565b506000905060025b9250929050565b6000816004811115611bdf57611bdf612949565b1415611be85750565b6001816004811115611bfc57611bfc612949565b1415611c4a5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b88565b6002816004811115611c5e57611c5e612949565b1415611cac5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b88565b6003816004811115611cc057611cc0612949565b1415611d195760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b88565b6004816004811115611d2d57611d2d612949565b1415611d865760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610b88565b50565b60005460ff16610f9e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b88565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611e095750600090506003611eb6565b8460ff16601b14158015611e2157508460ff16601c14155b15611e325750600090506004611eb6565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611e86573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611eaf57600060019250925050611eb6565b9150600090505b94509492505050565b6000806001600160ff1b03831681611edc60ff86901c601b61295f565b9050611eea87828885611dd2565b935093505050935093915050565b803560ff8116811461186457600080fd5b60008060408385031215611f1c57600080fd5b611f2583611ef8565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611f7157611f71611f33565b604052919050565b80356001600160401b038116811461186457600080fd5b60006001600160401b03821115611fa957611fa9611f33565b50601f01601f191660200190565b6000611fca611fc584611f90565b611f49565b9050828152838383011115611fde57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261200657600080fd5b61201583833560208501611fb7565b9392505050565b60006080828403121561202e57600080fd5b604051608081016001600160401b03828210818311171561205157612051611f33565b8160405282935061206185611ef8565b835261206f60208601611f79565b602084015260408501356040840152606085013591508082111561209257600080fd5b5061209f85828601611ff5565b6060830152505092915050565b60008083601f8401126120be57600080fd5b5081356001600160401b038111156120d557600080fd5b602083019150836020828501011115611bc457600080fd5b60008060006040848603121561210257600080fd5b83356001600160401b038082111561211957600080fd5b818601915086601f83011261212d57600080fd5b813560208282111561214157612141611f33565b8160051b612150828201611f49565b928352848101820192828101908b85111561216a57600080fd5b83870192505b848310156121a6578235868111156121885760008081fd5b6121968d86838b010161201c565b8352509183019190830190612170565b98505050870135925050808211156121bd57600080fd5b506121ca868287016120ac565b9497909650939450505050565b6000602082840312156121e957600080fd5b81356001600160401b038111156121ff57600080fd5b8201601f8101841361221057600080fd5b61221f84823560208401611fb7565b949350505050565b60006020828403121561223957600080fd5b61201582611ef8565b80356001600160a01b038116811461186457600080fd5b600080600080600060a0868803121561227157600080fd5b61227a86611ef8565b945061228860208701611f79565b93506040860135925061229d60608701612242565b915060808601356001600160401b038111156122b857600080fd5b6122c488828901611ff5565b9150509295509295909350565b600080600080600080608087890312156122ea57600080fd5b6122f387611ef8565b95506020870135945060408701356001600160401b038082111561231657600080fd5b6123228a838b016120ac565b9096509450606089013591508082111561233b57600080fd5b5061234889828a016120ac565b979a9699509497509295939492505050565b60005b8381101561237557818101518382015260200161235d565b83811115610ae75750506000910152565b6000815180845261239e81602086016020860161235a565b601f01601f19169290920160200192915050565b6001600160401b038316815260406020820152600061221f6040830184612386565b6000602082840312156123e657600080fd5b5035919050565b60008060008060006080868803121561240557600080fd5b61240e86612242565b94506020860135935061242360408701612242565b925060608601356001600160401b0381111561243e57600080fd5b61244a888289016120ac565b969995985093965092949392505050565b60006020828403121561246d57600080fd5b61201582612242565b6000806040838503121561248957600080fd5b61249283612242565b91506124a060208401612242565b90509250929050565b600080604083850312156124bc57600080fd5b6124c583612242565b915060208301356001600160401b038111156124e057600080fd5b6124ec85828601611ff5565b9150509250929050565b8015158114611d8657600080fd5b6000806040838503121561251757600080fd5b61252083612242565b91506020830135612530816124f6565b809150509250929050565b6000806040838503121561254e57600080fd5b61255783611ef8565b91506124a060208401611f79565b60008060006040848603121561257a57600080fd5b83356001600160401b038082111561259157600080fd5b61259d8783880161201c565b945060208601359150808211156121bd57600080fd5b634e487b7160e01b600052603260045260246000fd5b6bffffffffffffffffffffffff198360601b168152600082516125f381601485016020870161235a565b919091016014019392505050565b634e487b7160e01b600052601260045260246000fd5b60006001600160401b038084168061263157612631612601565b92169190910692915050565b634e487b7160e01b600052601160045260246000fd5b60006001600160401b038084168061266d5761266d612601565b92169190910492915050565b82815260406020820152600061221f6040830184612386565b6000602082840312156126a457600080fd5b81516001600160401b038111156126ba57600080fd5b8201601f810184136126cb57600080fd5b80516126d9611fc582611f90565b8181528560208385010111156126ee57600080fd5b6126ff82602083016020860161235a565b95945050505050565b60608152600061271b6060830186612386565b905060ff841660208301526001600160401b0383166040830152949350505050565b60ff851681526001600160401b038416602082015282604082015260806060820152600061276e6080830184612386565b9695505050505050565b600060001982141561278c5761278c61263d565b5060010190565b6020815260006120156020830184612386565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60018060a01b038916815260ff8816602082015260ff8716604082015285606082015260c06080820152600061280960c0830186886127a6565b82810360a084015261281c8185876127a6565b9b9a5050505050505050505050565b60006001600160401b03808316818114156128485761284861263d565b6001019392505050565b8481526001600160a01b038416602082015260606040820181905260009061276e90830184866127a6565b60ff871681528560208201526001600160401b038516604082015260a0606082015260006128af60a0830185876127a6565b82810360808401526128c18185612386565b9998505050505050505050565b6000826128dd576128dd612601565b500690565b6000826128f1576128f1612601565b500490565b815160009082906020808601845b8381101561292057815185529382019390820190600101612904565b50929695505050505050565b60006020828403121561293e57600080fd5b8151612015816124f6565b634e487b7160e01b600052602160045260246000fd5b600082198211156129725761297261263d565b50019056fea2646970667358221220e99dc6ec3ba19353825dc1886238c0c1022edc4ea0c5a5518b564a0e52cce17064736f6c634300080b0033
1
20,291,020
f21a10103658fd9505782e9f8cf9f482424bb69f3c53b6a6aa03d2b112233666
827816b9fe5a05bec3c3d320a75b39a8515e97449674a4fa0e7b7089561d7684
f597d5777fbbb2371595006cca85d132701536f3
42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794
fba377967fad4e7c5763c99325adf3a3c777a60c
3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
1
20,291,020
f21a10103658fd9505782e9f8cf9f482424bb69f3c53b6a6aa03d2b112233666
827816b9fe5a05bec3c3d320a75b39a8515e97449674a4fa0e7b7089561d7684
f597d5777fbbb2371595006cca85d132701536f3
42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794
7cff90e15973f24d828f0e53cdfaafc79905169a
3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
1
20,291,020
f21a10103658fd9505782e9f8cf9f482424bb69f3c53b6a6aa03d2b112233666
827816b9fe5a05bec3c3d320a75b39a8515e97449674a4fa0e7b7089561d7684
f597d5777fbbb2371595006cca85d132701536f3
42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794
8b2a668078b1730c1fa7b35b72fc9a5b3284230d
3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
1
20,291,020
f21a10103658fd9505782e9f8cf9f482424bb69f3c53b6a6aa03d2b112233666
827816b9fe5a05bec3c3d320a75b39a8515e97449674a4fa0e7b7089561d7684
f597d5777fbbb2371595006cca85d132701536f3
42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794
5e68c8092151c4edf1b15910c0eb807476c2a4d4
3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
1
20,291,020
f21a10103658fd9505782e9f8cf9f482424bb69f3c53b6a6aa03d2b112233666
827816b9fe5a05bec3c3d320a75b39a8515e97449674a4fa0e7b7089561d7684
f597d5777fbbb2371595006cca85d132701536f3
42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794
b7fc94fde93fdc78b6fe68344cd8860ed33c211d
3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
1
20,291,020
f21a10103658fd9505782e9f8cf9f482424bb69f3c53b6a6aa03d2b112233666
827816b9fe5a05bec3c3d320a75b39a8515e97449674a4fa0e7b7089561d7684
f597d5777fbbb2371595006cca85d132701536f3
42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794
b0f5edb49d6382b7fef9dcc0e936d4e7c5d2dccf
3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
1
20,291,020
f21a10103658fd9505782e9f8cf9f482424bb69f3c53b6a6aa03d2b112233666
827816b9fe5a05bec3c3d320a75b39a8515e97449674a4fa0e7b7089561d7684
f597d5777fbbb2371595006cca85d132701536f3
42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794
1937d75f87fb75c4f6907f2a2be3cf05050369bb
3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
1
20,291,020
f21a10103658fd9505782e9f8cf9f482424bb69f3c53b6a6aa03d2b112233666
827816b9fe5a05bec3c3d320a75b39a8515e97449674a4fa0e7b7089561d7684
f597d5777fbbb2371595006cca85d132701536f3
42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794
c550ab09b43ebc7daa86e77763f932328e20c54d
3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
1
20,291,020
f21a10103658fd9505782e9f8cf9f482424bb69f3c53b6a6aa03d2b112233666
827816b9fe5a05bec3c3d320a75b39a8515e97449674a4fa0e7b7089561d7684
f597d5777fbbb2371595006cca85d132701536f3
42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794
8d2516723549697ad491da59e44be97ae756bc67
3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
1
20,291,020
f21a10103658fd9505782e9f8cf9f482424bb69f3c53b6a6aa03d2b112233666
827816b9fe5a05bec3c3d320a75b39a8515e97449674a4fa0e7b7089561d7684
f597d5777fbbb2371595006cca85d132701536f3
42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794
c12178465c00be28fa972252752294637bb50a77
3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
1
20,291,020
f21a10103658fd9505782e9f8cf9f482424bb69f3c53b6a6aa03d2b112233666
827816b9fe5a05bec3c3d320a75b39a8515e97449674a4fa0e7b7089561d7684
f597d5777fbbb2371595006cca85d132701536f3
42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794
bbd580166f2d8974422051cf049f2c212b90184e
3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
1
20,291,020
f21a10103658fd9505782e9f8cf9f482424bb69f3c53b6a6aa03d2b112233666
827816b9fe5a05bec3c3d320a75b39a8515e97449674a4fa0e7b7089561d7684
f597d5777fbbb2371595006cca85d132701536f3
42bca2a5593c3b6dc2ebaf62db7e7f6e1d273794
8718faadce763466925357f91cba69d29315f68a
3d602d80600a3d3981f3363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7342bca2a5593c3b6dc2ebaf62db7e7f6e1d2737945af43d82803e903d91602b57fd5bf3
1
20,291,021
1e22ea40d33974a6ef546fdc502c58987089821c6ddaf72893c42f92792f0464
9c9500abb1b292359377edf23b1105628fde6e3e488019d0f17eb9614dc686a2
4fd1719fc6a104c1884125e754b04e3540136425
ffa397285ce46fb78c588a9e993286aac68c37cd
bd33f282a47bb29ac4e2eb1616a000417d4ab69b
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,291,021
1e22ea40d33974a6ef546fdc502c58987089821c6ddaf72893c42f92792f0464
3cd6363ae8a1eeb08b4a0511185b8a6788cd3444b61b9aeb1ed64492f77ea2f8
c5533be6e51460c47e2e6ee214ca70d3678dd417
c5533be6e51460c47e2e6ee214ca70d3678dd417
663217f1a0851b3502f6a57c467b0929de39ac6b
60a060405234801561001057600080fd5b506040516110d83803806110d883398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161104661009260003960008181610125015261054b01526110466000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063318c136e11610066578063318c136e14610120578063ac607c2114610147578063b07e54bb146101dc578063e248cff2146101fc578063fa8675b01461020f57600080fd5b806307b7ed99146100985780630968f264146100ad5780630a6d55d8146100c057806330f08abd14610106575b600080fd5b6100ab6100a6366004610b3a565b610222565b005b6100ab6100bb366004610b74565b610236565b6100e96100ce366004610c25565b6000602081905290815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61010e601281565b60405160ff90911681526020016100fd565b6100e97f000000000000000000000000000000000000000000000000000000000000000081565b6101a4610155366004610b3a565b600160208181526000928352604092839020805492810154845180860190955260029091015460ff81811615158652610100918290048116938601939093529293828216939091049091169084565b6040805194855292151560208086019190915291151592840192909252815115156060840152015160ff16608082015260a0016100fd565b6101ef6101ea366004610c87565b61026f565b6040516100fd9190610d0f565b6101ef61020a366004610d42565b61035c565b6100ab61021d366004610c87565b6104c9565b61022a610540565b610233816105ba565b50565b61023e610540565b6000806000838060200190518101906102579190610d8e565b9194509250905061026983838361062c565b50505050565b6060610279610540565b600061028783850185610c25565b600087815260208181526040808320546001600160a01b0316808452600192839052922001549192509060ff166102e1576040516325df77c560e11b81526001600160a01b03821660048201526024015b60405180910390fd5b6001600160a01b03811660009081526001602081905260409091200154610100900460ff161561031b57610316818784610638565b610327565b610327818730856106a4565b61033181836106b1565b6040516020016103419190610dd1565b60405160208183030381529060405292505050949350505050565b6060610366610540565b600080606061037785870187610ded565b90935091508560408661038a8583610e25565b9261039793929190610e3d565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508b81526020818152604080832054828801516001600160a01b039091168085526001938490529190932090910154959650909490935060ff16915061042c9050576040516325df77c560e11b81526001600160a01b03821660048201526024016102d8565b6001600160a01b03811660009081526001602081905260409091200154610100900460ff16156104725761046d818360601c610468848961079f565b610851565b610489565b610489818360601c610484848961079f565b61062c565b604080516001600160a01b03929092166020830152606092831c828201528282019590955284518082039092018252608001909352509095945050505050565b6104d1610540565b60008481526020818152604080832080546001600160a01b0319166001600160a01b03881690811790915583526001918290529091208581558101805461ffff19169091179055801561026957600061052a8284610e67565b60f81c90506105398482610889565b5050505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105b85760405162461bcd60e51b815260206004820152601e60248201527f73656e646572206d7573742062652062726964676520636f6e7472616374000060448201526064016102d8565b565b6001600160a01b0381166000908152600160208190526040909120015460ff16610602576040516325df77c560e11b81526001600160a01b03821660048201526024016102d8565b6001600160a01b0316600090815260016020819052604090912001805461ff001916610100179055565b82610269818484610933565b60405163079cc67960e41b81526001600160a01b038381166004830152602482018390528491908216906379cc6790906044015b600060405180830381600087803b15801561068657600080fd5b505af115801561069a573d6000803e3d6000fd5b5050505050505050565b836105398185858561099b565b6001600160a01b038216600090815260016020908152604080832081518083019092526002015460ff808216151580845261010090920416928201929092526060929091610712576040518060200160405280600081525092505050610799565b601260ff16826020015160ff161061075157601282602001516107359190610e97565b61074090600a610f9e565b61074a9085610fad565b9050610779565b6020820151610761906012610e97565b61076c90600a610f9e565b6107769085610fcf565b90505b604080516020810183905201604051602081830303815290604052925050505b92915050565b6001600160a01b038216600090815260016020908152604080832081518083019092526002015460ff80821615158084526101009092041692820192909252906107ec5782915050610799565b601260ff16816020015160ff161061082c576012816020015161080f9190610e97565b61081a90600a610f9e565b6108249084610fcf565b915050610799565b602081015161083c906012610e97565b61084790600a610f9e565b6108249084610fad565b6040516340c10f1960e01b81526001600160a01b038381166004830152602482018390528491908216906340c10f199060440161066c565b6001600160a01b0382166000908152600160208190526040909120015460ff166108d1576040516325df77c560e11b81526001600160a01b03831660048201526024016102d8565b604080518082018252600180825260ff93841660208084019182526001600160a01b039690961660009081529190955291909120905160029091018054935161ffff1990941691151561ff001916919091176101009390921692909202179055565b6040516001600160a01b03831660248201526044810182905261099690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526109d3565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526102699085906323b872dd60e01b9060840161095f565b813b80610a1a5760405162461bcd60e51b8152602060048201526015602482015274115490cc8c0e881b9bdd08184818dbdb9d1c9858dd605a1b60448201526064016102d8565b600080846001600160a01b031684604051610a359190610dd1565b6000604051808303816000865af19150503d8060008114610a72576040519150601f19603f3d011682016040523d82523d6000602084013e610a77565b606091505b509150915081610abe5760405162461bcd60e51b8152602060048201526012602482015271115490cc8c0e8818d85b1b0819985a5b195960721b60448201526064016102d8565b8051156105395780806020019051810190610ad99190610fee565b6105395760405162461bcd60e51b815260206004820181905260248201527f45524332303a206f7065726174696f6e20646964206e6f74207375636365656460448201526064016102d8565b6001600160a01b038116811461023357600080fd5b600060208284031215610b4c57600080fd5b8135610b5781610b25565b9392505050565b634e487b7160e01b600052604160045260246000fd5b600060208284031215610b8657600080fd5b813567ffffffffffffffff80821115610b9e57600080fd5b818401915084601f830112610bb257600080fd5b813581811115610bc457610bc4610b5e565b604051601f8201601f19908116603f01168101908382118183101715610bec57610bec610b5e565b81604052828152876020848701011115610c0557600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208284031215610c3757600080fd5b5035919050565b60008083601f840112610c5057600080fd5b50813567ffffffffffffffff811115610c6857600080fd5b602083019150836020828501011115610c8057600080fd5b9250929050565b60008060008060608587031215610c9d57600080fd5b843593506020850135610caf81610b25565b9250604085013567ffffffffffffffff811115610ccb57600080fd5b610cd787828801610c3e565b95989497509550505050565b60005b83811015610cfe578181015183820152602001610ce6565b838111156102695750506000910152565b6020815260008251806020840152610d2e816040850160208701610ce3565b601f01601f19169190910160400192915050565b600080600060408486031215610d5757600080fd5b83359250602084013567ffffffffffffffff811115610d7557600080fd5b610d8186828701610c3e565b9497909650939450505050565b600080600060608486031215610da357600080fd5b8351610dae81610b25565b6020850151909350610dbf81610b25565b80925050604084015190509250925092565b60008251610de3818460208701610ce3565b9190910192915050565b60008060408385031215610e0057600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b60008219821115610e3857610e38610e0f565b500190565b60008085851115610e4d57600080fd5b83861115610e5a57600080fd5b5050820193919092039150565b6001600160f81b03198135818116916001851015610e8f5780818660010360031b1b83161692505b505092915050565b600060ff821660ff841680821015610eb157610eb1610e0f565b90039392505050565b600181815b80851115610ef5578160001904821115610edb57610edb610e0f565b80851615610ee857918102915b93841c9390800290610ebf565b509250929050565b600082610f0c57506001610799565b81610f1957506000610799565b8160018114610f2f5760028114610f3957610f55565b6001915050610799565b60ff841115610f4a57610f4a610e0f565b50506001821b610799565b5060208310610133831016604e8410600b8410161715610f78575081810a610799565b610f828383610eba565b8060001904821115610f9657610f96610e0f565b029392505050565b6000610b5760ff841683610efd565b600082610fca57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615610fe957610fe9610e0f565b500290565b60006020828403121561100057600080fd5b81518015158114610b5757600080fdfea264697066735822122011fbb6000e9f9b88b02803a849623347bcd0689515666591cfa740b5c19884f464736f6c634300080b0033000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb
608060405234801561001057600080fd5b50600436106100935760003560e01c8063318c136e11610066578063318c136e14610120578063ac607c2114610147578063b07e54bb146101dc578063e248cff2146101fc578063fa8675b01461020f57600080fd5b806307b7ed99146100985780630968f264146100ad5780630a6d55d8146100c057806330f08abd14610106575b600080fd5b6100ab6100a6366004610b3a565b610222565b005b6100ab6100bb366004610b74565b610236565b6100e96100ce366004610c25565b6000602081905290815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61010e601281565b60405160ff90911681526020016100fd565b6100e97f000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb81565b6101a4610155366004610b3a565b600160208181526000928352604092839020805492810154845180860190955260029091015460ff81811615158652610100918290048116938601939093529293828216939091049091169084565b6040805194855292151560208086019190915291151592840192909252815115156060840152015160ff16608082015260a0016100fd565b6101ef6101ea366004610c87565b61026f565b6040516100fd9190610d0f565b6101ef61020a366004610d42565b61035c565b6100ab61021d366004610c87565b6104c9565b61022a610540565b610233816105ba565b50565b61023e610540565b6000806000838060200190518101906102579190610d8e565b9194509250905061026983838361062c565b50505050565b6060610279610540565b600061028783850185610c25565b600087815260208181526040808320546001600160a01b0316808452600192839052922001549192509060ff166102e1576040516325df77c560e11b81526001600160a01b03821660048201526024015b60405180910390fd5b6001600160a01b03811660009081526001602081905260409091200154610100900460ff161561031b57610316818784610638565b610327565b610327818730856106a4565b61033181836106b1565b6040516020016103419190610dd1565b60405160208183030381529060405292505050949350505050565b6060610366610540565b600080606061037785870187610ded565b90935091508560408661038a8583610e25565b9261039793929190610e3d565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508b81526020818152604080832054828801516001600160a01b039091168085526001938490529190932090910154959650909490935060ff16915061042c9050576040516325df77c560e11b81526001600160a01b03821660048201526024016102d8565b6001600160a01b03811660009081526001602081905260409091200154610100900460ff16156104725761046d818360601c610468848961079f565b610851565b610489565b610489818360601c610484848961079f565b61062c565b604080516001600160a01b03929092166020830152606092831c828201528282019590955284518082039092018252608001909352509095945050505050565b6104d1610540565b60008481526020818152604080832080546001600160a01b0319166001600160a01b03881690811790915583526001918290529091208581558101805461ffff19169091179055801561026957600061052a8284610e67565b60f81c90506105398482610889565b5050505050565b336001600160a01b037f000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb16146105b85760405162461bcd60e51b815260206004820152601e60248201527f73656e646572206d7573742062652062726964676520636f6e7472616374000060448201526064016102d8565b565b6001600160a01b0381166000908152600160208190526040909120015460ff16610602576040516325df77c560e11b81526001600160a01b03821660048201526024016102d8565b6001600160a01b0316600090815260016020819052604090912001805461ff001916610100179055565b82610269818484610933565b60405163079cc67960e41b81526001600160a01b038381166004830152602482018390528491908216906379cc6790906044015b600060405180830381600087803b15801561068657600080fd5b505af115801561069a573d6000803e3d6000fd5b5050505050505050565b836105398185858561099b565b6001600160a01b038216600090815260016020908152604080832081518083019092526002015460ff808216151580845261010090920416928201929092526060929091610712576040518060200160405280600081525092505050610799565b601260ff16826020015160ff161061075157601282602001516107359190610e97565b61074090600a610f9e565b61074a9085610fad565b9050610779565b6020820151610761906012610e97565b61076c90600a610f9e565b6107769085610fcf565b90505b604080516020810183905201604051602081830303815290604052925050505b92915050565b6001600160a01b038216600090815260016020908152604080832081518083019092526002015460ff80821615158084526101009092041692820192909252906107ec5782915050610799565b601260ff16816020015160ff161061082c576012816020015161080f9190610e97565b61081a90600a610f9e565b6108249084610fcf565b915050610799565b602081015161083c906012610e97565b61084790600a610f9e565b6108249084610fad565b6040516340c10f1960e01b81526001600160a01b038381166004830152602482018390528491908216906340c10f199060440161066c565b6001600160a01b0382166000908152600160208190526040909120015460ff166108d1576040516325df77c560e11b81526001600160a01b03831660048201526024016102d8565b604080518082018252600180825260ff93841660208084019182526001600160a01b039690961660009081529190955291909120905160029091018054935161ffff1990941691151561ff001916919091176101009390921692909202179055565b6040516001600160a01b03831660248201526044810182905261099690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526109d3565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526102699085906323b872dd60e01b9060840161095f565b813b80610a1a5760405162461bcd60e51b8152602060048201526015602482015274115490cc8c0e881b9bdd08184818dbdb9d1c9858dd605a1b60448201526064016102d8565b600080846001600160a01b031684604051610a359190610dd1565b6000604051808303816000865af19150503d8060008114610a72576040519150601f19603f3d011682016040523d82523d6000602084013e610a77565b606091505b509150915081610abe5760405162461bcd60e51b8152602060048201526012602482015271115490cc8c0e8818d85b1b0819985a5b195960721b60448201526064016102d8565b8051156105395780806020019051810190610ad99190610fee565b6105395760405162461bcd60e51b815260206004820181905260248201527f45524332303a206f7065726174696f6e20646964206e6f74207375636365656460448201526064016102d8565b6001600160a01b038116811461023357600080fd5b600060208284031215610b4c57600080fd5b8135610b5781610b25565b9392505050565b634e487b7160e01b600052604160045260246000fd5b600060208284031215610b8657600080fd5b813567ffffffffffffffff80821115610b9e57600080fd5b818401915084601f830112610bb257600080fd5b813581811115610bc457610bc4610b5e565b604051601f8201601f19908116603f01168101908382118183101715610bec57610bec610b5e565b81604052828152876020848701011115610c0557600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208284031215610c3757600080fd5b5035919050565b60008083601f840112610c5057600080fd5b50813567ffffffffffffffff811115610c6857600080fd5b602083019150836020828501011115610c8057600080fd5b9250929050565b60008060008060608587031215610c9d57600080fd5b843593506020850135610caf81610b25565b9250604085013567ffffffffffffffff811115610ccb57600080fd5b610cd787828801610c3e565b95989497509550505050565b60005b83811015610cfe578181015183820152602001610ce6565b838111156102695750506000910152565b6020815260008251806020840152610d2e816040850160208701610ce3565b601f01601f19169190910160400192915050565b600080600060408486031215610d5757600080fd5b83359250602084013567ffffffffffffffff811115610d7557600080fd5b610d8186828701610c3e565b9497909650939450505050565b600080600060608486031215610da357600080fd5b8351610dae81610b25565b6020850151909350610dbf81610b25565b80925050604084015190509250925092565b60008251610de3818460208701610ce3565b9190910192915050565b60008060408385031215610e0057600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b60008219821115610e3857610e38610e0f565b500190565b60008085851115610e4d57600080fd5b83861115610e5a57600080fd5b5050820193919092039150565b6001600160f81b03198135818116916001851015610e8f5780818660010360031b1b83161692505b505092915050565b600060ff821660ff841680821015610eb157610eb1610e0f565b90039392505050565b600181815b80851115610ef5578160001904821115610edb57610edb610e0f565b80851615610ee857918102915b93841c9390800290610ebf565b509250929050565b600082610f0c57506001610799565b81610f1957506000610799565b8160018114610f2f5760028114610f3957610f55565b6001915050610799565b60ff841115610f4a57610f4a610e0f565b50506001821b610799565b5060208310610133831016604e8410600b8410161715610f78575081810a610799565b610f828383610eba565b8060001904821115610f9657610f96610e0f565b029392505050565b6000610b5760ff841683610efd565b600082610fca57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615610fe957610fe9610e0f565b500290565b60006020828403121561100057600080fd5b81518015158114610b5757600080fdfea264697066735822122011fbb6000e9f9b88b02803a849623347bcd0689515666591cfa740b5c19884f464736f6c634300080b0033
1
20,291,021
1e22ea40d33974a6ef546fdc502c58987089821c6ddaf72893c42f92792f0464
ff8afe80393a2b473325fa335e4b412753a909879b07912afd15a02b2e1c766a
0fb44352bcfe4c5a53a64dd0fad9a41184a1d609
66807b5598a848602734b82e432dd88dbe13fc8f
6f471267d09953f27f983cfe17556eff3e3b2dfb
3d602d80600a3d3981f3363d3d373d3d3d363d730b7255b886692b493372eb58e27722d985f638a85af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d730b7255b886692b493372eb58e27722d985f638a85af43d82803e903d91602b57fd5bf3
// SPDX-License-Identifier: MIT pragma solidity <0.8.0 =0.6.12 >=0.6.0 >=0.6.2; pragma experimental ABIEncoderV2; // contracts/contracts/interfaces/IBooster.sol interface IBooster { function owner() external view returns(address); function feeToken() external view returns(address); function feeDistro() external view returns(address); function lockFees() external view returns(address); function stakerRewards() external view returns(address); function lockRewards() external view returns(address); function setVoteDelegate(address _voteDelegate) external; function vote(uint256 _voteId, address _votingAddress, bool _support) external returns(bool); function voteGaugeWeight(address[] calldata _gauge, uint256[] calldata _weight ) external returns(bool); function poolInfo(uint256 _pid) external view returns(address _lptoken, address _token, address _gauge, address _crvRewards, address _stash, bool _shutdown); function earmarkRewards(uint256 _pid) external returns(bool); function earmarkFees() external returns(bool); function isShutdown() external view returns(bool); function poolLength() external view returns (uint256); } // contracts/contracts/interfaces/IConvexDeposits.sol interface IConvexDeposits { function deposit(uint256 _pid, uint256 _amount, bool _stake) external returns(bool); function deposit(uint256 _amount, bool _lock, address _stakeAddress) external; } // contracts/contracts/interfaces/ICvx.sol interface ICvx { function reductionPerCliff() external view returns(uint256); function totalSupply() external view returns(uint256); function totalCliffs() external view returns(uint256); function maxSupply() external view returns(uint256); } // contracts/contracts/interfaces/IMorpho.sol interface IMorpho { struct MarketParams { address loanToken; address collateralToken; address oracle; address irm; uint256 lltv; } struct Position { uint256 supplyShares; uint128 borrowShares; uint128 collateral; } function supplyCollateral(MarketParams memory marketParams, uint256 assets, address onBehalf, bytes memory data) external; function position(bytes32 id, address account) external view returns(Position memory p); function idToMarketParams(bytes32 id) external view returns(MarketParams memory mp); function owner() external view returns(address); } // contracts/contracts/interfaces/IOwner.sol interface IOwner { function setPendingOwner(address _powner) external; function acceptPendingOwner() external; function owner() external view returns(address); function pendingOwner() external view returns(address); } // contracts/contracts/interfaces/IRewardHook.sol interface IRewardHook { function onRewardClaim() external; } // contracts/contracts/interfaces/IRewardStaking.sol interface IRewardStaking { function stakeFor(address, uint256) external; function stake( uint256) external; function withdraw(uint256 amount, bool claim) external; function withdrawAndUnwrap(uint256 amount, bool claim) external; function earned(address account) external view returns (uint256); function getReward() external; function getReward(address _account, bool _claimExtras) external; function extraRewardsLength() external view returns (uint256); function extraRewards(uint256 _pid) external view returns (address); function rewardToken() external view returns (address); function balanceOf(address _account) external view returns (uint256); function rewardRate() external view returns(uint256); function totalSupply() external view returns(uint256); function periodFinish() external view returns(uint256); } // contracts/contracts/interfaces/ITokenWrapper.sol interface ITokenWrapper { function token() external view returns (address); } // lib/openzeppelin-contracts/contracts/math/SafeMath.sol /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } } // lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // lib/openzeppelin-contracts/contracts/utils/Address.sol /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // lib/openzeppelin-contracts/contracts/utils/Context.sol /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor () internal { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } } // contracts/contracts/interfaces/CvxMining.sol library CvxMining{ ICvx public constant cvx = ICvx(0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B); function ConvertCrvToCvx(uint256 _amount) external view returns(uint256){ uint256 supply = cvx.totalSupply(); uint256 reductionPerCliff = cvx.reductionPerCliff(); uint256 totalCliffs = cvx.totalCliffs(); uint256 maxSupply = cvx.maxSupply(); uint256 cliff = supply / reductionPerCliff; //mint if below total cliffs if(cliff < totalCliffs){ //for reduction% take inverse of current cliff uint256 reduction = totalCliffs - cliff; //reduce _amount = _amount * reduction / totalCliffs; //supply cap check uint256 amtTillMax = maxSupply - supply; if(_amount > amtTillMax){ _amount = amtTillMax; } //mint return _amount; } return 0; } } // lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) public { _name = name_; _symbol = symbol_; _decimals = 18; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ 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); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal virtual { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } // lib/openzeppelin-contracts/contracts/token/ERC20/SafeERC20.sol /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } // contracts/contracts/wrappers/ConvexStakingWrapper.sol //Example of a tokenize a convex staked position. //if used as collateral some modifications will be needed to fit the specific platform //Based on Curve.fi's gauge wrapper implementations at https://github.com/curvefi/curve-dao-contracts/tree/master/contracts/gauges/wrappers contract ConvexStakingWrapper is ERC20, ReentrancyGuard { using SafeERC20 for IERC20; using SafeMath for uint256; struct EarnedData { address token; uint256 amount; } struct RewardType { address reward_token; address reward_pool; uint256 reward_integral; uint256 reward_remaining; mapping(address => uint256) reward_integral_for; mapping(address => uint256) claimable_reward; } //constants/immutables address public constant convexBooster = address(0xF403C135812408BFbE8713b5A23a04b3D48AAE31); address public constant crv = address(0xD533a949740bb3306d119CC777fa900bA034cd52); address public constant cvx = address(0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B); address public curveToken; address public convexToken; address public convexPool; uint256 public convexPoolId; address public collateralVault; uint256 private constant CRV_INDEX = 0; uint256 private constant CVX_INDEX = 1; //rewards RewardType[] public rewards; mapping(address => uint256) public registeredRewards; address public rewardHook; mapping(address => address) public rewardRedirect; //management bool public isShutdown; bool public isInit; address internal _owner; string internal _tokenname; string internal _tokensymbol; event Deposited(address indexed _user, address indexed _account, uint256 _amount, bool _wrapped); event Withdrawn(address indexed _user, uint256 _amount, bool _unwrapped); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event RewardInvalidated(address _rewardToken); event RewardRedirected(address indexed _account, address _forward); event RewardAdded(address _token); event Shutdown(); event HookSet(address _hook); event UserCheckpoint(address _userA, address _userB); constructor() public ERC20( "StakedConvexToken", "stkCvx" ){ } function initialize(uint256 _poolId) virtual external { require(!isInit,"already init"); _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); (address _lptoken, address _token, , address _rewards, , ) = IBooster(convexBooster).poolInfo(_poolId); curveToken = _lptoken; convexToken = _token; convexPool = _rewards; convexPoolId = _poolId; _tokenname = string(abi.encodePacked("Staked ", ERC20(_token).name() )); _tokensymbol = string(abi.encodePacked("stk", ERC20(_token).symbol())); isShutdown = false; isInit = true; // collateralVault = _vault; //add rewards addRewards(); setApprovals(); } function owner() public view virtual returns(address) { return _owner; } function name() public view override returns (string memory) { return _tokenname; } function symbol() public view override returns (string memory) { return _tokensymbol; } function decimals() public view override returns (uint8) { return 18; } modifier onlyOwner() virtual{ require(_owner == msg.sender, "Ownable: caller is not the owner"); _; } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function shutdown() external onlyOwner { isShutdown = true; emit Shutdown(); } function setApprovals() public { IERC20(curveToken).safeApprove(convexBooster, 0); IERC20(curveToken).safeApprove(convexBooster, uint256(-1)); IERC20(convexToken).safeApprove(convexPool, 0); IERC20(convexToken).safeApprove(convexPool, uint256(-1)); } function addRewards() public { address mainPool = convexPool; if (rewards.length == 0) { rewards.push( RewardType({ reward_token: crv, reward_pool: mainPool, reward_integral: 0, reward_remaining: 0 }) ); rewards.push( RewardType({ reward_token: cvx, reward_pool: address(0), reward_integral: 0, reward_remaining: 0 }) ); registeredRewards[crv] = CRV_INDEX+1; //mark registered at index+1 registeredRewards[cvx] = CVX_INDEX+1; //mark registered at index+1 //send to self to warmup state IERC20(crv).transfer(address(this),0); //send to self to warmup state IERC20(cvx).transfer(address(this),0); emit RewardAdded(crv); emit RewardAdded(cvx); } uint256 extraCount = IRewardStaking(mainPool).extraRewardsLength(); for (uint256 i = 0; i < extraCount; i++) { address extraPool = IRewardStaking(mainPool).extraRewards(i); address extraToken = IRewardStaking(extraPool).rewardToken(); //from pool 151, extra reward tokens are wrapped if(convexPoolId >= 151){ extraToken = ITokenWrapper(extraToken).token(); } if(extraToken == cvx){ //update cvx reward pool address rewards[CVX_INDEX].reward_pool = extraPool; }else if(registeredRewards[extraToken] == 0){ //add new token to list rewards.push( RewardType({ reward_token: extraToken, reward_pool: extraPool, reward_integral: 0, reward_remaining: 0 }) ); registeredRewards[extraToken] = rewards.length; //mark registered at index+1 emit RewardAdded(extraToken); } } } function addTokenReward(address _token) public virtual onlyOwner { //check if not registered yet if(registeredRewards[_token] == 0){ //add new token to list rewards.push( RewardType({ reward_token: _token, reward_pool: address(0), reward_integral: 0, reward_remaining: 0 }) ); //add to registered map registeredRewards[_token] = rewards.length; //mark registered at index+1 //send to self to warmup state IERC20(_token).transfer(address(this),0); emit RewardAdded(_token); }else{ //get previous used index of given token //this ensures that reviving can only be done on the previous used slot uint256 index = registeredRewards[_token]; if(index > 0){ //index is registeredRewards minus one RewardType storage reward = rewards[index-1]; //check if it was invalidated if(reward.reward_token == address(0)){ //revive reward.reward_token = _token; emit RewardAdded(_token); } } } } //allow invalidating a reward if the token causes trouble in calcRewardIntegral function invalidateReward(address _token) public onlyOwner { uint256 index = registeredRewards[_token]; if(index > 0){ //index is registered rewards minus one RewardType storage reward = rewards[index-1]; require(reward.reward_token == _token, "!mismatch"); //set reward token address to 0, integral calc will now skip reward.reward_token = address(0); emit RewardInvalidated(_token); } } function setHook(address _hook) external onlyOwner{ rewardHook = _hook; emit HookSet(_hook); } function rewardLength() external view returns(uint256) { return rewards.length; } function _getDepositedBalance(address _account) internal virtual view returns(uint256) { if (_account == address(0) || _account == collateralVault) { return 0; } //get balance from collateralVault return balanceOf(_account); } function _getTotalSupply() internal virtual view returns(uint256){ //override and add any supply needed (interest based growth) return totalSupply(); } //internal transfer function to transfer rewards out on claim function _transferReward(address _token, address _to, uint256 _amount) internal virtual{ IERC20(_token).safeTransfer(_to, _amount); } function _calcRewardIntegral(uint256 _index, address[2] memory _accounts, uint256[2] memory _balances, uint256 _supply, bool _isClaim) internal{ RewardType storage reward = rewards[_index]; if(reward.reward_token == address(0)){ return; } //get difference in balance and remaining rewards //getReward is unguarded so we use reward_remaining to keep track of how much was actually claimed uint256 bal = IERC20(reward.reward_token).balanceOf(address(this)); //check that balance increased and update integral if (_supply > 0 && bal > reward.reward_remaining) { reward.reward_integral = reward.reward_integral + (bal.sub(reward.reward_remaining).mul(1e20).div(_supply)); } //update user integrals for (uint256 u = 0; u < _accounts.length; u++) { //do not give rewards to address 0 if (_accounts[u] == address(0)) continue; if (_accounts[u] == collateralVault) continue; if(_isClaim && u != 0) continue; //only update/claim for first address and use second as forwarding uint userI = reward.reward_integral_for[_accounts[u]]; if(_isClaim || userI < reward.reward_integral){ if(_isClaim){ uint256 receiveable = reward.claimable_reward[_accounts[u]].add(_balances[u].mul( reward.reward_integral.sub(userI)).div(1e20)); if(receiveable > 0){ reward.claimable_reward[_accounts[u]] = 0; //cheat for gas savings by transfering to the second index in accounts list //if claiming only the 0 index will update so 1 index can hold forwarding info //guaranteed to have an address in u+1 so no need to check _transferReward(reward.reward_token, _accounts[u+1], receiveable); bal = bal.sub(receiveable); } }else{ reward.claimable_reward[_accounts[u]] = reward.claimable_reward[_accounts[u]].add(_balances[u].mul( reward.reward_integral.sub(userI)).div(1e20)); } reward.reward_integral_for[_accounts[u]] = reward.reward_integral; } } //update remaining reward here since balance could have changed if claiming if(bal != reward.reward_remaining){ reward.reward_remaining = bal; } } function _checkpoint(address[2] memory _accounts) internal virtual nonReentrant{ uint256 supply = _getTotalSupply(); uint256[2] memory depositedBalance; depositedBalance[0] = _getDepositedBalance(_accounts[0]); depositedBalance[1] = _getDepositedBalance(_accounts[1]); //just in case, dont claim rewards directly if shutdown //can still technically claim via unguarded calls but skipping here //protects against outside calls reverting if(!isShutdown){ IRewardStaking(convexPool).getReward(address(this), true); } _claimExtras(false); uint256 rewardCount = rewards.length; for (uint256 i = 0; i < rewardCount; i++) { _calcRewardIntegral(i,_accounts,depositedBalance,supply,false); } emit UserCheckpoint(_accounts[0],_accounts[1]); } function _checkpointAndClaim(address[2] memory _accounts) internal virtual nonReentrant{ uint256 supply = _getTotalSupply(); uint256[2] memory depositedBalance; depositedBalance[0] = _getDepositedBalance(_accounts[0]); //only do first slot //just in case, dont claim rewards directly if shutdown //can still technically claim via unguarded calls but skipping here //protects against outside calls reverting if(!isShutdown){ IRewardStaking(convexPool).getReward(address(this), true); } _claimExtras(true); uint256 rewardCount = rewards.length; for (uint256 i = 0; i < rewardCount; i++) { _calcRewardIntegral(i,_accounts,depositedBalance,supply,true); } emit UserCheckpoint(_accounts[0],_accounts[1]); } //claim any rewards not part of the convex pool function _claimExtras(bool /*_isClaim*/) internal virtual{ //override and add any external reward claiming if(rewardHook != address(0)){ try IRewardHook(rewardHook).onRewardClaim(){ }catch{} } } function user_checkpoint(address _account) external returns(bool) { _checkpoint([_account, address(0)]); return true; } function totalBalanceOf(address _account) external view returns(uint256){ return _getDepositedBalance(_account); } //run earned as a mutable function to claim everything before calculating earned rewards function earned(address _account) external returns(EarnedData[] memory claimable) { //checkpoint to pull in and tally new rewards _checkpoint([_account, address(0)]); return _earned(_account); } function _earned(address _account) internal view returns(EarnedData[] memory claimable) { uint256 rewardCount = rewards.length; claimable = new EarnedData[](rewardCount); for (uint256 i = 0; i < rewardCount; i++) { RewardType storage reward = rewards[i]; if(reward.reward_token == address(0)){ continue; } claimable[i].amount = reward.claimable_reward[_account]; claimable[i].token = reward.reward_token; } return claimable; } //set any claimed rewards to automatically go to a different address //set address to zero to disable function setRewardRedirect(address _to) external nonReentrant{ rewardRedirect[msg.sender] = _to; emit RewardRedirected(msg.sender, _to); } function getReward(address _account) external { //check if there is a redirect address if(rewardRedirect[_account] != address(0)){ _checkpointAndClaim([_account, rewardRedirect[_account]]); }else{ //claim directly in checkpoint logic to save a bit of gas _checkpointAndClaim([_account, _account]); } } function getReward(address _account, address _forwardTo) external { require(msg.sender == _account, "!self"); //claim directly in checkpoint logic to save a bit of gas //pack forwardTo into account array to save gas so that a proxy etc doesnt have to double transfer _checkpointAndClaim([_account,_forwardTo]); } //deposit a curve token function deposit(uint256 _amount, address _to) external virtual{ require(!isShutdown, "shutdown"); //dont need to call checkpoint since _mint() will if (_amount > 0) { _mint(_to, _amount); IERC20(curveToken).safeTransferFrom(msg.sender, address(this), _amount); IConvexDeposits(convexBooster).deposit(convexPoolId, _amount, true); } emit Deposited(msg.sender, _to, _amount, true); } //stake a convex token function stake(uint256 _amount, address _to) external virtual{ require(!isShutdown, "shutdown"); //dont need to call checkpoint since _mint() will if (_amount > 0) { _mint(_to, _amount); IERC20(convexToken).safeTransferFrom(msg.sender, address(this), _amount); IRewardStaking(convexPool).stake(_amount); } emit Deposited(msg.sender, _to, _amount, false); } //withdraw to convex deposit token function withdraw(uint256 _amount) external virtual{ //dont need to call checkpoint since _burn() will if (_amount > 0) { _burn(msg.sender, _amount); IRewardStaking(convexPool).withdraw(_amount, false); IERC20(convexToken).safeTransfer(msg.sender, _amount); } emit Withdrawn(msg.sender, _amount, false); } //withdraw to underlying curve lp token function withdrawAndUnwrap(uint256 _amount) external virtual{ //dont need to call checkpoint since _burn() will if (_amount > 0) { _burn(msg.sender, _amount); IRewardStaking(convexPool).withdrawAndUnwrap(_amount, false); IERC20(curveToken).safeTransfer(msg.sender, _amount); } //events emit Withdrawn(msg.sender, _amount, true); } function _beforeTokenTransfer(address _from, address _to, uint256 /*_amount*/) internal virtual override { _checkpoint([_from, _to]); } //helper function function earmarkRewards() external returns(bool){ return IBooster(convexBooster).earmarkRewards(convexPoolId); } } // contracts/contracts/wrappers/ConvexStakingWrapperMorpho.sol /* Staking wrapper for Morpho Use convex LP positions as collateral while still receiving rewards This is a non standard token which only mints itself to the morpho vault and disallows all transfers. Because morpho does state changes before token transfer, the wrapper itself must be the only entry to morpho to ensure it gets to act first by checkpointing user balances before state changes. By disabling typical transfers we can reduce gas costs of wrapping when depositing. Only allow "transfers" out of morpho for withdraws or liquidations. Override the normal transfer logic for a burn+unwrap to the target address. The downside of this design is that withdraws and liquidations could cause uncheckpointed rewards to be lost. As the wrapper has no information on who was liquidated and when, it can not keep track. For normal withdraws, users will need to claim rewards or checkpoint before removing collateral from Morpho. */ contract ConvexStakingWrapperMorpho is ConvexStakingWrapper { using SafeERC20 for IERC20; using SafeMath for uint256; address public immutable morpho; bytes32 morphoId; constructor(address _morpho) public{ morpho = _morpho; } modifier onlyOwner() override{ require(owner() == msg.sender, "Ownable: caller is not the owner"); _; } function owner() public view override returns(address) { return IOwner(morpho).owner(); } function initialize(uint256 _poolId) override external { require(!isInit,"already init"); emit OwnershipTransferred(address(0), owner()); (address _lptoken, address _token, , address _rewards, , ) = IBooster(convexBooster).poolInfo(_poolId); curveToken = _lptoken; convexToken = _token; convexPool = _rewards; convexPoolId = _poolId; _tokenname = string(abi.encodePacked("Staked ", ERC20(_token).name(), " Morpho" )); _tokensymbol = string(abi.encodePacked("stk", ERC20(_token).symbol(), "-morpho")); isShutdown = false; isInit = true; //add rewards addRewards(); setApprovals(); IERC20(address(this)).safeApprove(morpho, uint256(-1)); } function setMorphoId(bytes32 _id) external{ require(morphoId == bytes32(0), "already set"); IMorpho.MarketParams memory mp = IMorpho(morpho).idToMarketParams(_id); require(mp.collateralToken == address(this),"invalid id"); morphoId = _id; } //4626 interface function asset() external view returns(address){ return curveToken; } //wrapped erc20 interface function underlying() external view returns(address){ return curveToken; } //deposit a curve token, wrap, and supply collateral to morpho function _depositToMorpho(IMorpho.MarketParams memory marketParams, uint256 assets, address onBehalf, bytes memory data) internal returns (bool){ require(!isShutdown, "shutdown"); //call checkpoint on onBehalf _checkpoint([onBehalf, address(0)]); if (assets > 0) { //mint directly on morpho //this is gas trickery as we can skip transfer logic when supplying //so that we're not paying an extra transfer _mint(morpho, assets); IERC20(curveToken).safeTransferFrom(msg.sender, address(this), assets); IConvexDeposits(convexBooster).deposit(convexPoolId, assets, true); //supply to morpho //checkpointed above so safe to change morpho state of onBehalf IMorpho(morpho).supplyCollateral(marketParams, assets, onBehalf, data); } emit Deposited(msg.sender, onBehalf, assets, true); return true; } //normal deposit function deposit(uint256 _amount, address _to) external override{ //gracefully do nothing } //wrapped erc20 interface function depositFor(address _to, uint256 _amount) external returns (bool){ return _depositToMorpho(IMorpho(morpho).idToMarketParams(morphoId), _amount, _to, new bytes(0)); } function stake(uint256 _amount, address _to) external override{ //gracefully do nothing } function withdraw(uint256 _amount) external override{ //gracefully do nothing } function withdrawAndUnwrap(uint256 _amount) external override{ //gracefully do nothing } function _getDepositedBalance(address _account) internal override view returns(uint256) { if (_account == address(0) || _account == morpho) { return 0; } //return morpho collateral balance (can ignore wrapper token balance) return IMorpho(morpho).position(morphoId, _account).collateral; } function _beforeTokenTransfer(address /*_from*/, address /*_to*/, uint256 /*_amount*/) internal override { //dont need to checkpoint as we already are doing so directly in deposit } function _transfer(address _from, address _to, uint256 _amount) internal override { //Only legit transfer is from morpho //which doesnt even transfer but just burns+unwraps to the target. //Let other transfers fail without error. if(_from == morpho){ //normally we would do a checkpoint before burning... //however since a liquidation will cause a //user to lose their uncheckedpointed rewards, a checkpoint here would brick those rewards. //if we dont checkpoint now then those rewards could be at least distributed //to the remaining users // _checkpoint([address(0),address(0)]); //unwrap to curve lp token and transfer that instead if (_amount > 0) { _burn(_from, _amount); IRewardStaking(convexPool).withdrawAndUnwrap(_amount, false); IERC20(curveToken).safeTransfer(_to, _amount); emit Withdrawn(_from, _amount, true); emit Transfer(_from, _to, _amount); } }else if(_from != address(this)){ require(_to != morpho, "!invalid transfer"); //any other call to transfer just act as a checkpoint instead of actually transferring //..just checkpoint to as this is more of a workaround to get a checkpoint in to a specific address // and we dont have to pay for check pointing 2 addresses _checkpoint([_to, address(0)]); } } }
1
20,291,022
dcc01c54baffda3e5604cd6f496e79562492e11e205e40c368be59542a4452e1
4aae49778493a768da8e836915a60fcbd40b021a2c885ded32c8e6fd4bd70f10
c5533be6e51460c47e2e6ee214ca70d3678dd417
c5533be6e51460c47e2e6ee214ca70d3678dd417
a638c68a276bbe716c5eaf11136073a2d464f5e0
60a060405234801561001057600080fd5b50604051610f44380380610f4483398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b608051610eb261009260003960008181610125015261064c0152610eb26000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063318c136e11610066578063318c136e14610120578063ac607c2114610147578063b07e54bb146101dc578063e248cff2146101fc578063fa8675b01461020f57600080fd5b806307b7ed99146100985780630968f264146100ad5780630a6d55d8146100c057806330f08abd14610106575b600080fd5b6100ab6100a6366004610a46565b610222565b005b6100ab6100bb366004610ad9565b610236565b6100e96100ce366004610b59565b6000602081905290815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61010e601281565b60405160ff90911681526020016100fd565b6100e97f000000000000000000000000000000000000000000000000000000000000000081565b6101a4610155366004610a46565b600160208181526000928352604092839020805492810154845180860190955260029091015460ff81811615158652610100918290048116938601939093529293828216939091049091169084565b6040805194855292151560208086019190915291151592840192909252815115156060840152015160ff16608082015260a0016100fd565b6101ef6101ea366004610bbb565b610270565b6040516100fd9190610c6f565b6101ef61020a366004610c82565b6103c4565b6100ab61021d366004610bbb565b6105ed565b61022a610641565b610233816106bb565b50565b61023e610641565b6000806000838060200190518101906102579190610cce565b9194509250905061026a8330848461072d565b50505050565b606061027a610641565b600061028883850185610b59565b600087815260208181526040808320546001600160a01b0316808452600192839052922001549192509060ff166102e2576040516325df77c560e11b81526001600160a01b03821660048201526024015b60405180910390fd5b6102fc6001600160a01b038216635b5e139f60e01b6107a2565b156103745760405163c87b56dd60e01b81526004810183905281906001600160a01b0382169063c87b56dd90602401600060405180830381865afa158015610348573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103709190810190610d11565b9350505b6001600160a01b03811660009081526001602081905260409091200154610100900460ff16156103ae576103a98187846107c7565b6103ba565b6103ba8187308561072d565b5050949350505050565b60606103ce610641565b60008060608180826103e2888a018a610d88565b90965094506103f2856040610daa565b92506104018360408a8c610dd0565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092965061044792508a9150859050818c610dd0565b8101906104549190610b59565b91508888610463856020610daa565b9084610470876020610daa565b61047a9190610daa565b9261048793929190610dd0565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050905060006020850151905060008060008d815260200190815260200160002060009054906101000a90046001600160a01b0316905060016000826001600160a01b03166001600160a01b0316815260200190815260200160002060010160009054906101000a900460ff1661055d576040516325df77c560e11b81526001600160a01b03821660048201526024016102d9565b6001600160a01b03811660009081526001602081905260409091200154610100900460ff161561059b57610596818360601c8a866108e3565b6105aa565b6105aa81308460601c8b61072d565b604080516001600160a01b03929092166020830152606092831c828201528282019890985287518082039092018252608001909652509398975050505050505050565b6105f5610641565b60008481526020818152604080832080546001600160a01b0319166001600160a01b03881690811790915583526001918290529091208581558101805461ffff1916909117905561026a565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106b95760405162461bcd60e51b815260206004820152601e60248201527f73656e646572206d7573742062652062726964676520636f6e7472616374000060448201526064016102d9565b565b6001600160a01b0381166000908152600160208190526040909120015460ff16610703576040516325df77c560e11b81526001600160a01b03821660048201526024016102d9565b6001600160a01b0316600090815260016020819052604090912001805461ff001916610100179055565b6040516323b872dd60e01b81526001600160a01b0384811660048301528381166024830152604482018390528591908216906323b872dd906064015b600060405180830381600087803b15801561078357600080fd5b505af1158015610797573d6000803e3d6000fd5b505050505050505050565b60006107ad83610915565b80156107be57506107be8383610948565b90505b92915050565b6040516331a9108f60e11b81526004810182905283906001600160a01b038481169190831690636352211e90602401602060405180830381865afa158015610813573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108379190610dfa565b6001600160a01b0316146108835760405162461bcd60e51b8152602060048201526013602482015272213ab937103737ba10333937b69037bbb732b960691b60448201526064016102d9565b604051630852cd8d60e31b8152600481018390526001600160a01b038216906342966c6890602401600060405180830381600087803b1580156108c557600080fd5b505af11580156108d9573d6000803e3d6000fd5b5050505050505050565b6040516334ff261960e21b815284906001600160a01b0382169063d3fc98649061076990879087908790600401610e17565b6000610928826301ffc9a760e01b610948565b80156107c15750610941826001600160e01b0319610948565b1592915050565b604080516001600160e01b0319831660248083019190915282518083039091018152604490910182526020810180516001600160e01b03166301ffc9a760e01b179052905160009190829081906001600160a01b03871690617530906109af908690610e3e565b6000604051808303818686fa925050503d80600081146109eb576040519150601f19603f3d011682016040523d82523d6000602084013e6109f0565b606091505b5091509150602081511015610a0b57600093505050506107c1565b818015610a27575080806020019051810190610a279190610e5a565b9695505050505050565b6001600160a01b038116811461023357600080fd5b600060208284031215610a5857600080fd5b8135610a6381610a31565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610aa957610aa9610a6a565b604052919050565b600067ffffffffffffffff821115610acb57610acb610a6a565b50601f01601f191660200190565b600060208284031215610aeb57600080fd5b813567ffffffffffffffff811115610b0257600080fd5b8201601f81018413610b1357600080fd5b8035610b26610b2182610ab1565b610a80565b818152856020838501011115610b3b57600080fd5b81602084016020830137600091810160200191909152949350505050565b600060208284031215610b6b57600080fd5b5035919050565b60008083601f840112610b8457600080fd5b50813567ffffffffffffffff811115610b9c57600080fd5b602083019150836020828501011115610bb457600080fd5b9250929050565b60008060008060608587031215610bd157600080fd5b843593506020850135610be381610a31565b9250604085013567ffffffffffffffff811115610bff57600080fd5b610c0b87828801610b72565b95989497509550505050565b60005b83811015610c32578181015183820152602001610c1a565b8381111561026a5750506000910152565b60008151808452610c5b816020860160208601610c17565b601f01601f19169290920160200192915050565b6020815260006107be6020830184610c43565b600080600060408486031215610c9757600080fd5b83359250602084013567ffffffffffffffff811115610cb557600080fd5b610cc186828701610b72565b9497909650939450505050565b600080600060608486031215610ce357600080fd5b8351610cee81610a31565b6020850151909350610cff81610a31565b80925050604084015190509250925092565b600060208284031215610d2357600080fd5b815167ffffffffffffffff811115610d3a57600080fd5b8201601f81018413610d4b57600080fd5b8051610d59610b2182610ab1565b818152856020838501011115610d6e57600080fd5b610d7f826020830160208601610c17565b95945050505050565b60008060408385031215610d9b57600080fd5b50508035926020909101359150565b60008219821115610dcb57634e487b7160e01b600052601160045260246000fd5b500190565b60008085851115610de057600080fd5b83861115610ded57600080fd5b5050820193919092039150565b600060208284031215610e0c57600080fd5b8151610a6381610a31565b60018060a01b0384168152826020820152606060408201526000610d7f6060830184610c43565b60008251610e50818460208701610c17565b9190910192915050565b600060208284031215610e6c57600080fd5b81518015158114610a6357600080fdfea2646970667358221220d8cc7bd626fa92f352d0960bff36fd5ae93e59a61028b768b9e38901a589e8c764736f6c634300080b0033000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb
608060405234801561001057600080fd5b50600436106100935760003560e01c8063318c136e11610066578063318c136e14610120578063ac607c2114610147578063b07e54bb146101dc578063e248cff2146101fc578063fa8675b01461020f57600080fd5b806307b7ed99146100985780630968f264146100ad5780630a6d55d8146100c057806330f08abd14610106575b600080fd5b6100ab6100a6366004610a46565b610222565b005b6100ab6100bb366004610ad9565b610236565b6100e96100ce366004610b59565b6000602081905290815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61010e601281565b60405160ff90911681526020016100fd565b6100e97f000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb81565b6101a4610155366004610a46565b600160208181526000928352604092839020805492810154845180860190955260029091015460ff81811615158652610100918290048116938601939093529293828216939091049091169084565b6040805194855292151560208086019190915291151592840192909252815115156060840152015160ff16608082015260a0016100fd565b6101ef6101ea366004610bbb565b610270565b6040516100fd9190610c6f565b6101ef61020a366004610c82565b6103c4565b6100ab61021d366004610bbb565b6105ed565b61022a610641565b610233816106bb565b50565b61023e610641565b6000806000838060200190518101906102579190610cce565b9194509250905061026a8330848461072d565b50505050565b606061027a610641565b600061028883850185610b59565b600087815260208181526040808320546001600160a01b0316808452600192839052922001549192509060ff166102e2576040516325df77c560e11b81526001600160a01b03821660048201526024015b60405180910390fd5b6102fc6001600160a01b038216635b5e139f60e01b6107a2565b156103745760405163c87b56dd60e01b81526004810183905281906001600160a01b0382169063c87b56dd90602401600060405180830381865afa158015610348573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103709190810190610d11565b9350505b6001600160a01b03811660009081526001602081905260409091200154610100900460ff16156103ae576103a98187846107c7565b6103ba565b6103ba8187308561072d565b5050949350505050565b60606103ce610641565b60008060608180826103e2888a018a610d88565b90965094506103f2856040610daa565b92506104018360408a8c610dd0565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092965061044792508a9150859050818c610dd0565b8101906104549190610b59565b91508888610463856020610daa565b9084610470876020610daa565b61047a9190610daa565b9261048793929190610dd0565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050905060006020850151905060008060008d815260200190815260200160002060009054906101000a90046001600160a01b0316905060016000826001600160a01b03166001600160a01b0316815260200190815260200160002060010160009054906101000a900460ff1661055d576040516325df77c560e11b81526001600160a01b03821660048201526024016102d9565b6001600160a01b03811660009081526001602081905260409091200154610100900460ff161561059b57610596818360601c8a866108e3565b6105aa565b6105aa81308460601c8b61072d565b604080516001600160a01b03929092166020830152606092831c828201528282019890985287518082039092018252608001909652509398975050505050505050565b6105f5610641565b60008481526020818152604080832080546001600160a01b0319166001600160a01b03881690811790915583526001918290529091208581558101805461ffff1916909117905561026a565b336001600160a01b037f000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb16146106b95760405162461bcd60e51b815260206004820152601e60248201527f73656e646572206d7573742062652062726964676520636f6e7472616374000060448201526064016102d9565b565b6001600160a01b0381166000908152600160208190526040909120015460ff16610703576040516325df77c560e11b81526001600160a01b03821660048201526024016102d9565b6001600160a01b0316600090815260016020819052604090912001805461ff001916610100179055565b6040516323b872dd60e01b81526001600160a01b0384811660048301528381166024830152604482018390528591908216906323b872dd906064015b600060405180830381600087803b15801561078357600080fd5b505af1158015610797573d6000803e3d6000fd5b505050505050505050565b60006107ad83610915565b80156107be57506107be8383610948565b90505b92915050565b6040516331a9108f60e11b81526004810182905283906001600160a01b038481169190831690636352211e90602401602060405180830381865afa158015610813573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108379190610dfa565b6001600160a01b0316146108835760405162461bcd60e51b8152602060048201526013602482015272213ab937103737ba10333937b69037bbb732b960691b60448201526064016102d9565b604051630852cd8d60e31b8152600481018390526001600160a01b038216906342966c6890602401600060405180830381600087803b1580156108c557600080fd5b505af11580156108d9573d6000803e3d6000fd5b5050505050505050565b6040516334ff261960e21b815284906001600160a01b0382169063d3fc98649061076990879087908790600401610e17565b6000610928826301ffc9a760e01b610948565b80156107c15750610941826001600160e01b0319610948565b1592915050565b604080516001600160e01b0319831660248083019190915282518083039091018152604490910182526020810180516001600160e01b03166301ffc9a760e01b179052905160009190829081906001600160a01b03871690617530906109af908690610e3e565b6000604051808303818686fa925050503d80600081146109eb576040519150601f19603f3d011682016040523d82523d6000602084013e6109f0565b606091505b5091509150602081511015610a0b57600093505050506107c1565b818015610a27575080806020019051810190610a279190610e5a565b9695505050505050565b6001600160a01b038116811461023357600080fd5b600060208284031215610a5857600080fd5b8135610a6381610a31565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610aa957610aa9610a6a565b604052919050565b600067ffffffffffffffff821115610acb57610acb610a6a565b50601f01601f191660200190565b600060208284031215610aeb57600080fd5b813567ffffffffffffffff811115610b0257600080fd5b8201601f81018413610b1357600080fd5b8035610b26610b2182610ab1565b610a80565b818152856020838501011115610b3b57600080fd5b81602084016020830137600091810160200191909152949350505050565b600060208284031215610b6b57600080fd5b5035919050565b60008083601f840112610b8457600080fd5b50813567ffffffffffffffff811115610b9c57600080fd5b602083019150836020828501011115610bb457600080fd5b9250929050565b60008060008060608587031215610bd157600080fd5b843593506020850135610be381610a31565b9250604085013567ffffffffffffffff811115610bff57600080fd5b610c0b87828801610b72565b95989497509550505050565b60005b83811015610c32578181015183820152602001610c1a565b8381111561026a5750506000910152565b60008151808452610c5b816020860160208601610c17565b601f01601f19169290920160200192915050565b6020815260006107be6020830184610c43565b600080600060408486031215610c9757600080fd5b83359250602084013567ffffffffffffffff811115610cb557600080fd5b610cc186828701610b72565b9497909650939450505050565b600080600060608486031215610ce357600080fd5b8351610cee81610a31565b6020850151909350610cff81610a31565b80925050604084015190509250925092565b600060208284031215610d2357600080fd5b815167ffffffffffffffff811115610d3a57600080fd5b8201601f81018413610d4b57600080fd5b8051610d59610b2182610ab1565b818152856020838501011115610d6e57600080fd5b610d7f826020830160208601610c17565b95945050505050565b60008060408385031215610d9b57600080fd5b50508035926020909101359150565b60008219821115610dcb57634e487b7160e01b600052601160045260246000fd5b500190565b60008085851115610de057600080fd5b83861115610ded57600080fd5b5050820193919092039150565b600060208284031215610e0c57600080fd5b8151610a6381610a31565b60018060a01b0384168152826020820152606060408201526000610d7f6060830184610c43565b60008251610e50818460208701610c17565b9190910192915050565b600060208284031215610e6c57600080fd5b81518015158114610a6357600080fdfea2646970667358221220d8cc7bd626fa92f352d0960bff36fd5ae93e59a61028b768b9e38901a589e8c764736f6c634300080b0033
1
20,291,023
85935537bb4e24978ec6cff3671b7ee7fbc042ed38496307a6a21d37d32d781e
fedd9aac16e71330e168f3af0124e4185549eec75a0cbd33260c37f9d4c3e31c
c5533be6e51460c47e2e6ee214ca70d3678dd417
c5533be6e51460c47e2e6ee214ca70d3678dd417
fd76546031d444eadb3b749919490dde3974027b
60a06040523480156200001157600080fd5b50604051620011013803806200110183398101604081905262000034916200013e565b6001600160a01b0381166080526200004e60003362000055565b5062000170565b62000061828262000065565b5050565b6000828152602081815260409091206200008a9183906200084e620000cc821b17901c565b15620000615760405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b6000620000e3836001600160a01b038416620000ec565b90505b92915050565b60008181526001830160205260408120546200013557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620000e6565b506000620000e6565b6000602082840312156200015157600080fd5b81516001600160a01b03811681146200016957600080fd5b9392505050565b608051610f6e62000193600039600081816101ad01526108c70152610f6e6000f3fe6080604052600436106100fe5760003560e01c8063542774b511610095578063ca15c87311610064578063ca15c87314610302578063cfdb63ac14610322578063d547741f14610352578063ef4f081f14610372578063f1382b26146103af57600080fd5b8063542774b5146102685780639010d07c1461029d57806391d14854146102bd578063a217fddf146102ed57600080fd5b8063318c136e116100d1578063318c136e1461019b57806336568abe146101e75780633d94ebc6146102075780634e0df3f61461024857600080fd5b80631af5fe3814610103578063248a9ca31461012557806325307065146101685780632f2ff15d1461017b575b600080fd5b34801561010f57600080fd5b5061012361011e366004610bcd565b6103cf565b005b34801561013157600080fd5b50610155610140366004610c0d565b60009081526020819052604090206002015490565b6040519081526020015b60405180910390f35b610123610176366004610c6f565b610414565b34801561018757600080fd5b50610123610196366004610d1c565b610504565b3480156101a757600080fd5b506101cf7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161015f565b3480156101f357600080fd5b50610123610202366004610d1c565b610592565b34801561021357600080fd5b506101cf610222366004610d4c565b60016020908152600092835260408084209091529082529020546001600160a01b031681565b34801561025457600080fd5b50610155610263366004610d1c565b61060c565b34801561027457600080fd5b5060408051808201825260068152653937baba32b960d11b6020820152905161015f9190610d76565b3480156102a957600080fd5b506101cf6102b8366004610dcb565b610637565b3480156102c957600080fd5b506102dd6102d8366004610d1c565b610656565b604051901515815260200161015f565b3480156102f957600080fd5b50610155600081565b34801561030e57600080fd5b5061015561031d366004610c0d565b61066e565b34801561032e57600080fd5b506102dd61033d366004610ded565b60026020526000908152604090205460ff1681565b34801561035e57600080fd5b5061012361036d366004610d1c565b610685565b34801561037e57600080fd5b5061039261038d366004610c6f565b610706565b604080519283526001600160a01b0390911660208301520161015f565b3480156103bb57600080fd5b506101236103ca366004610e0a565b6107e3565b6103d7610863565b60ff9290921660009081526001602090815260408083209383529290522080546001600160a01b0319166001600160a01b03909216919091179055565b61041c6108bc565b6001600160a01b03881660009081526002602052604090205460ff161561046857341561046357604051634dc2c71160e01b81523460048201526024015b60405180910390fd5b6104fa565b60ff8616600090815260016020908152604080832088845290915290819020549051632530706560e01b81526001600160a01b0390911690819063253070659034906104c6908d908d908d908d908d908d908d908d90600401610e66565b6000604051808303818588803b1580156104df57600080fd5b505af11580156104f3573d6000803e3d6000fd5b5050505050505b5050505050505050565b6000828152602081905260409020600201546105209033610656565b6105845760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526e0818591b5a5b881d1bc819dc985b9d608a1b606482015260840161045a565b61058e8282610934565b5050565b6001600160a01b03811633146106025760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161045a565b61058e828261098d565b6000828152602081815260408083206001600160a01b03851684526001019091529020545b92915050565b600082815260208190526040812061064f90836109e6565b9392505050565b600082815260208190526040812061064f90836109f2565b600081815260208190526040812061063190610a14565b6000828152602081905260409020600201546106a19033610656565b6106025760405162461bcd60e51b815260206004820152603060248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526f2061646d696e20746f207265766f6b6560801b606482015260840161045a565b6001600160a01b038816600090815260026020526040812054819060ff1615610734575060009050806107d6565b60ff881660009081526001602090815260408083208a84529091529081902054905163ef4f081f60e01b81526001600160a01b0390911690819063ef4f081f90610790908e908e908e908e908e908e908e908e90600401610e66565b6040805180830381865afa1580156107ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d09190610ec2565b92509250505b9850989650505050505050565b6107eb610863565b6001600160a01b038216600081815260026020908152604091829020805460ff19168515159081179091558251938452908301527fb840a1dbd8b09a3dc45161bba92dfb9aba643c0e44c085a447f839d1d02cf13b910160405180910390a15050565b600061064f836001600160a01b038416610a1e565b61086e600033610656565b6108ba5760405162461bcd60e51b815260206004820152601e60248201527f73656e64657220646f65736e277420686176652061646d696e20726f6c650000604482015260640161045a565b565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108ba5760405162461bcd60e51b815260206004820152601e60248201527f73656e646572206d7573742062652062726964676520636f6e74726163740000604482015260640161045a565b600082815260208190526040902061094c908261084e565b1561058e5760405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b60008281526020819052604090206109a59082610a6d565b1561058e5760405133906001600160a01b0383169084907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90600090a45050565b600061064f8383610a82565b6001600160a01b0381166000908152600183016020526040812054151561064f565b6000610631825490565b6000818152600183016020526040812054610a6557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610631565b506000610631565b600061064f836001600160a01b038416610aac565b6000826000018281548110610a9957610a99610ee7565b9060005260206000200154905092915050565b60008181526001830160205260408120548015610b95576000610ad0600183610efd565b8554909150600090610ae490600190610efd565b9050818114610b49576000866000018281548110610b0457610b04610ee7565b9060005260206000200154905080876000018481548110610b2757610b27610ee7565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610b5a57610b5a610f22565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610631565b6000915050610631565b803560ff81168114610bb057600080fd5b919050565b6001600160a01b0381168114610bca57600080fd5b50565b600080600060608486031215610be257600080fd5b610beb84610b9f565b9250602084013591506040840135610c0281610bb5565b809150509250925092565b600060208284031215610c1f57600080fd5b5035919050565b60008083601f840112610c3857600080fd5b50813567ffffffffffffffff811115610c5057600080fd5b602083019150836020828501011115610c6857600080fd5b9250929050565b60008060008060008060008060c0898b031215610c8b57600080fd5b8835610c9681610bb5565b9750610ca460208a01610b9f565b9650610cb260408a01610b9f565b955060608901359450608089013567ffffffffffffffff80821115610cd657600080fd5b610ce28c838d01610c26565b909650945060a08b0135915080821115610cfb57600080fd5b50610d088b828c01610c26565b999c989b5096995094979396929594505050565b60008060408385031215610d2f57600080fd5b823591506020830135610d4181610bb5565b809150509250929050565b60008060408385031215610d5f57600080fd5b610d6883610b9f565b946020939093013593505050565b600060208083528351808285015260005b81811015610da357858101830151858201604001528201610d87565b81811115610db5576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215610dde57600080fd5b50508035926020909101359150565b600060208284031215610dff57600080fd5b813561064f81610bb5565b60008060408385031215610e1d57600080fd5b8235610e2881610bb5565b915060208301358015158114610d4157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60018060a01b038916815260ff8816602082015260ff8716604082015285606082015260c060808201526000610ea060c083018688610e3d565b82810360a0840152610eb3818587610e3d565b9b9a5050505050505050505050565b60008060408385031215610ed557600080fd5b825191506020830151610d4181610bb5565b634e487b7160e01b600052603260045260246000fd5b600082821015610f1d57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052603160045260246000fdfea264697066735822122032b25456820c885697ed572a5a91f87fde40764f24914a12610adf55a201d3e864736f6c634300080b0033000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb
6080604052600436106100fe5760003560e01c8063542774b511610095578063ca15c87311610064578063ca15c87314610302578063cfdb63ac14610322578063d547741f14610352578063ef4f081f14610372578063f1382b26146103af57600080fd5b8063542774b5146102685780639010d07c1461029d57806391d14854146102bd578063a217fddf146102ed57600080fd5b8063318c136e116100d1578063318c136e1461019b57806336568abe146101e75780633d94ebc6146102075780634e0df3f61461024857600080fd5b80631af5fe3814610103578063248a9ca31461012557806325307065146101685780632f2ff15d1461017b575b600080fd5b34801561010f57600080fd5b5061012361011e366004610bcd565b6103cf565b005b34801561013157600080fd5b50610155610140366004610c0d565b60009081526020819052604090206002015490565b6040519081526020015b60405180910390f35b610123610176366004610c6f565b610414565b34801561018757600080fd5b50610123610196366004610d1c565b610504565b3480156101a757600080fd5b506101cf7f000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb81565b6040516001600160a01b03909116815260200161015f565b3480156101f357600080fd5b50610123610202366004610d1c565b610592565b34801561021357600080fd5b506101cf610222366004610d4c565b60016020908152600092835260408084209091529082529020546001600160a01b031681565b34801561025457600080fd5b50610155610263366004610d1c565b61060c565b34801561027457600080fd5b5060408051808201825260068152653937baba32b960d11b6020820152905161015f9190610d76565b3480156102a957600080fd5b506101cf6102b8366004610dcb565b610637565b3480156102c957600080fd5b506102dd6102d8366004610d1c565b610656565b604051901515815260200161015f565b3480156102f957600080fd5b50610155600081565b34801561030e57600080fd5b5061015561031d366004610c0d565b61066e565b34801561032e57600080fd5b506102dd61033d366004610ded565b60026020526000908152604090205460ff1681565b34801561035e57600080fd5b5061012361036d366004610d1c565b610685565b34801561037e57600080fd5b5061039261038d366004610c6f565b610706565b604080519283526001600160a01b0390911660208301520161015f565b3480156103bb57600080fd5b506101236103ca366004610e0a565b6107e3565b6103d7610863565b60ff9290921660009081526001602090815260408083209383529290522080546001600160a01b0319166001600160a01b03909216919091179055565b61041c6108bc565b6001600160a01b03881660009081526002602052604090205460ff161561046857341561046357604051634dc2c71160e01b81523460048201526024015b60405180910390fd5b6104fa565b60ff8616600090815260016020908152604080832088845290915290819020549051632530706560e01b81526001600160a01b0390911690819063253070659034906104c6908d908d908d908d908d908d908d908d90600401610e66565b6000604051808303818588803b1580156104df57600080fd5b505af11580156104f3573d6000803e3d6000fd5b5050505050505b5050505050505050565b6000828152602081905260409020600201546105209033610656565b6105845760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526e0818591b5a5b881d1bc819dc985b9d608a1b606482015260840161045a565b61058e8282610934565b5050565b6001600160a01b03811633146106025760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161045a565b61058e828261098d565b6000828152602081815260408083206001600160a01b03851684526001019091529020545b92915050565b600082815260208190526040812061064f90836109e6565b9392505050565b600082815260208190526040812061064f90836109f2565b600081815260208190526040812061063190610a14565b6000828152602081905260409020600201546106a19033610656565b6106025760405162461bcd60e51b815260206004820152603060248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526f2061646d696e20746f207265766f6b6560801b606482015260840161045a565b6001600160a01b038816600090815260026020526040812054819060ff1615610734575060009050806107d6565b60ff881660009081526001602090815260408083208a84529091529081902054905163ef4f081f60e01b81526001600160a01b0390911690819063ef4f081f90610790908e908e908e908e908e908e908e908e90600401610e66565b6040805180830381865afa1580156107ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d09190610ec2565b92509250505b9850989650505050505050565b6107eb610863565b6001600160a01b038216600081815260026020908152604091829020805460ff19168515159081179091558251938452908301527fb840a1dbd8b09a3dc45161bba92dfb9aba643c0e44c085a447f839d1d02cf13b910160405180910390a15050565b600061064f836001600160a01b038416610a1e565b61086e600033610656565b6108ba5760405162461bcd60e51b815260206004820152601e60248201527f73656e64657220646f65736e277420686176652061646d696e20726f6c650000604482015260640161045a565b565b336001600160a01b037f000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb16146108ba5760405162461bcd60e51b815260206004820152601e60248201527f73656e646572206d7573742062652062726964676520636f6e74726163740000604482015260640161045a565b600082815260208190526040902061094c908261084e565b1561058e5760405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b60008281526020819052604090206109a59082610a6d565b1561058e5760405133906001600160a01b0383169084907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90600090a45050565b600061064f8383610a82565b6001600160a01b0381166000908152600183016020526040812054151561064f565b6000610631825490565b6000818152600183016020526040812054610a6557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610631565b506000610631565b600061064f836001600160a01b038416610aac565b6000826000018281548110610a9957610a99610ee7565b9060005260206000200154905092915050565b60008181526001830160205260408120548015610b95576000610ad0600183610efd565b8554909150600090610ae490600190610efd565b9050818114610b49576000866000018281548110610b0457610b04610ee7565b9060005260206000200154905080876000018481548110610b2757610b27610ee7565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610b5a57610b5a610f22565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610631565b6000915050610631565b803560ff81168114610bb057600080fd5b919050565b6001600160a01b0381168114610bca57600080fd5b50565b600080600060608486031215610be257600080fd5b610beb84610b9f565b9250602084013591506040840135610c0281610bb5565b809150509250925092565b600060208284031215610c1f57600080fd5b5035919050565b60008083601f840112610c3857600080fd5b50813567ffffffffffffffff811115610c5057600080fd5b602083019150836020828501011115610c6857600080fd5b9250929050565b60008060008060008060008060c0898b031215610c8b57600080fd5b8835610c9681610bb5565b9750610ca460208a01610b9f565b9650610cb260408a01610b9f565b955060608901359450608089013567ffffffffffffffff80821115610cd657600080fd5b610ce28c838d01610c26565b909650945060a08b0135915080821115610cfb57600080fd5b50610d088b828c01610c26565b999c989b5096995094979396929594505050565b60008060408385031215610d2f57600080fd5b823591506020830135610d4181610bb5565b809150509250929050565b60008060408385031215610d5f57600080fd5b610d6883610b9f565b946020939093013593505050565b600060208083528351808285015260005b81811015610da357858101830151858201604001528201610d87565b81811115610db5576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215610dde57600080fd5b50508035926020909101359150565b600060208284031215610dff57600080fd5b813561064f81610bb5565b60008060408385031215610e1d57600080fd5b8235610e2881610bb5565b915060208301358015158114610d4157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60018060a01b038916815260ff8816602082015260ff8716604082015285606082015260c060808201526000610ea060c083018688610e3d565b82810360a0840152610eb3818587610e3d565b9b9a5050505050505050505050565b60008060408385031215610ed557600080fd5b825191506020830151610d4181610bb5565b634e487b7160e01b600052603260045260246000fd5b600082821015610f1d57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052603160045260246000fdfea264697066735822122032b25456820c885697ed572a5a91f87fde40764f24914a12610adf55a201d3e864736f6c634300080b0033
1
20,291,024
fe0e85a4508b59e28c500c87b2c10c8e97dff6796bf2c760ed22298c38a650b2
858bad9331055c63d66972ff43b28d863939ea92c41cc78c046df92931a99eb7
69f80347143f81267d291e62f8e5d0edbc32b1ab
f3cd1e9326d1965935b287b1ee75c7183359a88a
3db290a5bed4a082adabd77109a864f6564545f3
608060405234801561001057600080fd5b50604080518082018252600f81526e54686520576172204d616368696e6560881b6020808301919091528251808401909352600383526254574d60e81b908301529061007d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd6101f1565b6000805160206104018339815191521461009957610099610218565b735133522ea5a0494ecb83f26311a095ddd7a9d4b66100d260008051602061040183398151915260001b6101ee60201b6100ce1760201c565b80546001600160a01b0319166001600160a01b0392909216919091179055604051600090735133522ea5a0494ecb83f26311a095ddd7a9d4b69061011c908590859060240161027e565b60408051601f198184030181529181526020820180516001600160e01b031663266c45bb60e11b1790525161015191906102ac565b600060405180830381855af49150503d806000811461018c576040519150601f19603f3d011682016040523d82523d6000602084013e610191565b606091505b50509050806101e65760405162461bcd60e51b815260206004820152601560248201527f496e697469616c697a6174696f6e206661696c65640000000000000000000000604482015260640160405180910390fd5b5050506102c8565b90565b8181038181111561021257634e487b7160e01b600052601160045260246000fd5b92915050565b634e487b7160e01b600052600160045260246000fd5b60005b83811015610249578181015183820152602001610231565b50506000910152565b6000815180845261026a81602086016020860161022e565b601f01601f19169290920160200192915050565b6040815260006102916040830185610252565b82810360208401526102a38185610252565b95945050505050565b600082516102be81846020870161022e565b9190910192915050565b61012a806102d76000396000f3fe608060405260043610601f5760003560e01c80635c60da1b14603157602b565b36602b576029605f565b005b6029605f565b348015603c57600080fd5b5060436097565b6040516001600160a01b03909116815260200160405180910390f35b609560917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b60d1565b565b600060c97f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b90565b3660008037600080366000845af43d6000803e80801560ef573d6000f35b3d6000fdfea2646970667358221220b7d9f9c49f54e0ca7ec00993fc68f53da46f1bee49ba75ac1d93fabae0e5d1e464736f6c63430008110033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc
608060405260043610601f5760003560e01c80635c60da1b14603157602b565b36602b576029605f565b005b6029605f565b348015603c57600080fd5b5060436097565b6040516001600160a01b03909116815260200160405180910390f35b609560917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b60d1565b565b600060c97f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b90565b3660008037600080366000845af43d6000803e80801560ef573d6000f35b3d6000fdfea2646970667358221220b7d9f9c49f54e0ca7ec00993fc68f53da46f1bee49ba75ac1d93fabae0e5d1e464736f6c63430008110033
{{ "language": "Solidity", "sources": { "contracts/TWM.sol": { "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/// @title: The War Machine\n/// @author: manifold.xyz\n\nimport \"./manifold/ERC721Creator.sol\";\n\n///////////////////////////\n// //\n// //\n// The War Machine //\n// //\n// //\n// //\n///////////////////////////\n\n\ncontract TWM is ERC721Creator {\n constructor() ERC721Creator(\"The War Machine\", \"TWM\") {}\n}\n" }, "contracts/manifold/ERC721Creator.sol": { "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/// @author: manifold.xyz\n\nimport \"@openzeppelin/contracts/proxy/Proxy.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/StorageSlot.sol\";\n\ncontract ERC721Creator is Proxy {\n \n constructor(string memory name, string memory symbol) {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = 0x5133522ea5A0494EcB83F26311A095DDD7a9D4b6;\n (bool success, ) = 0x5133522ea5A0494EcB83F26311A095DDD7a9D4b6.delegatecall(abi.encodeWithSignature(\"initialize(string,string)\", name, symbol));\n require(success, \"Initialization failed\");\n }\n \n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view returns (address) {\n return _implementation();\n }\n\n function _implementation() internal override view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n } \n\n}\n" }, "node_modules/@openzeppelin/contracts/proxy/Proxy.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" }, "node_modules/@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" }, "node_modules/@openzeppelin/contracts/utils/StorageSlot.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n}\n" } }, "settings": { "remappings": [ "@openzeppelin/=node_modules/@openzeppelin/" ], "optimizer": { "enabled": true, "runs": 300 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} } }}
1
20,291,024
fe0e85a4508b59e28c500c87b2c10c8e97dff6796bf2c760ed22298c38a650b2
eb99d5bb1f4cf9ac16b13928bdfbd522d2bf3b31a2e0764cbc381c6e6932473f
c5533be6e51460c47e2e6ee214ca70d3678dd417
c5533be6e51460c47e2e6ee214ca70d3678dd417
cbffed632a6c8719e50ff7e0293a63c98841fab5
60c06040523480156200001157600080fd5b506040516200137038038062001370833981016040819052620000349162000162565b6001600160a01b03808316608052811660a052620000546000336200005c565b50506200019a565b6200006882826200006c565b5050565b6000828152602081815260409091206200009191839062000aa7620000d3821b17901c565b15620000685760405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b6000620000ea836001600160a01b038416620000f3565b90505b92915050565b60008181526001830160205260408120546200013c57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620000ed565b506000620000ed565b80516001600160a01b03811681146200015d57600080fd5b919050565b600080604083850312156200017657600080fd5b620001818362000145565b9150620001916020840162000145565b90509250929050565b60805160a0516111a2620001ce600039600081816102b00152610af90152600081816101980152610ac701526111a26000f3fe6080604052600436106101095760003560e01c8063745e6b6111610095578063a217fddf11610064578063a217fddf14610342578063abc9db0b14610357578063ca15c87314610377578063d547741f14610397578063ef4f081f146103b757600080fd5b8063745e6b611461029e5780639010d07c146102d2578063904e9b2b146102f257806391d148541461031257600080fd5b806336568abe116100dc57806336568abe146101d25780634e0df3f6146101f2578063542774b5146102125780635e1fab0f14610246578063632d589c1461026657600080fd5b8063248a9ca31461010e57806325307065146101515780632f2ff15d14610166578063318c136e14610186575b600080fd5b34801561011a57600080fd5b5061013e610129366004610de9565b60009081526020819052604090206002015490565b6040519081526020015b60405180910390f35b61016461015f366004610e79565b61041b565b005b34801561017257600080fd5b50610164610181366004610f26565b6104d4565b34801561019257600080fd5b506101ba7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610148565b3480156101de57600080fd5b506101646101ed366004610f26565b610562565b3480156101fe57600080fd5b5061013e61020d366004610f26565b6105dc565b34801561021e57600080fd5b506040805180820182526005815264626173696360d81b602082015290516101489190610f56565b34801561025257600080fd5b50610164610261366004610fab565b610607565b34801561027257600080fd5b5061013e610281366004610fc8565b600160209081526000928352604080842090915290825290205481565b3480156102aa57600080fd5b506101ba7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102de57600080fd5b506101ba6102ed366004610ff2565b610677565b3480156102fe57600080fd5b5061016461030d366004611059565b610696565b34801561031e57600080fd5b5061033261032d366004610f26565b6108db565b6040519015158152602001610148565b34801561034e57600080fd5b5061013e600081565b34801561036357600080fd5b506101646103723660046110c5565b6108f3565b34801561038357600080fd5b5061013e610392366004610de9565b610a0f565b3480156103a357600080fd5b506101646103b2366004610f26565b610a26565b3480156103c357600080fd5b506103fe6103d2366004610e79565b60ff86166000908152600160209081526040808320888452909152812054909850989650505050505050565b604080519283526001600160a01b03909116602083015201610148565b610423610abc565b60ff8616600090815260016020908152604080832088845290915290205434811461046857604051634dc2c71160e01b81523460048201526024015b60405180910390fd5b604080516001600160a01b038b16815260ff8a811660208301528916818301526060810188905260808101839052600060a082015290517fbd231b7fa4103e15e7a238c72f07e8aff310701af121895aa6c793b80245e4339181900360c00190a1505050505050505050565b6000828152602081905260409020600201546104f090336108db565b6105545760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526e0818591b5a5b881d1bc819dc985b9d608a1b606482015260840161045f565b61055e8282610b7e565b5050565b6001600160a01b03811633146105d25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161045f565b61055e8282610bd7565b6000828152602081815260408083206001600160a01b03851684526001019091529020545b92915050565b336001600160a01b0382168114156106615760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f742072656e6f756e6365206f6e6573656c66000000000000000000604482015260640161045f565b61066c6000836104d4565b61055e600082610562565b600082815260208190526040812061068f9083610c30565b9392505050565b6106a16000336108db565b6106ed5760405162461bcd60e51b815260206004820152601e60248201527f73656e64657220646f65736e277420686176652061646d696e20726f6c650000604482015260640161045f565b82811461073c5760405162461bcd60e51b815260206004820152601f60248201527f61646472735b5d2c20616d6f756e74735b5d3a2064696666206c656e67746800604482015260640161045f565b60005b838110156108d457600085858381811061075b5761075b6110f8565b90506020020160208101906107709190610fab565b6001600160a01b031684848481811061078b5761078b6110f8565b9050602002013560405160006040518083038185875af1925050503d80600081146107d2576040519150601f19603f3d011682016040523d82523d6000602084013e6107d7565b606091505b50509050806108285760405162461bcd60e51b815260206004820152601960248201527f466565206574686572207472616e73666572206661696c656400000000000000604482015260640161045f565b7faaa40a232aaf133fdd28f3485f6fdd163514cfadbffa981f3610f42398efe34b600087878581811061085d5761085d6110f8565b90506020020160208101906108729190610fab565b868686818110610884576108846110f8565b905060200201356040516108b9939291906001600160a01b039384168152919092166020820152604081019190915260600190565b60405180910390a150806108cc81611124565b91505061073f565b5050505050565b600082815260208190526040812061068f9083610c3c565b6108fe6000336108db565b61094a5760405162461bcd60e51b815260206004820152601e60248201527f73656e64657220646f65736e277420686176652061646d696e20726f6c650000604482015260640161045f565b60ff83166000908152600160209081526040808320858452909152902054818114156109b85760405162461bcd60e51b815260206004820152601f60248201527f43757272656e742066656520697320657175616c20746f206e65772066656500604482015260640161045f565b60ff8416600090815260016020908152604080832086845282529182902084905590518381527f6bbc57480a46553fa4d156ce702beef5f3ad66303b0ed1a5d4cb44966c6584c3910160405180910390a150505050565b600081815260208190526040812061060190610c5e565b600082815260208190526040902060020154610a4290336108db565b6105d25760405162461bcd60e51b815260206004820152603060248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526f2061646d696e20746f207265766f6b6560801b606482015260840161045f565b600061068f836001600160a01b038416610c68565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610b1b5750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b610b7c5760405162461bcd60e51b815260206004820152602c60248201527f73656e646572206d75737420626520627269646765206f722066656520726f7560448201526b1d195c8818dbdb9d1c9858dd60a21b606482015260840161045f565b565b6000828152602081905260409020610b969082610aa7565b1561055e5760405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b6000828152602081905260409020610bef9082610cb7565b1561055e5760405133906001600160a01b0383169084907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90600090a45050565b600061068f8383610ccc565b6001600160a01b0381166000908152600183016020526040812054151561068f565b6000610601825490565b6000818152600183016020526040812054610caf57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610601565b506000610601565b600061068f836001600160a01b038416610cf6565b6000826000018281548110610ce357610ce36110f8565b9060005260206000200154905092915050565b60008181526001830160205260408120548015610ddf576000610d1a60018361113f565b8554909150600090610d2e9060019061113f565b9050818114610d93576000866000018281548110610d4e57610d4e6110f8565b9060005260206000200154905080876000018481548110610d7157610d716110f8565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610da457610da4611156565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610601565b6000915050610601565b600060208284031215610dfb57600080fd5b5035919050565b6001600160a01b0381168114610e1757600080fd5b50565b803560ff81168114610e2b57600080fd5b919050565b60008083601f840112610e4257600080fd5b50813567ffffffffffffffff811115610e5a57600080fd5b602083019150836020828501011115610e7257600080fd5b9250929050565b60008060008060008060008060c0898b031215610e9557600080fd5b8835610ea081610e02565b9750610eae60208a01610e1a565b9650610ebc60408a01610e1a565b955060608901359450608089013567ffffffffffffffff80821115610ee057600080fd5b610eec8c838d01610e30565b909650945060a08b0135915080821115610f0557600080fd5b50610f128b828c01610e30565b999c989b5096995094979396929594505050565b60008060408385031215610f3957600080fd5b823591506020830135610f4b81610e02565b809150509250929050565b600060208083528351808285015260005b81811015610f8357858101830151858201604001528201610f67565b81811115610f95576000604083870101525b50601f01601f1916929092016040019392505050565b600060208284031215610fbd57600080fd5b813561068f81610e02565b60008060408385031215610fdb57600080fd5b610fe483610e1a565b946020939093013593505050565b6000806040838503121561100557600080fd5b50508035926020909101359150565b60008083601f84011261102657600080fd5b50813567ffffffffffffffff81111561103e57600080fd5b6020830191508360208260051b8501011115610e7257600080fd5b6000806000806040858703121561106f57600080fd5b843567ffffffffffffffff8082111561108757600080fd5b61109388838901611014565b909650945060208701359150808211156110ac57600080fd5b506110b987828801611014565b95989497509550505050565b6000806000606084860312156110da57600080fd5b6110e384610e1a565b95602085013595506040909401359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156111385761113861110e565b5060010190565b6000828210156111515761115161110e565b500390565b634e487b7160e01b600052603160045260246000fdfea26469706673582212200d0b9ad277a8c575ab7ed2c2a500449fb8997ee0d4b27724ae78e3fc074a661964736f6c634300080b0033000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb000000000000000000000000fd76546031d444eadb3b749919490dde3974027b
6080604052600436106101095760003560e01c8063745e6b6111610095578063a217fddf11610064578063a217fddf14610342578063abc9db0b14610357578063ca15c87314610377578063d547741f14610397578063ef4f081f146103b757600080fd5b8063745e6b611461029e5780639010d07c146102d2578063904e9b2b146102f257806391d148541461031257600080fd5b806336568abe116100dc57806336568abe146101d25780634e0df3f6146101f2578063542774b5146102125780635e1fab0f14610246578063632d589c1461026657600080fd5b8063248a9ca31461010e57806325307065146101515780632f2ff15d14610166578063318c136e14610186575b600080fd5b34801561011a57600080fd5b5061013e610129366004610de9565b60009081526020819052604090206002015490565b6040519081526020015b60405180910390f35b61016461015f366004610e79565b61041b565b005b34801561017257600080fd5b50610164610181366004610f26565b6104d4565b34801561019257600080fd5b506101ba7f000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb81565b6040516001600160a01b039091168152602001610148565b3480156101de57600080fd5b506101646101ed366004610f26565b610562565b3480156101fe57600080fd5b5061013e61020d366004610f26565b6105dc565b34801561021e57600080fd5b506040805180820182526005815264626173696360d81b602082015290516101489190610f56565b34801561025257600080fd5b50610164610261366004610fab565b610607565b34801561027257600080fd5b5061013e610281366004610fc8565b600160209081526000928352604080842090915290825290205481565b3480156102aa57600080fd5b506101ba7f000000000000000000000000fd76546031d444eadb3b749919490dde3974027b81565b3480156102de57600080fd5b506101ba6102ed366004610ff2565b610677565b3480156102fe57600080fd5b5061016461030d366004611059565b610696565b34801561031e57600080fd5b5061033261032d366004610f26565b6108db565b6040519015158152602001610148565b34801561034e57600080fd5b5061013e600081565b34801561036357600080fd5b506101646103723660046110c5565b6108f3565b34801561038357600080fd5b5061013e610392366004610de9565b610a0f565b3480156103a357600080fd5b506101646103b2366004610f26565b610a26565b3480156103c357600080fd5b506103fe6103d2366004610e79565b60ff86166000908152600160209081526040808320888452909152812054909850989650505050505050565b604080519283526001600160a01b03909116602083015201610148565b610423610abc565b60ff8616600090815260016020908152604080832088845290915290205434811461046857604051634dc2c71160e01b81523460048201526024015b60405180910390fd5b604080516001600160a01b038b16815260ff8a811660208301528916818301526060810188905260808101839052600060a082015290517fbd231b7fa4103e15e7a238c72f07e8aff310701af121895aa6c793b80245e4339181900360c00190a1505050505050505050565b6000828152602081905260409020600201546104f090336108db565b6105545760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526e0818591b5a5b881d1bc819dc985b9d608a1b606482015260840161045f565b61055e8282610b7e565b5050565b6001600160a01b03811633146105d25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161045f565b61055e8282610bd7565b6000828152602081815260408083206001600160a01b03851684526001019091529020545b92915050565b336001600160a01b0382168114156106615760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f742072656e6f756e6365206f6e6573656c66000000000000000000604482015260640161045f565b61066c6000836104d4565b61055e600082610562565b600082815260208190526040812061068f9083610c30565b9392505050565b6106a16000336108db565b6106ed5760405162461bcd60e51b815260206004820152601e60248201527f73656e64657220646f65736e277420686176652061646d696e20726f6c650000604482015260640161045f565b82811461073c5760405162461bcd60e51b815260206004820152601f60248201527f61646472735b5d2c20616d6f756e74735b5d3a2064696666206c656e67746800604482015260640161045f565b60005b838110156108d457600085858381811061075b5761075b6110f8565b90506020020160208101906107709190610fab565b6001600160a01b031684848481811061078b5761078b6110f8565b9050602002013560405160006040518083038185875af1925050503d80600081146107d2576040519150601f19603f3d011682016040523d82523d6000602084013e6107d7565b606091505b50509050806108285760405162461bcd60e51b815260206004820152601960248201527f466565206574686572207472616e73666572206661696c656400000000000000604482015260640161045f565b7faaa40a232aaf133fdd28f3485f6fdd163514cfadbffa981f3610f42398efe34b600087878581811061085d5761085d6110f8565b90506020020160208101906108729190610fab565b868686818110610884576108846110f8565b905060200201356040516108b9939291906001600160a01b039384168152919092166020820152604081019190915260600190565b60405180910390a150806108cc81611124565b91505061073f565b5050505050565b600082815260208190526040812061068f9083610c3c565b6108fe6000336108db565b61094a5760405162461bcd60e51b815260206004820152601e60248201527f73656e64657220646f65736e277420686176652061646d696e20726f6c650000604482015260640161045f565b60ff83166000908152600160209081526040808320858452909152902054818114156109b85760405162461bcd60e51b815260206004820152601f60248201527f43757272656e742066656520697320657175616c20746f206e65772066656500604482015260640161045f565b60ff8416600090815260016020908152604080832086845282529182902084905590518381527f6bbc57480a46553fa4d156ce702beef5f3ad66303b0ed1a5d4cb44966c6584c3910160405180910390a150505050565b600081815260208190526040812061060190610c5e565b600082815260208190526040902060020154610a4290336108db565b6105d25760405162461bcd60e51b815260206004820152603060248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526f2061646d696e20746f207265766f6b6560801b606482015260840161045f565b600061068f836001600160a01b038416610c68565b336001600160a01b037f000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb161480610b1b5750336001600160a01b037f000000000000000000000000fd76546031d444eadb3b749919490dde3974027b16145b610b7c5760405162461bcd60e51b815260206004820152602c60248201527f73656e646572206d75737420626520627269646765206f722066656520726f7560448201526b1d195c8818dbdb9d1c9858dd60a21b606482015260840161045f565b565b6000828152602081905260409020610b969082610aa7565b1561055e5760405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b6000828152602081905260409020610bef9082610cb7565b1561055e5760405133906001600160a01b0383169084907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90600090a45050565b600061068f8383610ccc565b6001600160a01b0381166000908152600183016020526040812054151561068f565b6000610601825490565b6000818152600183016020526040812054610caf57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610601565b506000610601565b600061068f836001600160a01b038416610cf6565b6000826000018281548110610ce357610ce36110f8565b9060005260206000200154905092915050565b60008181526001830160205260408120548015610ddf576000610d1a60018361113f565b8554909150600090610d2e9060019061113f565b9050818114610d93576000866000018281548110610d4e57610d4e6110f8565b9060005260206000200154905080876000018481548110610d7157610d716110f8565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610da457610da4611156565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610601565b6000915050610601565b600060208284031215610dfb57600080fd5b5035919050565b6001600160a01b0381168114610e1757600080fd5b50565b803560ff81168114610e2b57600080fd5b919050565b60008083601f840112610e4257600080fd5b50813567ffffffffffffffff811115610e5a57600080fd5b602083019150836020828501011115610e7257600080fd5b9250929050565b60008060008060008060008060c0898b031215610e9557600080fd5b8835610ea081610e02565b9750610eae60208a01610e1a565b9650610ebc60408a01610e1a565b955060608901359450608089013567ffffffffffffffff80821115610ee057600080fd5b610eec8c838d01610e30565b909650945060a08b0135915080821115610f0557600080fd5b50610f128b828c01610e30565b999c989b5096995094979396929594505050565b60008060408385031215610f3957600080fd5b823591506020830135610f4b81610e02565b809150509250929050565b600060208083528351808285015260005b81811015610f8357858101830151858201604001528201610f67565b81811115610f95576000604083870101525b50601f01601f1916929092016040019392505050565b600060208284031215610fbd57600080fd5b813561068f81610e02565b60008060408385031215610fdb57600080fd5b610fe483610e1a565b946020939093013593505050565b6000806040838503121561100557600080fd5b50508035926020909101359150565b60008083601f84011261102657600080fd5b50813567ffffffffffffffff81111561103e57600080fd5b6020830191508360208260051b8501011115610e7257600080fd5b6000806000806040858703121561106f57600080fd5b843567ffffffffffffffff8082111561108757600080fd5b61109388838901611014565b909650945060208701359150808211156110ac57600080fd5b506110b987828801611014565b95989497509550505050565b6000806000606084860312156110da57600080fd5b6110e384610e1a565b95602085013595506040909401359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156111385761113861110e565b5060010190565b6000828210156111515761115161110e565b500390565b634e487b7160e01b600052603160045260246000fdfea26469706673582212200d0b9ad277a8c575ab7ed2c2a500449fb8997ee0d4b27724ae78e3fc074a661964736f6c634300080b0033
1
20,291,025
5a05824ef6cabd2908cb90657ad460d417ece2e1e4402b5e1752f2ea8fd17bb0
b05d0768e6f933491e45b32c611269b90d7509141f5cc37abcf8ae6833c77d11
c5533be6e51460c47e2e6ee214ca70d3678dd417
c5533be6e51460c47e2e6ee214ca70d3678dd417
0b79b5794687afcd2821d4995e06651bb574ffd3
60c06040523480156200001157600080fd5b5060405162001e8238038062001e82833981016040819052620000349162000166565b6001600160a01b03808316608052811660a05281816200005660003362000060565b505050506200019e565b6200006c828262000070565b5050565b6000828152602081815260409091206200009591839062000ff5620000d7821b17901c565b156200006c5760405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b6000620000ee836001600160a01b038416620000f7565b90505b92915050565b60008181526001830160205260408120546200014057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620000f1565b506000620000f1565b80516001600160a01b03811681146200016157600080fd5b919050565b600080604083850312156200017a57600080fd5b620001858362000149565b9150620001956020840162000149565b90509250929050565b60805160a051611ca2620001e06000396000818161030e01526110470152600081816101c401528181610b600152818161101501526110d30152611ca26000f3fe6080604052600436106101355760003560e01c8063769d4643116100ab578063abc9db0b1161006f578063abc9db0b14610416578063ca15c87314610436578063d48f953414610456578063d4e6bc9614610476578063d547741f14610496578063ef4f081f146104b657600080fd5b8063769d4643146103305780639010d07c14610391578063904e9b2b146103b157806391d14854146103d1578063a217fddf1461040157600080fd5b80634e0df3f6116100fd5780634e0df3f61461021e578063542774b51461023e5780635e1fab0f14610277578063632d589c146102975780636ed93dd0146102cf578063745e6b61146102fc57600080fd5b8063248a9ca31461013a578063253070651461017d5780632f2ff15d14610192578063318c136e146101b257806336568abe146101fe575b600080fd5b34801561014657600080fd5b5061016a61015536600461173f565b60009081526020819052604090206002015490565b6040519081526020015b60405180910390f35b61019061018b3660046117cf565b6104f3565b005b34801561019e57600080fd5b506101906101ad36600461187c565b6105df565b3480156101be57600080fd5b506101e67f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610174565b34801561020a57600080fd5b5061019061021936600461187c565b61066d565b34801561022a57600080fd5b5061016a61023936600461187c565b6106e7565b34801561024a57600080fd5b50604080518082018252600a81526970657263656e7461676560b01b6020820152905161017491906118d8565b34801561028357600080fd5b5061019061029236600461190b565b610712565b3480156102a357600080fd5b5061016a6102b2366004611928565b600160209081526000928352604080842090915290825290205481565b3480156102db57600080fd5b506102e76305f5e10081565b60405163ffffffff9091168152602001610174565b34801561030857600080fd5b506101e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561033c57600080fd5b5061037161034b36600461173f565b6002602052600090815260409020546001600160801b0380821691600160801b90041682565b604080516001600160801b03938416815292909116602083015201610174565b34801561039d57600080fd5b506101e66103ac366004611952565b610782565b3480156103bd57600080fd5b506101906103cc3660046119b9565b6107a1565b3480156103dd57600080fd5b506103f16103ec36600461187c565b6109b6565b6040519015158152602001610174565b34801561040d57600080fd5b5061016a600081565b34801561042257600080fd5b50610190610431366004611a25565b6109ce565b34801561044257600080fd5b5061016a61045136600461173f565b610aba565b34801561046257600080fd5b50610190610471366004611a58565b610ad1565b34801561048257600080fd5b50610190610491366004611ae9565b610d4c565b3480156104a257600080fd5b506101906104b136600461187c565b610f50565b3480156104c257600080fd5b506104d66104d13660046117cf565b610fd1565b604080519283526001600160a01b03909116602083015201610174565b6104fb61100a565b341561054e5760405162461bcd60e51b815260206004820152601a60248201527f636f6c6c6563744665653a206d73672e76616c756520213d203000000000000060448201526064015b60405180910390fd5b6000806105618a8a8a8a8a8a8a8a6110cc565b91509150610571818b30856112c3565b604080516001600160a01b038c8116825260ff8c811660208401528b1682840152606082018a905260808201859052831660a082015290517fbd231b7fa4103e15e7a238c72f07e8aff310701af121895aa6c793b80245e4339181900360c00190a150505050505050505050565b6000828152602081905260409020600201546105fb90336109b6565b61065f5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526e0818591b5a5b881d1bc819dc985b9d608a1b6064820152608401610545565b61066982826112d0565b5050565b6001600160a01b03811633146106dd5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610545565b6106698282611329565b6000828152602081815260408083206001600160a01b03851684526001019091529020545b92915050565b336001600160a01b03821681141561076c5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f742072656e6f756e6365206f6e6573656c660000000000000000006044820152606401610545565b6107776000836105df565b61066960008261066d565b600082815260208190526040812061079a9083611382565b9392505050565b6107ac6000336109b6565b6107c85760405162461bcd60e51b815260040161054590611b25565b8281146108175760405162461bcd60e51b815260206004820152601f60248201527f61646472735b5d2c20616d6f756e74735b5d3a2064696666206c656e677468006044820152606401610545565b60005b838110156109af57600085858381811061083657610836611b5c565b905060200201602081019061084b919061190b565b6001600160a01b031684848481811061086657610866611b5c565b9050602002013560405160006040518083038185875af1925050503d80600081146108ad576040519150601f19603f3d011682016040523d82523d6000602084013e6108b2565b606091505b50509050806109035760405162461bcd60e51b815260206004820152601960248201527f466565206574686572207472616e73666572206661696c6564000000000000006044820152606401610545565b7faaa40a232aaf133fdd28f3485f6fdd163514cfadbffa981f3610f42398efe34b600087878581811061093857610938611b5c565b905060200201602081019061094d919061190b565b86868681811061095f5761095f611b5c565b90506020020135604051610994939291906001600160a01b039384168152919092166020820152604081019190915260600190565b60405180910390a150806109a781611b88565b91505061081a565b5050505050565b600082815260208190526040812061079a908361138e565b6109d96000336109b6565b6109f55760405162461bcd60e51b815260040161054590611b25565b60ff8316600090815260016020908152604080832085845290915290205481811415610a635760405162461bcd60e51b815260206004820152601f60248201527f43757272656e742066656520697320657175616c20746f206e657720666565006044820152606401610545565b60ff8416600090815260016020908152604080832086845282529182902084905590518381527f6bbc57480a46553fa4d156ce702beef5f3ad66303b0ed1a5d4cb44966c6584c3910160405180910390a150505050565b600081815260208190526040812061070c906113b0565b610adc6000336109b6565b610af85760405162461bcd60e51b815260040161054590611b25565b828114610b475760405162461bcd60e51b815260206004820152601f60248201527f61646472735b5d2c20616d6f756e74735b5d3a2064696666206c656e677468006044820152606401610545565b6040516384db809f60e01b8152600481018690526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906384db809f90602401602060405180830381865afa158015610baf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd39190611ba3565b60405163014daabb60e31b8152600481018890529091506000906001600160a01b03831690630a6d55d890602401602060405180830381865afa158015610c1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c429190611ba3565b905060005b85811015610d4257610c9882888884818110610c6557610c65611b5c565b9050602002016020810190610c7a919061190b565b878785818110610c8c57610c8c611b5c565b905060200201356113ba565b7faaa40a232aaf133fdd28f3485f6fdd163514cfadbffa981f3610f42398efe34b82888884818110610ccc57610ccc611b5c565b9050602002016020810190610ce1919061190b565b878785818110610cf357610cf3611b5c565b90506020020135604051610d28939291906001600160a01b039384168152919092166020820152604081019190915260600190565b60405180910390a180610d3a81611b88565b915050610c47565b5050505050505050565b610d576000336109b6565b610d735760405162461bcd60e51b815260040161054590611b25565b6001600160801b0381161580610d9a5750816001600160801b0316816001600160801b0316115b610dff5760405162461bcd60e51b815260206004820152603060248201527f557070657220626f756e64206d757374206265206c6172676572207468616e2060448201526f06c6f77657220626f756e64206f7220360841b6064820152608401610545565b6000838152600260209081526040918290208251808401909352546001600160801b03808216808552600160801b909204811692840192909252908416141580610e5f5750816001600160801b031681602001516001600160801b031614155b610eba5760405162461bcd60e51b815260206004820152602660248201527f43757272656e7420626f756e64732061726520657175616c20746f206e657720604482015265626f756e647360d01b6064820152608401610545565b6040805180820182526001600160801b038086168252848116602080840191825260008981526002909152849020835191518316600160801b029190921617905590517f25fb75f58179b90390cb00fe98bf5bdaa0e9d22f0e1f15bd3695c34c281647f890610f4190869086906001600160801b0392831681529116602082015260400190565b60405180910390a15050505050565b600082815260208190526040902060020154610f6c90336109b6565b6106dd5760405162461bcd60e51b815260206004820152603060248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526f2061646d696e20746f207265766f6b6560801b6064820152608401610545565b600080610fe48a8a8a8a8a8a8a8a6110cc565b915091509850989650505050505050565b600061079a836001600160a01b0384166113cc565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806110695750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b6110ca5760405162461bcd60e51b815260206004820152602c60248201527f73656e646572206d75737420626520627269646765206f722066656520726f7560448201526b1d195c8818dbdb9d1c9858dd60a21b6064820152608401610545565b565b60008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166384db809f896040518263ffffffff1660e01b815260040161111f91815260200190565b602060405180830381865afa15801561113c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111609190611ba3565b60405163014daabb60e31b8152600481018a90529091506001600160a01b03821690630a6d55d890602401602060405180830381865afa1580156111a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111cc9190611ba3565b60008981526002602090815260408083208151808301909252546001600160801b038082168352600160801b9091041691810191909152919350611212888a018a61173f565b60ff8c1660009081526001602090815260408083208e84529091529020549091506305f5e100906112439083611bc0565b61124d9190611bdf565b82519095506001600160801b03168510156112745781516001600160801b031694506112b3565b81602001516001600160801b03168511801561129d5750600082602001516001600160801b0316115b156112b35781602001516001600160801b031694505b5050509850989650505050505050565b836109af8185858561141b565b60008281526020819052604090206112e89082610ff5565b156106695760405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b60008281526020819052604090206113419082611486565b156106695760405133906001600160a01b0383169084907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90600090a45050565b600061079a838361149b565b6001600160a01b0381166000908152600183016020526040812054151561079a565b600061070c825490565b826113c68184846114c5565b50505050565b60008181526001830160205260408120546114135750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561070c565b50600061070c565b6040516001600160a01b03808516602483015283166044820152606481018290526113c69085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526114fa565b600061079a836001600160a01b03841661164c565b60008260000182815481106114b2576114b2611b5c565b9060005260206000200154905092915050565b6040516001600160a01b0383166024820152604481018290526114f590849063a9059cbb60e01b9060640161144f565b505050565b813b806115415760405162461bcd60e51b8152602060048201526015602482015274115490cc8c0e881b9bdd08184818dbdb9d1c9858dd605a1b6044820152606401610545565b600080846001600160a01b03168460405161155c9190611c01565b6000604051808303816000865af19150503d8060008114611599576040519150601f19603f3d011682016040523d82523d6000602084013e61159e565b606091505b5091509150816115e55760405162461bcd60e51b8152602060048201526012602482015271115490cc8c0e8818d85b1b0819985a5b195960721b6044820152606401610545565b8051156109af57808060200190518101906116009190611c1d565b6109af5760405162461bcd60e51b815260206004820181905260248201527f45524332303a206f7065726174696f6e20646964206e6f7420737563636565646044820152606401610545565b60008181526001830160205260408120548015611735576000611670600183611c3f565b855490915060009061168490600190611c3f565b90508181146116e95760008660000182815481106116a4576116a4611b5c565b90600052602060002001549050808760000184815481106116c7576116c7611b5c565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806116fa576116fa611c56565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061070c565b600091505061070c565b60006020828403121561175157600080fd5b5035919050565b6001600160a01b038116811461176d57600080fd5b50565b803560ff8116811461178157600080fd5b919050565b60008083601f84011261179857600080fd5b50813567ffffffffffffffff8111156117b057600080fd5b6020830191508360208285010111156117c857600080fd5b9250929050565b60008060008060008060008060c0898b0312156117eb57600080fd5b88356117f681611758565b975061180460208a01611770565b965061181260408a01611770565b955060608901359450608089013567ffffffffffffffff8082111561183657600080fd5b6118428c838d01611786565b909650945060a08b013591508082111561185b57600080fd5b506118688b828c01611786565b999c989b5096995094979396929594505050565b6000806040838503121561188f57600080fd5b8235915060208301356118a181611758565b809150509250929050565b60005b838110156118c75781810151838201526020016118af565b838111156113c65750506000910152565b60208152600082518060208401526118f78160408501602087016118ac565b601f01601f19169190910160400192915050565b60006020828403121561191d57600080fd5b813561079a81611758565b6000806040838503121561193b57600080fd5b61194483611770565b946020939093013593505050565b6000806040838503121561196557600080fd5b50508035926020909101359150565b60008083601f84011261198657600080fd5b50813567ffffffffffffffff81111561199e57600080fd5b6020830191508360208260051b85010111156117c857600080fd5b600080600080604085870312156119cf57600080fd5b843567ffffffffffffffff808211156119e757600080fd5b6119f388838901611974565b90965094506020870135915080821115611a0c57600080fd5b50611a1987828801611974565b95989497509550505050565b600080600060608486031215611a3a57600080fd5b611a4384611770565b95602085013595506040909401359392505050565b600080600080600060608688031215611a7057600080fd5b85359450602086013567ffffffffffffffff80821115611a8f57600080fd5b611a9b89838a01611974565b90965094506040880135915080821115611ab457600080fd5b50611ac188828901611974565b969995985093965092949392505050565b80356001600160801b038116811461178157600080fd5b600080600060608486031215611afe57600080fd5b83359250611b0e60208501611ad2565b9150611b1c60408501611ad2565b90509250925092565b6020808252601e908201527f73656e64657220646f65736e277420686176652061646d696e20726f6c650000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b9c57611b9c611b72565b5060010190565b600060208284031215611bb557600080fd5b815161079a81611758565b6000816000190483118215151615611bda57611bda611b72565b500290565b600082611bfc57634e487b7160e01b600052601260045260246000fd5b500490565b60008251611c138184602087016118ac565b9190910192915050565b600060208284031215611c2f57600080fd5b8151801515811461079a57600080fd5b600082821015611c5157611c51611b72565b500390565b634e487b7160e01b600052603160045260246000fdfea264697066735822122018d758dd7e179f39e691b8bd5ff5a7ae31924fecb82259e733403020ce490ed064736f6c634300080b0033000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb000000000000000000000000fd76546031d444eadb3b749919490dde3974027b
6080604052600436106101355760003560e01c8063769d4643116100ab578063abc9db0b1161006f578063abc9db0b14610416578063ca15c87314610436578063d48f953414610456578063d4e6bc9614610476578063d547741f14610496578063ef4f081f146104b657600080fd5b8063769d4643146103305780639010d07c14610391578063904e9b2b146103b157806391d14854146103d1578063a217fddf1461040157600080fd5b80634e0df3f6116100fd5780634e0df3f61461021e578063542774b51461023e5780635e1fab0f14610277578063632d589c146102975780636ed93dd0146102cf578063745e6b61146102fc57600080fd5b8063248a9ca31461013a578063253070651461017d5780632f2ff15d14610192578063318c136e146101b257806336568abe146101fe575b600080fd5b34801561014657600080fd5b5061016a61015536600461173f565b60009081526020819052604090206002015490565b6040519081526020015b60405180910390f35b61019061018b3660046117cf565b6104f3565b005b34801561019e57600080fd5b506101906101ad36600461187c565b6105df565b3480156101be57600080fd5b506101e67f000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb81565b6040516001600160a01b039091168152602001610174565b34801561020a57600080fd5b5061019061021936600461187c565b61066d565b34801561022a57600080fd5b5061016a61023936600461187c565b6106e7565b34801561024a57600080fd5b50604080518082018252600a81526970657263656e7461676560b01b6020820152905161017491906118d8565b34801561028357600080fd5b5061019061029236600461190b565b610712565b3480156102a357600080fd5b5061016a6102b2366004611928565b600160209081526000928352604080842090915290825290205481565b3480156102db57600080fd5b506102e76305f5e10081565b60405163ffffffff9091168152602001610174565b34801561030857600080fd5b506101e67f000000000000000000000000fd76546031d444eadb3b749919490dde3974027b81565b34801561033c57600080fd5b5061037161034b36600461173f565b6002602052600090815260409020546001600160801b0380821691600160801b90041682565b604080516001600160801b03938416815292909116602083015201610174565b34801561039d57600080fd5b506101e66103ac366004611952565b610782565b3480156103bd57600080fd5b506101906103cc3660046119b9565b6107a1565b3480156103dd57600080fd5b506103f16103ec36600461187c565b6109b6565b6040519015158152602001610174565b34801561040d57600080fd5b5061016a600081565b34801561042257600080fd5b50610190610431366004611a25565b6109ce565b34801561044257600080fd5b5061016a61045136600461173f565b610aba565b34801561046257600080fd5b50610190610471366004611a58565b610ad1565b34801561048257600080fd5b50610190610491366004611ae9565b610d4c565b3480156104a257600080fd5b506101906104b136600461187c565b610f50565b3480156104c257600080fd5b506104d66104d13660046117cf565b610fd1565b604080519283526001600160a01b03909116602083015201610174565b6104fb61100a565b341561054e5760405162461bcd60e51b815260206004820152601a60248201527f636f6c6c6563744665653a206d73672e76616c756520213d203000000000000060448201526064015b60405180910390fd5b6000806105618a8a8a8a8a8a8a8a6110cc565b91509150610571818b30856112c3565b604080516001600160a01b038c8116825260ff8c811660208401528b1682840152606082018a905260808201859052831660a082015290517fbd231b7fa4103e15e7a238c72f07e8aff310701af121895aa6c793b80245e4339181900360c00190a150505050505050505050565b6000828152602081905260409020600201546105fb90336109b6565b61065f5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526e0818591b5a5b881d1bc819dc985b9d608a1b6064820152608401610545565b61066982826112d0565b5050565b6001600160a01b03811633146106dd5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610545565b6106698282611329565b6000828152602081815260408083206001600160a01b03851684526001019091529020545b92915050565b336001600160a01b03821681141561076c5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f742072656e6f756e6365206f6e6573656c660000000000000000006044820152606401610545565b6107776000836105df565b61066960008261066d565b600082815260208190526040812061079a9083611382565b9392505050565b6107ac6000336109b6565b6107c85760405162461bcd60e51b815260040161054590611b25565b8281146108175760405162461bcd60e51b815260206004820152601f60248201527f61646472735b5d2c20616d6f756e74735b5d3a2064696666206c656e677468006044820152606401610545565b60005b838110156109af57600085858381811061083657610836611b5c565b905060200201602081019061084b919061190b565b6001600160a01b031684848481811061086657610866611b5c565b9050602002013560405160006040518083038185875af1925050503d80600081146108ad576040519150601f19603f3d011682016040523d82523d6000602084013e6108b2565b606091505b50509050806109035760405162461bcd60e51b815260206004820152601960248201527f466565206574686572207472616e73666572206661696c6564000000000000006044820152606401610545565b7faaa40a232aaf133fdd28f3485f6fdd163514cfadbffa981f3610f42398efe34b600087878581811061093857610938611b5c565b905060200201602081019061094d919061190b565b86868681811061095f5761095f611b5c565b90506020020135604051610994939291906001600160a01b039384168152919092166020820152604081019190915260600190565b60405180910390a150806109a781611b88565b91505061081a565b5050505050565b600082815260208190526040812061079a908361138e565b6109d96000336109b6565b6109f55760405162461bcd60e51b815260040161054590611b25565b60ff8316600090815260016020908152604080832085845290915290205481811415610a635760405162461bcd60e51b815260206004820152601f60248201527f43757272656e742066656520697320657175616c20746f206e657720666565006044820152606401610545565b60ff8416600090815260016020908152604080832086845282529182902084905590518381527f6bbc57480a46553fa4d156ce702beef5f3ad66303b0ed1a5d4cb44966c6584c3910160405180910390a150505050565b600081815260208190526040812061070c906113b0565b610adc6000336109b6565b610af85760405162461bcd60e51b815260040161054590611b25565b828114610b475760405162461bcd60e51b815260206004820152601f60248201527f61646472735b5d2c20616d6f756e74735b5d3a2064696666206c656e677468006044820152606401610545565b6040516384db809f60e01b8152600481018690526000907f000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb6001600160a01b0316906384db809f90602401602060405180830381865afa158015610baf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd39190611ba3565b60405163014daabb60e31b8152600481018890529091506000906001600160a01b03831690630a6d55d890602401602060405180830381865afa158015610c1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c429190611ba3565b905060005b85811015610d4257610c9882888884818110610c6557610c65611b5c565b9050602002016020810190610c7a919061190b565b878785818110610c8c57610c8c611b5c565b905060200201356113ba565b7faaa40a232aaf133fdd28f3485f6fdd163514cfadbffa981f3610f42398efe34b82888884818110610ccc57610ccc611b5c565b9050602002016020810190610ce1919061190b565b878785818110610cf357610cf3611b5c565b90506020020135604051610d28939291906001600160a01b039384168152919092166020820152604081019190915260600190565b60405180910390a180610d3a81611b88565b915050610c47565b5050505050505050565b610d576000336109b6565b610d735760405162461bcd60e51b815260040161054590611b25565b6001600160801b0381161580610d9a5750816001600160801b0316816001600160801b0316115b610dff5760405162461bcd60e51b815260206004820152603060248201527f557070657220626f756e64206d757374206265206c6172676572207468616e2060448201526f06c6f77657220626f756e64206f7220360841b6064820152608401610545565b6000838152600260209081526040918290208251808401909352546001600160801b03808216808552600160801b909204811692840192909252908416141580610e5f5750816001600160801b031681602001516001600160801b031614155b610eba5760405162461bcd60e51b815260206004820152602660248201527f43757272656e7420626f756e64732061726520657175616c20746f206e657720604482015265626f756e647360d01b6064820152608401610545565b6040805180820182526001600160801b038086168252848116602080840191825260008981526002909152849020835191518316600160801b029190921617905590517f25fb75f58179b90390cb00fe98bf5bdaa0e9d22f0e1f15bd3695c34c281647f890610f4190869086906001600160801b0392831681529116602082015260400190565b60405180910390a15050505050565b600082815260208190526040902060020154610f6c90336109b6565b6106dd5760405162461bcd60e51b815260206004820152603060248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526f2061646d696e20746f207265766f6b6560801b6064820152608401610545565b600080610fe48a8a8a8a8a8a8a8a6110cc565b915091509850989650505050505050565b600061079a836001600160a01b0384166113cc565b336001600160a01b037f000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb1614806110695750336001600160a01b037f000000000000000000000000fd76546031d444eadb3b749919490dde3974027b16145b6110ca5760405162461bcd60e51b815260206004820152602c60248201527f73656e646572206d75737420626520627269646765206f722066656520726f7560448201526b1d195c8818dbdb9d1c9858dd60a21b6064820152608401610545565b565b60008060007f000000000000000000000000cc75624b8ddfabccff6a6269f31409e4adf38bcb6001600160a01b03166384db809f896040518263ffffffff1660e01b815260040161111f91815260200190565b602060405180830381865afa15801561113c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111609190611ba3565b60405163014daabb60e31b8152600481018a90529091506001600160a01b03821690630a6d55d890602401602060405180830381865afa1580156111a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111cc9190611ba3565b60008981526002602090815260408083208151808301909252546001600160801b038082168352600160801b9091041691810191909152919350611212888a018a61173f565b60ff8c1660009081526001602090815260408083208e84529091529020549091506305f5e100906112439083611bc0565b61124d9190611bdf565b82519095506001600160801b03168510156112745781516001600160801b031694506112b3565b81602001516001600160801b03168511801561129d5750600082602001516001600160801b0316115b156112b35781602001516001600160801b031694505b5050509850989650505050505050565b836109af8185858561141b565b60008281526020819052604090206112e89082610ff5565b156106695760405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b60008281526020819052604090206113419082611486565b156106695760405133906001600160a01b0383169084907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90600090a45050565b600061079a838361149b565b6001600160a01b0381166000908152600183016020526040812054151561079a565b600061070c825490565b826113c68184846114c5565b50505050565b60008181526001830160205260408120546114135750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561070c565b50600061070c565b6040516001600160a01b03808516602483015283166044820152606481018290526113c69085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526114fa565b600061079a836001600160a01b03841661164c565b60008260000182815481106114b2576114b2611b5c565b9060005260206000200154905092915050565b6040516001600160a01b0383166024820152604481018290526114f590849063a9059cbb60e01b9060640161144f565b505050565b813b806115415760405162461bcd60e51b8152602060048201526015602482015274115490cc8c0e881b9bdd08184818dbdb9d1c9858dd605a1b6044820152606401610545565b600080846001600160a01b03168460405161155c9190611c01565b6000604051808303816000865af19150503d8060008114611599576040519150601f19603f3d011682016040523d82523d6000602084013e61159e565b606091505b5091509150816115e55760405162461bcd60e51b8152602060048201526012602482015271115490cc8c0e8818d85b1b0819985a5b195960721b6044820152606401610545565b8051156109af57808060200190518101906116009190611c1d565b6109af5760405162461bcd60e51b815260206004820181905260248201527f45524332303a206f7065726174696f6e20646964206e6f7420737563636565646044820152606401610545565b60008181526001830160205260408120548015611735576000611670600183611c3f565b855490915060009061168490600190611c3f565b90508181146116e95760008660000182815481106116a4576116a4611b5c565b90600052602060002001549050808760000184815481106116c7576116c7611b5c565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806116fa576116fa611c56565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061070c565b600091505061070c565b60006020828403121561175157600080fd5b5035919050565b6001600160a01b038116811461176d57600080fd5b50565b803560ff8116811461178157600080fd5b919050565b60008083601f84011261179857600080fd5b50813567ffffffffffffffff8111156117b057600080fd5b6020830191508360208285010111156117c857600080fd5b9250929050565b60008060008060008060008060c0898b0312156117eb57600080fd5b88356117f681611758565b975061180460208a01611770565b965061181260408a01611770565b955060608901359450608089013567ffffffffffffffff8082111561183657600080fd5b6118428c838d01611786565b909650945060a08b013591508082111561185b57600080fd5b506118688b828c01611786565b999c989b5096995094979396929594505050565b6000806040838503121561188f57600080fd5b8235915060208301356118a181611758565b809150509250929050565b60005b838110156118c75781810151838201526020016118af565b838111156113c65750506000910152565b60208152600082518060208401526118f78160408501602087016118ac565b601f01601f19169190910160400192915050565b60006020828403121561191d57600080fd5b813561079a81611758565b6000806040838503121561193b57600080fd5b61194483611770565b946020939093013593505050565b6000806040838503121561196557600080fd5b50508035926020909101359150565b60008083601f84011261198657600080fd5b50813567ffffffffffffffff81111561199e57600080fd5b6020830191508360208260051b85010111156117c857600080fd5b600080600080604085870312156119cf57600080fd5b843567ffffffffffffffff808211156119e757600080fd5b6119f388838901611974565b90965094506020870135915080821115611a0c57600080fd5b50611a1987828801611974565b95989497509550505050565b600080600060608486031215611a3a57600080fd5b611a4384611770565b95602085013595506040909401359392505050565b600080600080600060608688031215611a7057600080fd5b85359450602086013567ffffffffffffffff80821115611a8f57600080fd5b611a9b89838a01611974565b90965094506040880135915080821115611ab457600080fd5b50611ac188828901611974565b969995985093965092949392505050565b80356001600160801b038116811461178157600080fd5b600080600060608486031215611afe57600080fd5b83359250611b0e60208501611ad2565b9150611b1c60408501611ad2565b90509250925092565b6020808252601e908201527f73656e64657220646f65736e277420686176652061646d696e20726f6c650000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b9c57611b9c611b72565b5060010190565b600060208284031215611bb557600080fd5b815161079a81611758565b6000816000190483118215151615611bda57611bda611b72565b500290565b600082611bfc57634e487b7160e01b600052601260045260246000fd5b500490565b60008251611c138184602087016118ac565b9190910192915050565b600060208284031215611c2f57600080fd5b8151801515811461079a57600080fd5b600082821015611c5157611c51611b72565b500390565b634e487b7160e01b600052603160045260246000fdfea264697066735822122018d758dd7e179f39e691b8bd5ff5a7ae31924fecb82259e733403020ce490ed064736f6c634300080b0033
1
20,291,029
3490ec3fe867403f28daebd5d2203c06b48aebaa32277ce0dfcdb81a608db194
77f1e0607fbf08a9e7e2c7ea0e2a4f49e23431a63826d986e004702eb6a74bf0
a9a0b8a5e1adca0caccc63a168f053cd3be30808
01cd62ed13d0b666e2a10d13879a763dfd1dab99
359aa565f4a73314fb1d91ad321b810e1664952e
3d602d80600a3d3981f3363d3d373d3d3d363d7308656072fee78f1d07e38c189de56daa9863597a5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7308656072fee78f1d07e38c189de56daa9863597a5af43d82803e903d91602b57fd5bf3
1
20,291,030
cdfdd0b73b3bd339bfe40dbbbda4673e5e130e79ba03c2949b27751eda003a61
811d8e43cd414a86048098092b5c890de4a5bc6979b3821058342d68ab6a6d2c
b02c6c40a798184d5e012fbb1dc698977671f8fc
ffa397285ce46fb78c588a9e993286aac68c37cd
31e36361c53c880c375fb2ddb5097d16b67256f5
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,291,030
cdfdd0b73b3bd339bfe40dbbbda4673e5e130e79ba03c2949b27751eda003a61
d6ea36f1aac442a7c8d05e43ba4a76e7b546b0bfa632a1d8aa8fb11d184809bf
c9aad2fc90eddacf02bd11fa690e3b44e318aa9b
a2a1bf5a83f9daec2dc364e1c561e937163cb613
c26aec51ca2dee28022fb3ed1a099afeeca50f01
3d602d80600a3d3981f3363d3d373d3d3d363d7387ae9be718aa310323042ab9806bd6692c1129b75af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7387ae9be718aa310323042ab9806bd6692c1129b75af43d82803e903d91602b57fd5bf3
1
20,291,041
59ec854285fe9467f3927aa22b7a59501eccd212501bf69624e5f0a2e2f505ce
56495b8ed14fc74dc7c4480df76a3d09aaec56a49ff5e6dc5a94550c6c1ffb93
7cf606bff6a4b00cc59013a5a6e69060b85a42f9
7cf606bff6a4b00cc59013a5a6e69060b85a42f9
31cd0dc3752dc8dc6cde26a3939a1d7d40036f16
6080604052600180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d17905534801561003657600080fd5b50600080546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350336000908152600360205260408082208054600160ff19918216811790925530845291909220805490911690911790556109b0806100b76000396000f3fe60806040526004361061008a5760003560e01c8063ba49f37111610059578063ba49f37114610141578063c4a805ee14610161578063f2fde38b14610181578063f6b19c74146101a1578063fad9aba3146101c157600080fd5b806311df9995146100b257806337a25dc2146100ee578063715018a61461010e5780638da5cb5b1461012357600080fd5b366100ad573260009081526003602052604090205460ff166100ab57600080fd5b005b600080fd5b3480156100be57600080fd5b506002546100d2906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b3480156100fa57600080fd5b506100ab61010936600461071a565b6101d6565b34801561011a57600080fd5b506100ab610298565b34801561012f57600080fd5b506000546001600160a01b03166100d2565b34801561014d57600080fd5b506100ab61015c36600461076d565b61030c565b34801561016d57600080fd5b506100ab61017c36600461071a565b6103a2565b34801561018d57600080fd5b506100ab61019c36600461071a565b6103ee565b3480156101ad57600080fd5b506100ab6101bc366004610844565b6104d8565b3480156101cd57600080fd5b506100ab61050e565b6000546001600160a01b031633146102095760405162461bcd60e51b81526004016102009061085d565b60405180910390fd5b600280546001600160a01b0319166001600160a01b0383811691821790925560015460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af1158015610270573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102949190610892565b5050565b6000546001600160a01b031633146102c25760405162461bcd60e51b81526004016102009061085d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146103365760405162461bcd60e51b81526004016102009061085d565b60005b825181101561039d578160036000858481518110610359576103596108af565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610395816108c5565b915050610339565b505050565b6000546001600160a01b031633146103cc5760405162461bcd60e51b81526004016102009061085d565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146104185760405162461bcd60e51b81526004016102009061085d565b6001600160a01b03811661047d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610200565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105025760405162461bcd60e51b81526004016102009061085d565b61050b81610564565b50565b6000546001600160a01b031633146105385760405162461bcd60e51b81526004016102009061085d565b60405133904780156108fc02916000818181858888f1935050505015801561050b573d6000803e3d6000fd5b604080516002808252606082018352600092602083019080368337505060025482519293506001600160a01b0316918391506000906105a5576105a56108af565b6001600160a01b03928316602091820292909201810191909152600154604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156105fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062291906108ec565b81600181518110610635576106356108af565b6001600160a01b03928316602091820292909201015260015460405163791ac94760e01b815291169063791ac9479061067b908590600090869030904290600401610909565b600060405180830381600087803b15801561069557600080fd5b505af11580156106a9573d6000803e3d6000fd5b50479250508115905061039d57600080546040516001600160a01b039091169183156108fc02918491818181858888f193505050501580156106ef573d6000803e3d6000fd5b50505050565b6001600160a01b038116811461050b57600080fd5b8035610715816106f5565b919050565b60006020828403121561072c57600080fd5b8135610737816106f5565b9392505050565b634e487b7160e01b600052604160045260246000fd5b801515811461050b57600080fd5b803561071581610754565b6000806040838503121561078057600080fd5b823567ffffffffffffffff8082111561079857600080fd5b818501915085601f8301126107ac57600080fd5b81356020828211156107c0576107c061073e565b8160051b604051601f19603f830116810181811086821117156107e5576107e561073e565b60405292835281830193508481018201928984111561080357600080fd5b948201945b83861015610828576108198661070a565b85529482019493820193610808565b96506108379050878201610762565b9450505050509250929050565b60006020828403121561085657600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156108a457600080fd5b815161073781610754565b634e487b7160e01b600052603260045260246000fd5b6000600182016108e557634e487b7160e01b600052601160045260246000fd5b5060010190565b6000602082840312156108fe57600080fd5b8151610737816106f5565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156109595784516001600160a01b031683529383019391830191600101610934565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220e385a7707c2b13374447888d905e8d011d6a1509f19f94edf8c0fa56b2cbe50464736f6c63430008130033
60806040526004361061008a5760003560e01c8063ba49f37111610059578063ba49f37114610141578063c4a805ee14610161578063f2fde38b14610181578063f6b19c74146101a1578063fad9aba3146101c157600080fd5b806311df9995146100b257806337a25dc2146100ee578063715018a61461010e5780638da5cb5b1461012357600080fd5b366100ad573260009081526003602052604090205460ff166100ab57600080fd5b005b600080fd5b3480156100be57600080fd5b506002546100d2906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b3480156100fa57600080fd5b506100ab61010936600461071a565b6101d6565b34801561011a57600080fd5b506100ab610298565b34801561012f57600080fd5b506000546001600160a01b03166100d2565b34801561014d57600080fd5b506100ab61015c36600461076d565b61030c565b34801561016d57600080fd5b506100ab61017c36600461071a565b6103a2565b34801561018d57600080fd5b506100ab61019c36600461071a565b6103ee565b3480156101ad57600080fd5b506100ab6101bc366004610844565b6104d8565b3480156101cd57600080fd5b506100ab61050e565b6000546001600160a01b031633146102095760405162461bcd60e51b81526004016102009061085d565b60405180910390fd5b600280546001600160a01b0319166001600160a01b0383811691821790925560015460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af1158015610270573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102949190610892565b5050565b6000546001600160a01b031633146102c25760405162461bcd60e51b81526004016102009061085d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146103365760405162461bcd60e51b81526004016102009061085d565b60005b825181101561039d578160036000858481518110610359576103596108af565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610395816108c5565b915050610339565b505050565b6000546001600160a01b031633146103cc5760405162461bcd60e51b81526004016102009061085d565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146104185760405162461bcd60e51b81526004016102009061085d565b6001600160a01b03811661047d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610200565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105025760405162461bcd60e51b81526004016102009061085d565b61050b81610564565b50565b6000546001600160a01b031633146105385760405162461bcd60e51b81526004016102009061085d565b60405133904780156108fc02916000818181858888f1935050505015801561050b573d6000803e3d6000fd5b604080516002808252606082018352600092602083019080368337505060025482519293506001600160a01b0316918391506000906105a5576105a56108af565b6001600160a01b03928316602091820292909201810191909152600154604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156105fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062291906108ec565b81600181518110610635576106356108af565b6001600160a01b03928316602091820292909201015260015460405163791ac94760e01b815291169063791ac9479061067b908590600090869030904290600401610909565b600060405180830381600087803b15801561069557600080fd5b505af11580156106a9573d6000803e3d6000fd5b50479250508115905061039d57600080546040516001600160a01b039091169183156108fc02918491818181858888f193505050501580156106ef573d6000803e3d6000fd5b50505050565b6001600160a01b038116811461050b57600080fd5b8035610715816106f5565b919050565b60006020828403121561072c57600080fd5b8135610737816106f5565b9392505050565b634e487b7160e01b600052604160045260246000fd5b801515811461050b57600080fd5b803561071581610754565b6000806040838503121561078057600080fd5b823567ffffffffffffffff8082111561079857600080fd5b818501915085601f8301126107ac57600080fd5b81356020828211156107c0576107c061073e565b8160051b604051601f19603f830116810181811086821117156107e5576107e561073e565b60405292835281830193508481018201928984111561080357600080fd5b948201945b83861015610828576108198661070a565b85529482019493820193610808565b96506108379050878201610762565b9450505050509250929050565b60006020828403121561085657600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156108a457600080fd5b815161073781610754565b634e487b7160e01b600052603260045260246000fd5b6000600182016108e557634e487b7160e01b600052601160045260246000fd5b5060010190565b6000602082840312156108fe57600080fd5b8151610737816106f5565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156109595784516001600160a01b031683529383019391830191600101610934565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220e385a7707c2b13374447888d905e8d011d6a1509f19f94edf8c0fa56b2cbe50464736f6c63430008130033
1
20,291,041
59ec854285fe9467f3927aa22b7a59501eccd212501bf69624e5f0a2e2f505ce
5f4106d5d5da35f257589d3d74455162881d956bc5e057a85de42cc4cc4814a3
e82c798530f71d16f91af2843305ab5b3ddef7b5
008ebccae39d001200c3003c3225ce0a00690066
f441efed4e8d1784e25b8eb664331f22e2b55735
3d602d80600a3d3981f3363d3d373d3d3d363d7309a26fc8fcef18192e267d7a6da9dfb4be81dd6a5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7309a26fc8fcef18192e267d7a6da9dfb4be81dd6a5af43d82803e903d91602b57fd5bf3
{{ "language": "Solidity", "sources": { "src/clones/ERC721SeaDropCloneable.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {\n ERC721ContractMetadataCloneable,\n ISeaDropTokenContractMetadata\n} from \"./ERC721ContractMetadataCloneable.sol\";\n\nimport {\n INonFungibleSeaDropToken\n} from \"../interfaces/INonFungibleSeaDropToken.sol\";\n\nimport { ISeaDrop } from \"../interfaces/ISeaDrop.sol\";\n\nimport {\n AllowListData,\n PublicDrop,\n TokenGatedDropStage,\n SignedMintValidationParams\n} from \"../lib/SeaDropStructs.sol\";\n\nimport {\n ERC721SeaDropStructsErrorsAndEvents\n} from \"../lib/ERC721SeaDropStructsErrorsAndEvents.sol\";\n\nimport { ERC721ACloneable } from \"./ERC721ACloneable.sol\";\n\nimport {\n ReentrancyGuardUpgradeable\n} from \"openzeppelin-contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\nimport {\n IERC165\n} from \"openzeppelin-contracts/utils/introspection/IERC165.sol\";\n\n/**\n * @title ERC721SeaDrop\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 ERC721SeaDrop is a token contract that contains methods\n * to properly interact with SeaDrop.\n * Implements Limit Break's Creator Token Standards transfer\n * validation for royalty enforcement.\n */\ncontract ERC721SeaDropCloneable is\n ERC721ContractMetadataCloneable,\n INonFungibleSeaDropToken,\n ERC721SeaDropStructsErrorsAndEvents,\n ReentrancyGuardUpgradeable\n{\n /// @notice Track the allowed SeaDrop addresses.\n mapping(address => bool) internal _allowedSeaDrop;\n\n /// @notice Track the enumerated allowed SeaDrop addresses.\n address[] internal _enumeratedAllowedSeaDrop;\n\n /**\n * @dev Reverts if not an allowed SeaDrop contract.\n * This function is inlined instead of being a modifier\n * to save contract space from being inlined N times.\n *\n * @param seaDrop The SeaDrop address to check if allowed.\n */\n function _onlyAllowedSeaDrop(address seaDrop) internal view {\n if (_allowedSeaDrop[seaDrop] != true) {\n revert OnlyAllowedSeaDrop();\n }\n }\n\n /**\n * @notice Deploy the token contract with its name, symbol,\n * and allowed SeaDrop addresses.\n */\n function initialize(\n string calldata __name,\n string calldata __symbol,\n address[] calldata allowedSeaDrop,\n address initialOwner\n ) public initializer {\n __ERC721ACloneable__init(__name, __symbol);\n __ReentrancyGuard_init();\n _updateAllowedSeaDrop(allowedSeaDrop);\n _transferOwnership(initialOwner);\n emit SeaDropTokenDeployed();\n }\n\n /**\n * @notice Update the allowed SeaDrop contracts.\n * Only the owner can use this function.\n *\n * @param allowedSeaDrop The allowed SeaDrop addresses.\n */\n function updateAllowedSeaDrop(address[] calldata allowedSeaDrop)\n external\n virtual\n override\n onlyOwner\n {\n _updateAllowedSeaDrop(allowedSeaDrop);\n }\n\n /**\n * @notice Internal function to update the allowed SeaDrop contracts.\n *\n * @param allowedSeaDrop The allowed SeaDrop addresses.\n */\n function _updateAllowedSeaDrop(address[] calldata allowedSeaDrop) internal {\n // Put the length on the stack for more efficient access.\n uint256 enumeratedAllowedSeaDropLength = _enumeratedAllowedSeaDrop\n .length;\n uint256 allowedSeaDropLength = allowedSeaDrop.length;\n\n // Reset the old mapping.\n for (uint256 i = 0; i < enumeratedAllowedSeaDropLength; ) {\n _allowedSeaDrop[_enumeratedAllowedSeaDrop[i]] = false;\n unchecked {\n ++i;\n }\n }\n\n // Set the new mapping for allowed SeaDrop contracts.\n for (uint256 i = 0; i < allowedSeaDropLength; ) {\n _allowedSeaDrop[allowedSeaDrop[i]] = true;\n unchecked {\n ++i;\n }\n }\n\n // Set the enumeration.\n _enumeratedAllowedSeaDrop = allowedSeaDrop;\n\n // Emit an event for the update.\n emit AllowedSeaDropUpdated(allowedSeaDrop);\n }\n\n /**\n * @notice Burns `tokenId`. The caller must own `tokenId` or be an\n * approved operator.\n *\n * @param tokenId The token id to burn.\n */\n // solhint-disable-next-line comprehensive-interface\n function burn(uint256 tokenId) external {\n _burn(tokenId, true);\n }\n\n /**\n * @dev Overrides the `_startTokenId` function from ERC721A\n * to start at token id `1`.\n *\n * This is to avoid future possible problems since `0` is usually\n * used to signal values that have not been set or have been removed.\n */\n function _startTokenId() internal view virtual override returns (uint256) {\n return 1;\n }\n\n /**\n * @dev Overrides the `tokenURI()` function from ERC721A\n * to return just the base URI if it is implied to not be a directory.\n *\n * This is to help with ERC721 contracts in which the same token URI\n * is desired for each token, such as when the tokenURI is 'unrevealed'.\n */\n function tokenURI(uint256 tokenId)\n public\n view\n virtual\n override\n returns (string memory)\n {\n if (!_exists(tokenId)) revert URIQueryForNonexistentToken();\n\n string memory baseURI = _baseURI();\n\n // Exit early if the baseURI is empty.\n if (bytes(baseURI).length == 0) {\n return \"\";\n }\n\n // Check if the last character in baseURI is a slash.\n if (bytes(baseURI)[bytes(baseURI).length - 1] != bytes(\"/\")[0]) {\n return baseURI;\n }\n\n return string(abi.encodePacked(baseURI, _toString(tokenId)));\n }\n\n /**\n * @notice Mint tokens, restricted to the SeaDrop contract.\n *\n * @dev NOTE: If a token registers itself with multiple SeaDrop\n * contracts, the implementation of this function should guard\n * against reentrancy. If the implementing token uses\n * _safeMint(), or a feeRecipient with a malicious receive() hook\n * is specified, the token or fee recipients may be able to execute\n * another mint in the same transaction via a separate SeaDrop\n * contract.\n * This is dangerous if an implementing token does not correctly\n * update the minterNumMinted and currentTotalSupply values before\n * transferring minted tokens, as SeaDrop references these values\n * to enforce token limits on a per-wallet and per-stage basis.\n *\n * ERC721A tracks these values automatically, but this note and\n * nonReentrant modifier are left here to encourage best-practices\n * when referencing this contract.\n *\n * @param minter The address to mint to.\n * @param quantity The number of tokens to mint.\n */\n function mintSeaDrop(address minter, uint256 quantity)\n external\n virtual\n override\n nonReentrant\n {\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(msg.sender);\n\n // Extra safety check to ensure the max supply is not exceeded.\n if (_totalMinted() + quantity > maxSupply()) {\n revert MintQuantityExceedsMaxSupply(\n _totalMinted() + quantity,\n maxSupply()\n );\n }\n\n // Mint the quantity of tokens to the minter.\n _safeMint(minter, quantity);\n }\n\n /**\n * @notice Update the public drop data for this nft contract on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param publicDrop The public drop data.\n */\n function updatePublicDrop(\n address seaDropImpl,\n PublicDrop calldata publicDrop\n ) external virtual override {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(seaDropImpl);\n\n // Update the public drop data on SeaDrop.\n ISeaDrop(seaDropImpl).updatePublicDrop(publicDrop);\n }\n\n /**\n * @notice Update the allow list data for this nft contract on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param allowListData The allow list data.\n */\n function updateAllowList(\n address seaDropImpl,\n AllowListData calldata allowListData\n ) external virtual override {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(seaDropImpl);\n\n // Update the allow list on SeaDrop.\n ISeaDrop(seaDropImpl).updateAllowList(allowListData);\n }\n\n /**\n * @notice Update the token gated drop stage data for this nft contract\n * on SeaDrop.\n * Only the owner can use this function.\n *\n * Note: If two INonFungibleSeaDropToken tokens are doing\n * simultaneous token gated drop promotions for each other,\n * they can be minted by the same actor until\n * `maxTokenSupplyForStage` is reached. Please ensure the\n * `allowedNftToken` is not running an active drop during the\n * `dropStage` time period.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param allowedNftToken The allowed nft token.\n * @param dropStage The token gated drop stage data.\n */\n function updateTokenGatedDrop(\n address seaDropImpl,\n address allowedNftToken,\n TokenGatedDropStage calldata dropStage\n ) external virtual override {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(seaDropImpl);\n\n // Update the token gated drop stage.\n ISeaDrop(seaDropImpl).updateTokenGatedDrop(allowedNftToken, dropStage);\n }\n\n /**\n * @notice Update the drop URI for this nft contract on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param dropURI The new drop URI.\n */\n function updateDropURI(address seaDropImpl, string calldata dropURI)\n external\n virtual\n override\n {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(seaDropImpl);\n\n // Update the drop URI.\n ISeaDrop(seaDropImpl).updateDropURI(dropURI);\n }\n\n /**\n * @notice Update the creator payout address for this nft contract on\n * SeaDrop.\n * Only the owner can set the creator payout address.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param payoutAddress The new payout address.\n */\n function updateCreatorPayoutAddress(\n address seaDropImpl,\n address payoutAddress\n ) external {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(seaDropImpl);\n\n // Update the creator payout address.\n ISeaDrop(seaDropImpl).updateCreatorPayoutAddress(payoutAddress);\n }\n\n /**\n * @notice Update the allowed fee recipient for this nft contract\n * on SeaDrop.\n * Only the owner can set the allowed fee recipient.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param feeRecipient The new fee recipient.\n * @param allowed If the fee recipient is allowed.\n */\n function updateAllowedFeeRecipient(\n address seaDropImpl,\n address feeRecipient,\n bool allowed\n ) external virtual {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(seaDropImpl);\n\n // Update the allowed fee recipient.\n ISeaDrop(seaDropImpl).updateAllowedFeeRecipient(feeRecipient, allowed);\n }\n\n /**\n * @notice Update the server-side signers for this nft contract\n * on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param signer The signer to update.\n * @param signedMintValidationParams Minimum and maximum parameters to\n * enforce for signed mints.\n */\n function updateSignedMintValidationParams(\n address seaDropImpl,\n address signer,\n SignedMintValidationParams memory signedMintValidationParams\n ) external virtual override {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(seaDropImpl);\n\n // Update the signer.\n ISeaDrop(seaDropImpl).updateSignedMintValidationParams(\n signer,\n signedMintValidationParams\n );\n }\n\n /**\n * @notice Update the allowed payers for this nft contract on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param payer The payer to update.\n * @param allowed Whether the payer is allowed.\n */\n function updatePayer(\n address seaDropImpl,\n address payer,\n bool allowed\n ) external virtual override {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(seaDropImpl);\n\n // Update the payer.\n ISeaDrop(seaDropImpl).updatePayer(payer, allowed);\n }\n\n /**\n * @notice Returns a set of mint stats for the address.\n * This assists SeaDrop in enforcing maxSupply,\n * maxTotalMintableByWallet, 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 onERC721Received() hooks.\n *\n * @param minter The minter address.\n */\n function getMintStats(address minter)\n external\n view\n override\n returns (\n uint256 minterNumMinted,\n uint256 currentTotalSupply,\n uint256 maxSupply\n )\n {\n minterNumMinted = _numberMinted(minter);\n currentTotalSupply = _totalMinted();\n maxSupply = _maxSupply;\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(bytes4 interfaceId)\n public\n view\n virtual\n override(IERC165, ERC721ContractMetadataCloneable)\n returns (bool)\n {\n return\n interfaceId == type(INonFungibleSeaDropToken).interfaceId ||\n interfaceId == type(ISeaDropTokenContractMetadata).interfaceId ||\n // ERC721ContractMetadata returns supportsInterface true for\n // EIP-2981\n // ERC721A returns supportsInterface true for\n // ERC165, ERC721, ERC721Metadata\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @notice Configure multiple properties at a time.\n *\n * Note: The individual configure methods should be used\n * to unset or reset any properties to zero, as this method\n * will ignore zero-value properties in the config struct.\n *\n * @param config The configuration struct.\n */\n function multiConfigure(MultiConfigureStruct calldata config)\n external\n onlyOwner\n {\n if (config.maxSupply > 0) {\n this.setMaxSupply(config.maxSupply);\n }\n if (bytes(config.baseURI).length != 0) {\n this.setBaseURI(config.baseURI);\n }\n if (bytes(config.contractURI).length != 0) {\n this.setContractURI(config.contractURI);\n }\n if (\n _cast(config.publicDrop.startTime != 0) |\n _cast(config.publicDrop.endTime != 0) ==\n 1\n ) {\n this.updatePublicDrop(config.seaDropImpl, config.publicDrop);\n }\n if (bytes(config.dropURI).length != 0) {\n this.updateDropURI(config.seaDropImpl, config.dropURI);\n }\n if (config.allowListData.merkleRoot != bytes32(0)) {\n this.updateAllowList(config.seaDropImpl, config.allowListData);\n }\n if (config.creatorPayoutAddress != address(0)) {\n this.updateCreatorPayoutAddress(\n config.seaDropImpl,\n config.creatorPayoutAddress\n );\n }\n if (config.provenanceHash != bytes32(0)) {\n this.setProvenanceHash(config.provenanceHash);\n }\n if (config.allowedFeeRecipients.length > 0) {\n for (uint256 i = 0; i < config.allowedFeeRecipients.length; ) {\n this.updateAllowedFeeRecipient(\n config.seaDropImpl,\n config.allowedFeeRecipients[i],\n true\n );\n unchecked {\n ++i;\n }\n }\n }\n if (config.disallowedFeeRecipients.length > 0) {\n for (uint256 i = 0; i < config.disallowedFeeRecipients.length; ) {\n this.updateAllowedFeeRecipient(\n config.seaDropImpl,\n config.disallowedFeeRecipients[i],\n false\n );\n unchecked {\n ++i;\n }\n }\n }\n if (config.allowedPayers.length > 0) {\n for (uint256 i = 0; i < config.allowedPayers.length; ) {\n this.updatePayer(\n config.seaDropImpl,\n config.allowedPayers[i],\n true\n );\n unchecked {\n ++i;\n }\n }\n }\n if (config.disallowedPayers.length > 0) {\n for (uint256 i = 0; i < config.disallowedPayers.length; ) {\n this.updatePayer(\n config.seaDropImpl,\n config.disallowedPayers[i],\n false\n );\n unchecked {\n ++i;\n }\n }\n }\n if (config.tokenGatedDropStages.length > 0) {\n if (\n config.tokenGatedDropStages.length !=\n config.tokenGatedAllowedNftTokens.length\n ) {\n revert TokenGatedMismatch();\n }\n for (uint256 i = 0; i < config.tokenGatedDropStages.length; ) {\n this.updateTokenGatedDrop(\n config.seaDropImpl,\n config.tokenGatedAllowedNftTokens[i],\n config.tokenGatedDropStages[i]\n );\n unchecked {\n ++i;\n }\n }\n }\n if (config.disallowedTokenGatedAllowedNftTokens.length > 0) {\n for (\n uint256 i = 0;\n i < config.disallowedTokenGatedAllowedNftTokens.length;\n\n ) {\n TokenGatedDropStage memory emptyStage;\n this.updateTokenGatedDrop(\n config.seaDropImpl,\n config.disallowedTokenGatedAllowedNftTokens[i],\n emptyStage\n );\n unchecked {\n ++i;\n }\n }\n }\n if (config.signedMintValidationParams.length > 0) {\n if (\n config.signedMintValidationParams.length !=\n config.signers.length\n ) {\n revert SignersMismatch();\n }\n for (\n uint256 i = 0;\n i < config.signedMintValidationParams.length;\n\n ) {\n this.updateSignedMintValidationParams(\n config.seaDropImpl,\n config.signers[i],\n config.signedMintValidationParams[i]\n );\n unchecked {\n ++i;\n }\n }\n }\n if (config.disallowedSigners.length > 0) {\n for (uint256 i = 0; i < config.disallowedSigners.length; ) {\n SignedMintValidationParams memory emptyParams;\n this.updateSignedMintValidationParams(\n config.seaDropImpl,\n config.disallowedSigners[i],\n emptyParams\n );\n unchecked {\n ++i;\n }\n }\n }\n }\n}\n" }, "src/clones/ERC721ContractMetadataCloneable.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {\n ISeaDropTokenContractMetadata\n} from \"../interfaces/ISeaDropTokenContractMetadata.sol\";\n\nimport {\n ERC721AConduitPreapprovedCloneable\n} from \"./ERC721AConduitPreapprovedCloneable.sol\";\n\nimport { ERC721ACloneable } from \"./ERC721ACloneable.sol\";\n\nimport { ERC721TransferValidator } from \"../lib/ERC721TransferValidator.sol\";\n\nimport {\n ICreatorToken,\n ILegacyCreatorToken\n} from \"../interfaces/ICreatorToken.sol\";\n\nimport { ITransferValidator721 } from \"../interfaces/ITransferValidator.sol\";\n\nimport { TwoStepOwnable } from \"utility-contracts/TwoStepOwnable.sol\";\n\nimport { IERC2981 } from \"openzeppelin-contracts/interfaces/IERC2981.sol\";\n\nimport {\n IERC165\n} from \"openzeppelin-contracts/utils/introspection/IERC165.sol\";\n\n/**\n * @title ERC721ContractMetadataCloneable\n * @author James Wenzel (emo.eth)\n * @author Ryan Ghods (ralxz.eth)\n * @author Stephan Min (stephanm.eth)\n * @notice ERC721ContractMetadata is a token contract that extends ERC721A\n * with additional metadata and ownership capabilities.\n */\ncontract ERC721ContractMetadataCloneable is\n ERC721AConduitPreapprovedCloneable,\n ERC721TransferValidator,\n TwoStepOwnable,\n ISeaDropTokenContractMetadata\n{\n /// @notice Track the max supply.\n uint256 _maxSupply;\n\n /// @notice Track the base URI for token metadata.\n string _tokenBaseURI;\n\n /// @notice Track the contract URI for contract metadata.\n string _contractURI;\n\n /// @notice Track the provenance hash for guaranteeing metadata order\n /// for random reveals.\n bytes32 _provenanceHash;\n\n /// @notice Track the royalty info: address to receive royalties, and\n /// royalty basis points.\n RoyaltyInfo _royaltyInfo;\n\n /**\n * @dev Reverts if the sender is not the owner or the contract itself.\n * This function is inlined instead of being a modifier\n * to save contract space from being inlined N times.\n */\n function _onlyOwnerOrSelf() internal view {\n if (\n _cast(msg.sender == owner()) | _cast(msg.sender == address(this)) ==\n 0\n ) {\n revert OnlyOwner();\n }\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 contract itself.\n _onlyOwnerOrSelf();\n\n // Set the new base URI.\n _tokenBaseURI = newBaseURI;\n\n // Emit an event with the update.\n if (totalSupply() != 0) {\n emit BatchMetadataUpdate(1, _nextTokenId() - 1);\n }\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 contract itself.\n _onlyOwnerOrSelf();\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(uint256 fromTokenId, uint256 toTokenId)\n external\n {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Emit an event with the update.\n emit BatchMetadataUpdate(fromTokenId, toTokenId);\n }\n\n /**\n * @notice Sets the max token supply and emits an event.\n *\n * @param newMaxSupply The new max supply to set.\n */\n function setMaxSupply(uint256 newMaxSupply) external {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the max supply does not exceed the maximum value of uint64.\n if (newMaxSupply > 2**64 - 1) {\n revert CannotExceedMaxSupplyOfUint64(newMaxSupply);\n }\n\n // Set the new max supply.\n _maxSupply = newMaxSupply;\n\n // Emit an event with the update.\n emit MaxSupplyUpdated(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 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 // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Revert if any items have been minted.\n if (_totalMinted() > 0) {\n revert ProvenanceHashCannotBeSetAfterMintStarted();\n }\n\n // Keep track of the old provenance hash for emitting with the event.\n bytes32 oldProvenanceHash = _provenanceHash;\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 address and basis points for royalties.\n *\n * @param newInfo The struct to configure royalties.\n */\n function setRoyaltyInfo(RoyaltyInfo calldata newInfo) external {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Revert if the new royalty address is the zero address.\n if (newInfo.royaltyAddress == address(0)) {\n revert RoyaltyAddressCannotBeZeroAddress();\n }\n\n // Revert if the new basis points is greater than 10_000.\n if (newInfo.royaltyBps > 10_000) {\n revert InvalidRoyaltyBasisPoints(newInfo.royaltyBps);\n }\n\n // Set the new royalty info.\n _royaltyInfo = newInfo;\n\n // Emit an event with the updated params.\n emit RoyaltyInfoUpdated(newInfo.royaltyAddress, newInfo.royaltyBps);\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 base URI for the contract, which ERC721A uses\n * to return tokenURI.\n */\n function _baseURI() internal view virtual override returns (string memory) {\n return _tokenBaseURI;\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.\n */\n function maxSupply() public view returns (uint256) {\n return _maxSupply;\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 address that receives royalties.\n */\n function royaltyAddress() external view returns (address) {\n return _royaltyInfo.royaltyAddress;\n }\n\n /**\n * @notice Returns the royalty basis points out of 10_000.\n */\n function royaltyBasisPoints() external view returns (uint256) {\n return _royaltyInfo.royaltyBps;\n }\n\n /**\n * @notice Called with the sale price to determine how much royalty\n * is owed and to whom.\n *\n * @ param _tokenId The NFT asset queried for royalty information.\n * @param _salePrice The sale price of the NFT asset specified by\n * _tokenId.\n *\n * @return receiver Address of who should be sent the royalty payment.\n * @return royaltyAmount The royalty payment amount for _salePrice.\n */\n function royaltyInfo(\n uint256,\n /* _tokenId */\n uint256 _salePrice\n ) external view returns (address receiver, uint256 royaltyAmount) {\n // Put the royalty info on the stack for more efficient access.\n RoyaltyInfo storage info = _royaltyInfo;\n\n // Set the royalty amount to the sale price times the royalty basis\n // points divided by 10_000.\n royaltyAmount = (_salePrice * info.royaltyBps) / 10_000;\n\n // Set the receiver of the royalty.\n receiver = info.royaltyAddress;\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 = ITransferValidator721.validateTransfer.selector;\n isViewFunction = false;\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 /**\n * @dev Hook that is called before any token transfer.\n * This includes minting and burning.\n */\n function _beforeTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 /* quantity */\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 ITransferValidator721(transferValidator).validateTransfer(\n msg.sender,\n from,\n to,\n startTokenId\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(bytes4 interfaceId)\n public\n view\n virtual\n override(IERC165, ERC721ACloneable)\n returns (bool)\n {\n return\n interfaceId == type(IERC2981).interfaceId ||\n interfaceId == type(ICreatorToken).interfaceId ||\n interfaceId == type(ILegacyCreatorToken).interfaceId ||\n interfaceId == 0x49064906 || // ERC-4906\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Internal pure function to cast a `bool` value to a `uint256` value.\n *\n * @param b The `bool` value to cast.\n *\n * @return u The `uint256` value.\n */\n function _cast(bool b) internal pure returns (uint256 u) {\n assembly {\n u := b\n }\n }\n}\n" }, "src/interfaces/INonFungibleSeaDropToken.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {\n ISeaDropTokenContractMetadata\n} from \"./ISeaDropTokenContractMetadata.sol\";\n\nimport {\n AllowListData,\n PublicDrop,\n TokenGatedDropStage,\n SignedMintValidationParams\n} from \"../lib/SeaDropStructs.sol\";\n\ninterface INonFungibleSeaDropToken is ISeaDropTokenContractMetadata {\n /**\n * @dev Revert with an error if a contract is not an allowed\n * SeaDrop address.\n */\n error OnlyAllowedSeaDrop();\n\n /**\n * @dev Emit an event when allowed SeaDrop contracts are updated.\n */\n event AllowedSeaDropUpdated(address[] allowedSeaDrop);\n\n /**\n * @notice Update the allowed SeaDrop contracts.\n * Only the owner can use this function.\n *\n * @param allowedSeaDrop The allowed SeaDrop addresses.\n */\n function updateAllowedSeaDrop(address[] calldata allowedSeaDrop) external;\n\n /**\n * @notice Mint tokens, restricted to the SeaDrop contract.\n *\n * @dev NOTE: If a token registers itself with multiple SeaDrop\n * contracts, the implementation of this function should guard\n * against reentrancy. If the implementing token uses\n * _safeMint(), or a feeRecipient with a malicious receive() hook\n * is specified, the token or fee recipients may be able to execute\n * another mint in the same transaction via a separate SeaDrop\n * contract.\n * This is dangerous if an implementing token does not correctly\n * update the minterNumMinted and currentTotalSupply values before\n * transferring minted tokens, as SeaDrop references these values\n * to enforce token limits on a per-wallet and per-stage basis.\n *\n * @param minter The address to mint to.\n * @param quantity The number of tokens to mint.\n */\n function mintSeaDrop(address minter, uint256 quantity) external;\n\n /**\n * @notice Returns a set of mint stats for the address.\n * This assists SeaDrop in enforcing maxSupply,\n * maxTotalMintableByWallet, 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 onERC721Received() hooks.\n *\n * @param minter The minter address.\n */\n function getMintStats(address minter)\n external\n view\n returns (\n uint256 minterNumMinted,\n uint256 currentTotalSupply,\n uint256 maxSupply\n );\n\n /**\n * @notice Update the public drop data for this nft contract on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param publicDrop The public drop data.\n */\n function updatePublicDrop(\n address seaDropImpl,\n PublicDrop calldata publicDrop\n ) external;\n\n /**\n * @notice Update the allow list data for this nft contract on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param allowListData The allow list data.\n */\n function updateAllowList(\n address seaDropImpl,\n AllowListData calldata allowListData\n ) external;\n\n /**\n * @notice Update the token gated drop stage data for this nft contract\n * on SeaDrop.\n * Only the owner can use this function.\n *\n * Note: If two INonFungibleSeaDropToken tokens are doing\n * simultaneous token gated drop promotions for each other,\n * they can be minted by the same actor until\n * `maxTokenSupplyForStage` is reached. Please ensure the\n * `allowedNftToken` is not running an active drop during the\n * `dropStage` time period.\n *\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param allowedNftToken The allowed nft token.\n * @param dropStage The token gated drop stage data.\n */\n function updateTokenGatedDrop(\n address seaDropImpl,\n address allowedNftToken,\n TokenGatedDropStage calldata dropStage\n ) external;\n\n /**\n * @notice Update the drop URI for this nft contract on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param dropURI The new drop URI.\n */\n function updateDropURI(address seaDropImpl, string calldata dropURI)\n external;\n\n /**\n * @notice Update the creator payout address for this nft contract on\n * SeaDrop.\n * Only the owner can set the creator payout address.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param payoutAddress The new payout address.\n */\n function updateCreatorPayoutAddress(\n address seaDropImpl,\n address payoutAddress\n ) external;\n\n /**\n * @notice Update the allowed fee recipient for this nft contract\n * on SeaDrop.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param feeRecipient The new fee recipient.\n */\n function updateAllowedFeeRecipient(\n address seaDropImpl,\n address feeRecipient,\n bool allowed\n ) external;\n\n /**\n * @notice Update the server-side signers for this nft contract\n * on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param signer The signer to update.\n * @param signedMintValidationParams Minimum and maximum parameters\n * to enforce for signed mints.\n */\n function updateSignedMintValidationParams(\n address seaDropImpl,\n address signer,\n SignedMintValidationParams memory signedMintValidationParams\n ) external;\n\n /**\n * @notice Update the allowed payers for this nft contract on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param payer The payer to update.\n * @param allowed Whether the payer is allowed.\n */\n function updatePayer(\n address seaDropImpl,\n address payer,\n bool allowed\n ) external;\n}\n" }, "src/interfaces/ISeaDrop.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {\n AllowListData,\n MintParams,\n PublicDrop,\n TokenGatedDropStage,\n TokenGatedMintParams,\n SignedMintValidationParams\n} from \"../lib/SeaDropStructs.sol\";\n\nimport { SeaDropErrorsAndEvents } from \"../lib/SeaDropErrorsAndEvents.sol\";\n\ninterface ISeaDrop is SeaDropErrorsAndEvents {\n /**\n * @notice Mint a public drop.\n *\n * @param nftContract The nft contract to mint.\n * @param feeRecipient The fee recipient.\n * @param minterIfNotPayer The mint recipient if different than the payer.\n * @param quantity The number of tokens to mint.\n */\n function mintPublic(\n address nftContract,\n address feeRecipient,\n address minterIfNotPayer,\n uint256 quantity\n ) external payable;\n\n /**\n * @notice Mint from an allow list.\n *\n * @param nftContract The nft contract to mint.\n * @param feeRecipient The fee recipient.\n * @param minterIfNotPayer The mint recipient if different than the payer.\n * @param quantity The number of tokens to mint.\n * @param mintParams The mint parameters.\n * @param proof The proof for the leaf of the allow list.\n */\n function mintAllowList(\n address nftContract,\n address feeRecipient,\n address minterIfNotPayer,\n uint256 quantity,\n MintParams calldata mintParams,\n bytes32[] calldata proof\n ) external payable;\n\n /**\n * @notice Mint with a server-side signature.\n * Note that a signature can only be used once.\n *\n * @param nftContract The nft contract to mint.\n * @param feeRecipient The fee recipient.\n * @param minterIfNotPayer The mint recipient if different than the payer.\n * @param quantity The number of tokens to mint.\n * @param mintParams The mint parameters.\n * @param salt The sale for the signed mint.\n * @param signature The server-side signature, must be an allowed\n * signer.\n */\n function mintSigned(\n address nftContract,\n address feeRecipient,\n address minterIfNotPayer,\n uint256 quantity,\n MintParams calldata mintParams,\n uint256 salt,\n bytes calldata signature\n ) external payable;\n\n /**\n * @notice Mint as an allowed token holder.\n * This will mark the token id as redeemed and will revert if the\n * same token id is attempted to be redeemed twice.\n *\n * @param nftContract The nft contract to mint.\n * @param feeRecipient The fee recipient.\n * @param minterIfNotPayer The mint recipient if different than the payer.\n * @param mintParams The token gated mint params.\n */\n function mintAllowedTokenHolder(\n address nftContract,\n address feeRecipient,\n address minterIfNotPayer,\n TokenGatedMintParams calldata mintParams\n ) external payable;\n\n /**\n * @notice Emits an event to notify update of the drop URI.\n *\n * This method assume msg.sender is an nft contract and its\n * ERC165 interface id matches INonFungibleSeaDropToken.\n *\n * Note: Be sure only authorized users can call this from\n * token contracts that implement INonFungibleSeaDropToken.\n *\n * @param dropURI The new drop URI.\n */\n function updateDropURI(string calldata dropURI) external;\n\n /**\n * @notice Updates the public drop data for the nft contract\n * and emits an event.\n *\n * This method assume msg.sender is an nft contract and its\n * ERC165 interface id matches INonFungibleSeaDropToken.\n *\n * Note: Be sure only authorized users can call this from\n * token contracts that implement INonFungibleSeaDropToken.\n *\n * @param publicDrop The public drop data.\n */\n function updatePublicDrop(PublicDrop calldata publicDrop) external;\n\n /**\n * @notice Updates the allow list merkle root for the nft contract\n * and emits an event.\n *\n * This method assume msg.sender is an nft contract and its\n * ERC165 interface id matches INonFungibleSeaDropToken.\n *\n * Note: Be sure only authorized users can call this from\n * token contracts that implement INonFungibleSeaDropToken.\n *\n * @param allowListData The allow list data.\n */\n function updateAllowList(AllowListData calldata allowListData) external;\n\n /**\n * @notice Updates the token gated drop stage for the nft contract\n * and emits an event.\n *\n * This method assume msg.sender is an nft contract and its\n * ERC165 interface id matches INonFungibleSeaDropToken.\n *\n * Note: Be sure only authorized users can call this from\n * token contracts that implement INonFungibleSeaDropToken.\n *\n * Note: If two INonFungibleSeaDropToken tokens are doing\n * simultaneous token gated drop promotions for each other,\n * they can be minted by the same actor until\n * `maxTokenSupplyForStage` is reached. Please ensure the\n * `allowedNftToken` is not running an active drop during\n * the `dropStage` time period.\n *\n * @param allowedNftToken The token gated nft token.\n * @param dropStage The token gated drop stage data.\n */\n function updateTokenGatedDrop(\n address allowedNftToken,\n TokenGatedDropStage calldata dropStage\n ) external;\n\n /**\n * @notice Updates the creator payout address and emits an event.\n *\n * This method assume msg.sender is an nft contract and its\n * ERC165 interface id matches INonFungibleSeaDropToken.\n *\n * Note: Be sure only authorized users can call this from\n * token contracts that implement INonFungibleSeaDropToken.\n *\n * @param payoutAddress The creator payout address.\n */\n function updateCreatorPayoutAddress(address payoutAddress) external;\n\n /**\n * @notice Updates the allowed fee recipient and emits an event.\n *\n * This method assume msg.sender is an nft contract and its\n * ERC165 interface id matches INonFungibleSeaDropToken.\n *\n * Note: Be sure only authorized users can call this from\n * token contracts that implement INonFungibleSeaDropToken.\n *\n * @param feeRecipient The fee recipient.\n * @param allowed If the fee recipient is allowed.\n */\n function updateAllowedFeeRecipient(address feeRecipient, bool allowed)\n external;\n\n /**\n * @notice Updates the allowed server-side signers and emits an event.\n *\n * This method assume msg.sender is an nft contract and its\n * ERC165 interface id matches INonFungibleSeaDropToken.\n *\n * Note: Be sure only authorized users can call this from\n * token contracts that implement INonFungibleSeaDropToken.\n *\n * @param signer The signer to update.\n * @param signedMintValidationParams Minimum and maximum parameters\n * to enforce for signed mints.\n */\n function updateSignedMintValidationParams(\n address signer,\n SignedMintValidationParams calldata signedMintValidationParams\n ) external;\n\n /**\n * @notice Updates the allowed payer and emits an event.\n *\n * This method assume msg.sender is an nft contract and its\n * ERC165 interface id matches INonFungibleSeaDropToken.\n *\n * Note: Be sure only authorized users can call this from\n * token contracts that implement INonFungibleSeaDropToken.\n *\n * @param payer The payer to add or remove.\n * @param allowed Whether to add or remove the payer.\n */\n function updatePayer(address payer, bool allowed) external;\n\n /**\n * @notice Returns the public drop data for the nft contract.\n *\n * @param nftContract The nft contract.\n */\n function getPublicDrop(address nftContract)\n external\n view\n returns (PublicDrop memory);\n\n /**\n * @notice Returns the creator payout address for the nft contract.\n *\n * @param nftContract The nft contract.\n */\n function getCreatorPayoutAddress(address nftContract)\n external\n view\n returns (address);\n\n /**\n * @notice Returns the allow list merkle root for the nft contract.\n *\n * @param nftContract The nft contract.\n */\n function getAllowListMerkleRoot(address nftContract)\n external\n view\n returns (bytes32);\n\n /**\n * @notice Returns if the specified fee recipient is allowed\n * for the nft contract.\n *\n * @param nftContract The nft contract.\n * @param feeRecipient The fee recipient.\n */\n function getFeeRecipientIsAllowed(address nftContract, address feeRecipient)\n external\n view\n returns (bool);\n\n /**\n * @notice Returns an enumeration of allowed fee recipients for an\n * nft contract when fee recipients are enforced\n *\n * @param nftContract The nft contract.\n */\n function getAllowedFeeRecipients(address nftContract)\n external\n view\n returns (address[] memory);\n\n /**\n * @notice Returns the server-side signers for the nft contract.\n *\n * @param nftContract The nft contract.\n */\n function getSigners(address nftContract)\n external\n view\n returns (address[] memory);\n\n /**\n * @notice Returns the struct of SignedMintValidationParams for a signer.\n *\n * @param nftContract The nft contract.\n * @param signer The signer.\n */\n function getSignedMintValidationParams(address nftContract, address signer)\n external\n view\n returns (SignedMintValidationParams memory);\n\n /**\n * @notice Returns the payers for the nft contract.\n *\n * @param nftContract The nft contract.\n */\n function getPayers(address nftContract)\n external\n view\n returns (address[] memory);\n\n /**\n * @notice Returns if the specified payer is allowed\n * for the nft contract.\n *\n * @param nftContract The nft contract.\n * @param payer The payer.\n */\n function getPayerIsAllowed(address nftContract, address payer)\n external\n view\n returns (bool);\n\n /**\n * @notice Returns the allowed token gated drop tokens for the nft contract.\n *\n * @param nftContract The nft contract.\n */\n function getTokenGatedAllowedTokens(address nftContract)\n external\n view\n returns (address[] memory);\n\n /**\n * @notice Returns the token gated drop data for the nft contract\n * and token gated nft.\n *\n * @param nftContract The nft contract.\n * @param allowedNftToken The token gated nft token.\n */\n function getTokenGatedDrop(address nftContract, address allowedNftToken)\n external\n view\n returns (TokenGatedDropStage memory);\n\n /**\n * @notice Returns whether the token id for a token gated drop has been\n * redeemed.\n *\n * @param nftContract The nft contract.\n * @param allowedNftToken The token gated nft token.\n * @param allowedNftTokenId The token gated nft token id to check.\n */\n function getAllowedNftTokenIdIsRedeemed(\n address nftContract,\n address allowedNftToken,\n uint256 allowedNftTokenId\n ) external view returns (bool);\n}\n" }, "src/lib/SeaDropStructs.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\n/**\n * @notice A struct defining public drop data.\n * Designed to fit efficiently in one storage slot.\n * \n * @param mintPrice The mint price per token. (Up to 1.2m\n * of native token, e.g. ETH, MATIC)\n * @param startTime The start time, ensure this is not zero.\n * @param endTIme The end time, ensure this is not zero.\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 mintPrice; // 80/256 bits\n uint48 startTime; // 128/256 bits\n uint48 endTime; // 176/256 bits\n uint16 maxTotalMintableByWallet; // 224/256 bits\n uint16 feeBps; // 240/256 bits\n bool restrictFeeRecipients; // 248/256 bits\n}\n\n/**\n * @notice A struct defining token gated drop stage data.\n * Designed to fit efficiently in one storage slot.\n * \n * @param mintPrice The mint price per token. (Up to 1.2m \n * of native token, e.g.: ETH, MATIC)\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 startTime The start time, ensure this is not zero.\n * @param endTime The end time, ensure this is not zero.\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\n * with index zero.\n * @param maxTokenSupplyForStage The limit of token supply this stage can\n * mint within. (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 TokenGatedDropStage {\n uint80 mintPrice; // 80/256 bits\n uint16 maxTotalMintableByWallet; // 96/256 bits\n uint48 startTime; // 144/256 bits\n uint48 endTime; // 192/256 bits\n uint8 dropStageIndex; // non-zero. 200/256 bits\n uint32 maxTokenSupplyForStage; // 232/256 bits\n uint16 feeBps; // 248/256 bits\n bool restrictFeeRecipients; // 256/256 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 mintPrice The mint price per token.\n * @param maxTotalMintableByWallet Maximum total number of mints a user is\n * allowed.\n * @param startTime The start time, ensure this is not zero.\n * @param endTime The end time, ensure this is not zero.\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 maxTokenSupplyForStage The limit of token supply this stage can\n * mint within.\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 mintPrice; \n uint256 maxTotalMintableByWallet;\n uint256 startTime;\n uint256 endTime;\n uint256 dropStageIndex; // non-zero\n uint256 maxTokenSupplyForStage;\n uint256 feeBps;\n bool restrictFeeRecipients;\n}\n\n/**\n * @notice A struct defining token gated mint params.\n * \n * @param allowedNftToken The allowed nft token contract address.\n * @param allowedNftTokenIds The token ids to redeem.\n */\nstruct TokenGatedMintParams {\n address allowedNftToken;\n uint256[] allowedNftTokenIds;\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\n/**\n * @notice A struct defining minimum and maximum parameters to validate for \n * signed mints, to minimize negative effects of a compromised signer.\n *\n * @param minMintPrice The minimum mint price allowed.\n * @param maxMaxTotalMintableByWallet The maximum total number of mints allowed\n * by a wallet.\n * @param minStartTime The minimum start time allowed.\n * @param maxEndTime The maximum end time allowed.\n * @param maxMaxTokenSupplyForStage The maximum token supply allowed.\n * @param minFeeBps The minimum fee allowed.\n * @param maxFeeBps The maximum fee allowed.\n */\nstruct SignedMintValidationParams {\n uint80 minMintPrice; // 80/256 bits\n uint24 maxMaxTotalMintableByWallet; // 104/256 bits\n uint40 minStartTime; // 144/256 bits\n uint40 maxEndTime; // 184/256 bits\n uint40 maxMaxTokenSupplyForStage; // 224/256 bits\n uint16 minFeeBps; // 240/256 bits\n uint16 maxFeeBps; // 256/256 bits\n}" }, "src/lib/ERC721SeaDropStructsErrorsAndEvents.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {\n AllowListData,\n PublicDrop,\n SignedMintValidationParams,\n TokenGatedDropStage\n} from \"./SeaDropStructs.sol\";\n\ninterface ERC721SeaDropStructsErrorsAndEvents {\n /**\n * @notice Revert with an error if mint exceeds the max supply.\n */\n error MintQuantityExceedsMaxSupply(uint256 total, uint256 maxSupply);\n\n /**\n * @notice Revert with an error if the number of token gated \n * allowedNftTokens doesn't match the length of supplied\n * drop stages.\n */\n error TokenGatedMismatch();\n\n /**\n * @notice Revert with an error if the number of signers doesn't match\n * the length of supplied signedMintValidationParams\n */\n error SignersMismatch();\n\n /**\n * @notice An event to signify that a SeaDrop token contract was deployed.\n */\n event SeaDropTokenDeployed();\n\n /**\n * @notice A struct to configure multiple contract options at a time.\n */\n struct MultiConfigureStruct {\n uint256 maxSupply;\n string baseURI;\n string contractURI;\n address seaDropImpl;\n PublicDrop publicDrop;\n string dropURI;\n AllowListData allowListData;\n address creatorPayoutAddress;\n bytes32 provenanceHash;\n\n address[] allowedFeeRecipients;\n address[] disallowedFeeRecipients;\n\n address[] allowedPayers;\n address[] disallowedPayers;\n\n // Token-gated\n address[] tokenGatedAllowedNftTokens;\n TokenGatedDropStage[] tokenGatedDropStages;\n address[] disallowedTokenGatedAllowedNftTokens;\n\n // Server-signed\n address[] signers;\n SignedMintValidationParams[] signedMintValidationParams;\n address[] disallowedSigners;\n }\n}" }, "src/clones/ERC721ACloneable.sol": { "content": "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.2.2\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport { IERC721A } from \"ERC721A/IERC721A.sol\";\n\nimport {\n Initializable\n} from \"openzeppelin-contracts-upgradeable/proxy/utils/Initializable.sol\";\n\n/**\n * @dev Interface of ERC721 token receiver.\n */\ninterface ERC721A__IERC721Receiver {\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n\n/**\n * @title ERC721A\n *\n * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)\n * Non-Fungible Token Standard, including the Metadata extension.\n * Optimized for lower gas during batch mints.\n *\n * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)\n * starting from `_startTokenId()`.\n *\n * Assumptions:\n *\n * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.\n * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).\n */\ncontract ERC721ACloneable is IERC721A, Initializable {\n // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).\n struct TokenApprovalRef {\n address value;\n }\n\n // =============================================================\n // CONSTANTS\n // =============================================================\n\n // Mask of an entry in packed address data.\n uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;\n\n // The bit position of `numberMinted` in packed address data.\n uint256 private constant _BITPOS_NUMBER_MINTED = 64;\n\n // The bit position of `numberBurned` in packed address data.\n uint256 private constant _BITPOS_NUMBER_BURNED = 128;\n\n // The bit position of `aux` in packed address data.\n uint256 private constant _BITPOS_AUX = 192;\n\n // Mask of all 256 bits in packed address data except the 64 bits for `aux`.\n uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;\n\n // The bit position of `startTimestamp` in packed ownership.\n uint256 private constant _BITPOS_START_TIMESTAMP = 160;\n\n // The bit mask of the `burned` bit in packed ownership.\n uint256 private constant _BITMASK_BURNED = 1 << 224;\n\n // The bit position of the `nextInitialized` bit in packed ownership.\n uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;\n\n // The bit mask of the `nextInitialized` bit in packed ownership.\n uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;\n\n // The bit position of `extraData` in packed ownership.\n uint256 private constant _BITPOS_EXTRA_DATA = 232;\n\n // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.\n uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;\n\n // The mask of the lower 160 bits for addresses.\n uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;\n\n // The maximum `quantity` that can be minted with {_mintERC2309}.\n // This limit is to prevent overflows on the address data entries.\n // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}\n // is required to cause an overflow, which is unrealistic.\n uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;\n\n // The `Transfer` event signature is given by:\n // `keccak256(bytes(\"Transfer(address,address,uint256)\"))`.\n bytes32 private constant _TRANSFER_EVENT_SIGNATURE =\n 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;\n\n // =============================================================\n // STORAGE\n // =============================================================\n\n // The next token ID to be minted.\n uint256 private _currentIndex;\n\n // The number of tokens burned.\n uint256 private _burnCounter;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to ownership details\n // An empty struct value does not necessarily mean the token is unowned.\n // See {_packedOwnershipOf} implementation for details.\n //\n // Bits Layout:\n // - [0..159] `addr`\n // - [160..223] `startTimestamp`\n // - [224] `burned`\n // - [225] `nextInitialized`\n // - [232..255] `extraData`\n mapping(uint256 => uint256) private _packedOwnerships;\n\n // Mapping owner address to address data.\n //\n // Bits Layout:\n // - [0..63] `balance`\n // - [64..127] `numberMinted`\n // - [128..191] `numberBurned`\n // - [192..255] `aux`\n mapping(address => uint256) private _packedAddressData;\n\n // Mapping from token ID to approved address.\n mapping(uint256 => TokenApprovalRef) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // =============================================================\n // CONSTRUCTOR\n // =============================================================\n\n function __ERC721ACloneable__init(\n string memory name_,\n string memory symbol_\n ) internal onlyInitializing {\n _name = name_;\n _symbol = symbol_;\n _currentIndex = _startTokenId();\n }\n\n // =============================================================\n // TOKEN COUNTING OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the starting token ID.\n * To change the starting token ID, please override this function.\n */\n function _startTokenId() internal view virtual returns (uint256) {\n return 0;\n }\n\n /**\n * @dev Returns the next token ID to be minted.\n */\n function _nextTokenId() internal view virtual returns (uint256) {\n return _currentIndex;\n }\n\n /**\n * @dev Returns the total number of tokens in existence.\n * Burned tokens will reduce the count.\n * To get the total number of tokens minted, please see {_totalMinted}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n // Counter underflow is impossible as _burnCounter cannot be incremented\n // more than `_currentIndex - _startTokenId()` times.\n unchecked {\n return _currentIndex - _burnCounter - _startTokenId();\n }\n }\n\n /**\n * @dev Returns the total amount of tokens minted in the contract.\n */\n function _totalMinted() internal view virtual returns (uint256) {\n // Counter underflow is impossible as `_currentIndex` does not decrement,\n // and it is initialized to `_startTokenId()`.\n unchecked {\n return _currentIndex - _startTokenId();\n }\n }\n\n /**\n * @dev Returns the total number of tokens burned.\n */\n function _totalBurned() internal view virtual returns (uint256) {\n return _burnCounter;\n }\n\n // =============================================================\n // ADDRESS DATA OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the number of tokens in `owner`'s account.\n */\n function balanceOf(address owner)\n public\n view\n virtual\n override\n returns (uint256)\n {\n if (owner == address(0)) revert BalanceQueryForZeroAddress();\n return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n /**\n * Returns the number of tokens minted by `owner`.\n */\n function _numberMinted(address owner) internal view returns (uint256) {\n return\n (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) &\n _BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n /**\n * Returns the number of tokens burned by or on behalf of `owner`.\n */\n function _numberBurned(address owner) internal view returns (uint256) {\n return\n (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) &\n _BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n /**\n * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).\n */\n function _getAux(address owner) internal view returns (uint64) {\n return uint64(_packedAddressData[owner] >> _BITPOS_AUX);\n }\n\n /**\n * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).\n * If there are multiple variables, please pack them into a uint64.\n */\n function _setAux(address owner, uint64 aux) internal virtual {\n uint256 packed = _packedAddressData[owner];\n uint256 auxCasted;\n // Cast `aux` with assembly to avoid redundant masking.\n assembly {\n auxCasted := aux\n }\n packed =\n (packed & _BITMASK_AUX_COMPLEMENT) |\n (auxCasted << _BITPOS_AUX);\n _packedAddressData[owner] = packed;\n }\n\n // =============================================================\n // IERC165\n // =============================================================\n\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30000 gas.\n */\n function supportsInterface(bytes4 interfaceId)\n public\n view\n virtual\n override\n returns (bool)\n {\n // The interface IDs are constants representing the first 4 bytes\n // of the XOR of all function selectors in the interface.\n // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)\n // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)\n return\n interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.\n interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.\n interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.\n }\n\n // =============================================================\n // IERC721Metadata\n // =============================================================\n\n /**\n * @dev Returns the token collection name.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId)\n public\n view\n virtual\n override\n returns (string memory)\n {\n if (!_exists(tokenId)) revert URIQueryForNonexistentToken();\n\n string memory baseURI = _baseURI();\n return\n bytes(baseURI).length != 0\n ? string(abi.encodePacked(baseURI, _toString(tokenId)))\n : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, it can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n // =============================================================\n // OWNERSHIPS OPERATIONS\n // =============================================================\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)\n public\n view\n virtual\n override\n returns (address)\n {\n return address(uint160(_packedOwnershipOf(tokenId)));\n }\n\n /**\n * @dev Gas spent here starts off proportional to the maximum mint batch size.\n * It gradually moves to O(1) as tokens get transferred around over time.\n */\n function _ownershipOf(uint256 tokenId)\n internal\n view\n virtual\n returns (TokenOwnership memory)\n {\n return _unpackedOwnership(_packedOwnershipOf(tokenId));\n }\n\n /**\n * @dev Returns the unpacked `TokenOwnership` struct at `index`.\n */\n function _ownershipAt(uint256 index)\n internal\n view\n virtual\n returns (TokenOwnership memory)\n {\n return _unpackedOwnership(_packedOwnerships[index]);\n }\n\n /**\n * @dev Initializes the ownership slot minted at `index` for efficiency purposes.\n */\n function _initializeOwnershipAt(uint256 index) internal virtual {\n if (_packedOwnerships[index] == 0) {\n _packedOwnerships[index] = _packedOwnershipOf(index);\n }\n }\n\n /**\n * Returns the packed ownership data of `tokenId`.\n */\n function _packedOwnershipOf(uint256 tokenId)\n private\n view\n returns (uint256)\n {\n uint256 curr = tokenId;\n\n unchecked {\n if (_startTokenId() <= curr) {\n if (curr < _currentIndex) {\n uint256 packed = _packedOwnerships[curr];\n // If not burned.\n if (packed & _BITMASK_BURNED == 0) {\n // Invariant:\n // There will always be an initialized ownership slot\n // (i.e. `ownership.addr != address(0) && ownership.burned == false`)\n // before an unintialized ownership slot\n // (i.e. `ownership.addr == address(0) && ownership.burned == false`)\n // Hence, `curr` will not underflow.\n //\n // We can directly compare the packed value.\n // If the address is zero, packed will be zero.\n while (packed == 0) {\n packed = _packedOwnerships[--curr];\n }\n return packed;\n }\n }\n }\n }\n revert OwnerQueryForNonexistentToken();\n }\n\n /**\n * @dev Returns the unpacked `TokenOwnership` struct from `packed`.\n */\n function _unpackedOwnership(uint256 packed)\n private\n pure\n returns (TokenOwnership memory ownership)\n {\n ownership.addr = address(uint160(packed));\n ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);\n ownership.burned = packed & _BITMASK_BURNED != 0;\n ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);\n }\n\n /**\n * @dev Packs ownership data into a single uint256.\n */\n function _packOwnershipData(address owner, uint256 flags)\n private\n view\n returns (uint256 result)\n {\n assembly {\n // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.\n owner := and(owner, _BITMASK_ADDRESS)\n // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.\n result := or(\n owner,\n or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)\n )\n }\n }\n\n /**\n * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.\n */\n function _nextInitializedFlag(uint256 quantity)\n private\n pure\n returns (uint256 result)\n {\n // For branchless setting of the `nextInitialized` flag.\n assembly {\n // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.\n result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))\n }\n }\n\n // =============================================================\n // APPROVAL OPERATIONS\n // =============================================================\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\n * 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) public virtual override {\n address owner = ownerOf(tokenId);\n\n if (_msgSenderERC721A() != owner) {\n if (!isApprovedForAll(owner, _msgSenderERC721A())) {\n revert ApprovalCallerNotOwnerNorApproved();\n }\n }\n\n _tokenApprovals[tokenId].value = to;\n emit Approval(owner, to, tokenId);\n }\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)\n public\n view\n virtual\n override\n returns (address)\n {\n if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();\n\n return _tokenApprovals[tokenId].value;\n }\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom}\n * 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)\n public\n virtual\n override\n {\n _operatorApprovals[_msgSenderERC721A()][operator] = approved;\n emit ApprovalForAll(_msgSenderERC721A(), operator, approved);\n }\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)\n public\n view\n virtual\n override\n returns (bool)\n {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted. See {_mint}.\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return\n _startTokenId() <= tokenId &&\n tokenId < _currentIndex && // If within bounds,\n _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.\n }\n\n /**\n * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.\n */\n function _isSenderApprovedOrOwner(\n address approvedAddress,\n address owner,\n address msgSender\n ) private pure returns (bool result) {\n assembly {\n // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.\n owner := and(owner, _BITMASK_ADDRESS)\n // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.\n msgSender := and(msgSender, _BITMASK_ADDRESS)\n // `msgSender == owner || msgSender == approvedAddress`.\n result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))\n }\n }\n\n /**\n * @dev Returns the storage slot and value for the approved address of `tokenId`.\n */\n function _getApprovedSlotAndAddress(uint256 tokenId)\n private\n view\n returns (uint256 approvedAddressSlot, address approvedAddress)\n {\n TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];\n // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.\n assembly {\n approvedAddressSlot := tokenApproval.slot\n approvedAddress := sload(approvedAddressSlot)\n }\n }\n\n // =============================================================\n // TRANSFER OPERATIONS\n // =============================================================\n\n /**\n * @dev Transfers `tokenId` 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 be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token\n * 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 ) public virtual override {\n uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\n\n if (address(uint160(prevOwnershipPacked)) != from)\n revert TransferFromIncorrectOwner();\n\n (\n uint256 approvedAddressSlot,\n address approvedAddress\n ) = _getApprovedSlotAndAddress(tokenId);\n\n // The nested ifs save around 20+ gas over a compound boolean condition.\n if (\n !_isSenderApprovedOrOwner(\n approvedAddress,\n from,\n _msgSenderERC721A()\n )\n ) {\n if (!isApprovedForAll(from, _msgSenderERC721A()))\n revert TransferCallerNotOwnerNorApproved();\n }\n\n if (to == address(0)) revert TransferToZeroAddress();\n\n _beforeTokenTransfers(from, to, tokenId, 1);\n\n // Clear approvals from the previous owner.\n assembly {\n if approvedAddress {\n // This is equivalent to `delete _tokenApprovals[tokenId]`.\n sstore(approvedAddressSlot, 0)\n }\n }\n\n // Underflow of the sender's balance is impossible because we check for\n // ownership above and the recipient's balance can't realistically overflow.\n // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.\n unchecked {\n // We can directly increment and decrement the balances.\n --_packedAddressData[from]; // Updates: `balance -= 1`.\n ++_packedAddressData[to]; // Updates: `balance += 1`.\n\n // Updates:\n // - `address` to the next owner.\n // - `startTimestamp` to the timestamp of transfering.\n // - `burned` to `false`.\n // - `nextInitialized` to `true`.\n _packedOwnerships[tokenId] = _packOwnershipData(\n to,\n _BITMASK_NEXT_INITIALIZED |\n _nextExtraData(from, to, prevOwnershipPacked)\n );\n\n // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .\n if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {\n uint256 nextTokenId = tokenId + 1;\n // If the next slot's address is zero and not burned (i.e. packed value is zero).\n if (_packedOwnerships[nextTokenId] == 0) {\n // If the next slot is within bounds.\n if (nextTokenId != _currentIndex) {\n // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.\n _packedOwnerships[nextTokenId] = prevOwnershipPacked;\n }\n }\n }\n }\n\n emit Transfer(from, to, tokenId);\n _afterTokenTransfers(from, to, tokenId, 1);\n }\n\n /**\n * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\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\n * by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement\n * {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 memory _data\n ) public virtual override {\n transferFrom(from, to, tokenId);\n if (to.code.length != 0) {\n if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {\n revert TransferToNonERC721ReceiverImplementer();\n }\n }\n }\n\n /**\n * @dev Hook that is called before a set of serially-ordered token IDs\n * are about to be transferred. This includes minting.\n * And also called before burning one token.\n *\n * `startTokenId` - the first token ID to be transferred.\n * `quantity` - the amount to be transferred.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, `tokenId` will be burned by `from`.\n * - `from` and `to` are never both zero.\n */\n function _beforeTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after a set of serially-ordered token IDs\n * have been transferred. This includes minting.\n * And also called after one token has been burned.\n *\n * `startTokenId` - the first token ID to be transferred.\n * `quantity` - the amount to be transferred.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been\n * transferred to `to`.\n * - When `from` is zero, `tokenId` has been minted for `to`.\n * - When `to` is zero, `tokenId` has been burned by `from`.\n * - `from` and `to` are never both zero.\n */\n function _afterTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n\n /**\n * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.\n *\n * `from` - Previous owner of the given token ID.\n * `to` - Target address that will receive the token.\n * `tokenId` - Token ID to be transferred.\n * `_data` - Optional data to send along with the call.\n *\n * Returns whether the call correctly returned the expected magic value.\n */\n function _checkContractOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) private returns (bool) {\n try\n ERC721A__IERC721Receiver(to).onERC721Received(\n _msgSenderERC721A(),\n from,\n tokenId,\n _data\n )\n returns (bytes4 retval) {\n return\n retval ==\n ERC721A__IERC721Receiver(to).onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert TransferToNonERC721ReceiverImplementer();\n } else {\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n\n // =============================================================\n // MINT OPERATIONS\n // =============================================================\n\n /**\n * @dev Mints `quantity` tokens and transfers them to `to`.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `quantity` must be greater than 0.\n *\n * Emits a {Transfer} event for each mint.\n */\n function _mint(address to, uint256 quantity) internal virtual {\n uint256 startTokenId = _currentIndex;\n if (quantity == 0) revert MintZeroQuantity();\n\n _beforeTokenTransfers(address(0), to, startTokenId, quantity);\n\n // Overflows are incredibly unrealistic.\n // `balance` and `numberMinted` have a maximum limit of 2**64.\n // `tokenId` has a maximum limit of 2**256.\n unchecked {\n // Updates:\n // - `balance += quantity`.\n // - `numberMinted += quantity`.\n //\n // We can directly add to the `balance` and `numberMinted`.\n _packedAddressData[to] +=\n quantity *\n ((1 << _BITPOS_NUMBER_MINTED) | 1);\n\n // Updates:\n // - `address` to the owner.\n // - `startTimestamp` to the timestamp of minting.\n // - `burned` to `false`.\n // - `nextInitialized` to `quantity == 1`.\n _packedOwnerships[startTokenId] = _packOwnershipData(\n to,\n _nextInitializedFlag(quantity) |\n _nextExtraData(address(0), to, 0)\n );\n\n uint256 toMasked;\n uint256 end = startTokenId + quantity;\n\n // Use assembly to loop and emit the `Transfer` event for gas savings.\n // The duplicated `log4` removes an extra check and reduces stack juggling.\n // The assembly, together with the surrounding Solidity code, have been\n // delicately arranged to nudge the compiler into producing optimized opcodes.\n assembly {\n // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.\n toMasked := and(to, _BITMASK_ADDRESS)\n // Emit the `Transfer` event.\n log4(\n 0, // Start of data (0, since no data).\n 0, // End of data (0, since no data).\n _TRANSFER_EVENT_SIGNATURE, // Signature.\n 0, // `address(0)`.\n toMasked, // `to`.\n startTokenId // `tokenId`.\n )\n\n // The `iszero(eq(,))` check ensures that large values of `quantity`\n // that overflows uint256 will make the loop run out of gas.\n // The compiler will optimize the `iszero` away for performance.\n for {\n let tokenId := add(startTokenId, 1)\n } iszero(eq(tokenId, end)) {\n tokenId := add(tokenId, 1)\n } {\n // Emit the `Transfer` event. Similar to above.\n log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)\n }\n }\n if (toMasked == 0) revert MintToZeroAddress();\n\n _currentIndex = end;\n }\n _afterTokenTransfers(address(0), to, startTokenId, quantity);\n }\n\n /**\n * @dev Mints `quantity` tokens and transfers them to `to`.\n *\n * This function is intended for efficient minting only during contract creation.\n *\n * It emits only one {ConsecutiveTransfer} as defined in\n * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),\n * instead of a sequence of {Transfer} event(s).\n *\n * Calling this function outside of contract creation WILL make your contract\n * non-compliant with the ERC721 standard.\n * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309\n * {ConsecutiveTransfer} event is only permissible during contract creation.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `quantity` must be greater than 0.\n *\n * Emits a {ConsecutiveTransfer} event.\n */\n function _mintERC2309(address to, uint256 quantity) internal virtual {\n uint256 startTokenId = _currentIndex;\n if (to == address(0)) revert MintToZeroAddress();\n if (quantity == 0) revert MintZeroQuantity();\n if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT)\n revert MintERC2309QuantityExceedsLimit();\n\n _beforeTokenTransfers(address(0), to, startTokenId, quantity);\n\n // Overflows are unrealistic due to the above check for `quantity` to be below the limit.\n unchecked {\n // Updates:\n // - `balance += quantity`.\n // - `numberMinted += quantity`.\n //\n // We can directly add to the `balance` and `numberMinted`.\n _packedAddressData[to] +=\n quantity *\n ((1 << _BITPOS_NUMBER_MINTED) | 1);\n\n // Updates:\n // - `address` to the owner.\n // - `startTimestamp` to the timestamp of minting.\n // - `burned` to `false`.\n // - `nextInitialized` to `quantity == 1`.\n _packedOwnerships[startTokenId] = _packOwnershipData(\n to,\n _nextInitializedFlag(quantity) |\n _nextExtraData(address(0), to, 0)\n );\n\n emit ConsecutiveTransfer(\n startTokenId,\n startTokenId + quantity - 1,\n address(0),\n to\n );\n\n _currentIndex = startTokenId + quantity;\n }\n _afterTokenTransfers(address(0), to, startTokenId, quantity);\n }\n\n /**\n * @dev Safely mints `quantity` tokens and transfers them to `to`.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement\n * {IERC721Receiver-onERC721Received}, which is called for each safe transfer.\n * - `quantity` must be greater than 0.\n *\n * See {_mint}.\n *\n * Emits a {Transfer} event for each mint.\n */\n function _safeMint(\n address to,\n uint256 quantity,\n bytes memory _data\n ) internal virtual {\n _mint(to, quantity);\n\n unchecked {\n if (to.code.length != 0) {\n uint256 end = _currentIndex;\n uint256 index = end - quantity;\n do {\n if (\n !_checkContractOnERC721Received(\n address(0),\n to,\n index++,\n _data\n )\n ) {\n revert TransferToNonERC721ReceiverImplementer();\n }\n } while (index < end);\n // Reentrancy protection.\n if (_currentIndex != end) revert();\n }\n }\n }\n\n /**\n * @dev Equivalent to `_safeMint(to, quantity, '')`.\n */\n function _safeMint(address to, uint256 quantity) internal virtual {\n _safeMint(to, quantity, \"\");\n }\n\n // =============================================================\n // BURN OPERATIONS\n // =============================================================\n\n /**\n * @dev Equivalent to `_burn(tokenId, false)`.\n */\n function _burn(uint256 tokenId) internal virtual {\n _burn(tokenId, false);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId, bool approvalCheck) internal virtual {\n uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\n\n address from = address(uint160(prevOwnershipPacked));\n\n (\n uint256 approvedAddressSlot,\n address approvedAddress\n ) = _getApprovedSlotAndAddress(tokenId);\n\n if (approvalCheck) {\n // The nested ifs save around 20+ gas over a compound boolean condition.\n if (\n !_isSenderApprovedOrOwner(\n approvedAddress,\n from,\n _msgSenderERC721A()\n )\n ) {\n if (!isApprovedForAll(from, _msgSenderERC721A()))\n revert TransferCallerNotOwnerNorApproved();\n }\n }\n\n _beforeTokenTransfers(from, address(0), tokenId, 1);\n\n // Clear approvals from the previous owner.\n assembly {\n if approvedAddress {\n // This is equivalent to `delete _tokenApprovals[tokenId]`.\n sstore(approvedAddressSlot, 0)\n }\n }\n\n // Underflow of the sender's balance is impossible because we check for\n // ownership above and the recipient's balance can't realistically overflow.\n // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.\n unchecked {\n // Updates:\n // - `balance -= 1`.\n // - `numberBurned += 1`.\n //\n // We can directly decrement the balance, and increment the number burned.\n // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.\n _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;\n\n // Updates:\n // - `address` to the last owner.\n // - `startTimestamp` to the timestamp of burning.\n // - `burned` to `true`.\n // - `nextInitialized` to `true`.\n _packedOwnerships[tokenId] = _packOwnershipData(\n from,\n (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) |\n _nextExtraData(from, address(0), prevOwnershipPacked)\n );\n\n // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .\n if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {\n uint256 nextTokenId = tokenId + 1;\n // If the next slot's address is zero and not burned (i.e. packed value is zero).\n if (_packedOwnerships[nextTokenId] == 0) {\n // If the next slot is within bounds.\n if (nextTokenId != _currentIndex) {\n // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.\n _packedOwnerships[nextTokenId] = prevOwnershipPacked;\n }\n }\n }\n }\n\n emit Transfer(from, address(0), tokenId);\n _afterTokenTransfers(from, address(0), tokenId, 1);\n\n // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.\n unchecked {\n _burnCounter++;\n }\n }\n\n // =============================================================\n // EXTRA DATA OPERATIONS\n // =============================================================\n\n /**\n * @dev Directly sets the extra data for the ownership data `index`.\n */\n function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {\n uint256 packed = _packedOwnerships[index];\n if (packed == 0) revert OwnershipNotInitializedForExtraData();\n uint256 extraDataCasted;\n // Cast `extraData` with assembly to avoid redundant masking.\n assembly {\n extraDataCasted := extraData\n }\n packed =\n (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) |\n (extraDataCasted << _BITPOS_EXTRA_DATA);\n _packedOwnerships[index] = packed;\n }\n\n /**\n * @dev Called during each token transfer to set the 24bit `extraData` field.\n * Intended to be overridden by the cosumer contract.\n *\n * `previousExtraData` - the value of `extraData` before transfer.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, `tokenId` will be burned by `from`.\n * - `from` and `to` are never both zero.\n */\n function _extraData(\n address from,\n address to,\n uint24 previousExtraData\n ) internal view virtual returns (uint24) {}\n\n /**\n * @dev Returns the next extra data for the packed ownership data.\n * The returned result is shifted into position.\n */\n function _nextExtraData(\n address from,\n address to,\n uint256 prevOwnershipPacked\n ) private view returns (uint256) {\n uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);\n return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;\n }\n\n // =============================================================\n // OTHER OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the message sender (defaults to `msg.sender`).\n *\n * If you are writing GSN compatible contracts, you need to override this function.\n */\n function _msgSenderERC721A() internal view virtual returns (address) {\n return msg.sender;\n }\n\n /**\n * @dev Converts a uint256 to its ASCII string decimal representation.\n */\n function _toString(uint256 value)\n internal\n pure\n virtual\n returns (string memory str)\n {\n assembly {\n // The maximum value of a uint256 contains 78 digits (1 byte per digit), but\n // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.\n // We will need 1 word for the trailing zeros padding, 1 word for the length,\n // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.\n let m := add(mload(0x40), 0xa0)\n // Update the free memory pointer to allocate.\n mstore(0x40, m)\n // Assign the `str` to the end.\n str := sub(m, 0x20)\n // Zeroize the slot after the string.\n mstore(str, 0)\n\n // Cache the end of the memory to calculate the length later.\n let end := str\n\n // We write the string from rightmost digit to leftmost digit.\n // The following is essentially a do-while loop that also handles the zero case.\n // prettier-ignore\n for { let temp := value } 1 {} {\n str := sub(str, 1)\n // Write the character to the pointer.\n // The ASCII index of the '0' character is 48.\n mstore8(str, add(48, mod(temp, 10)))\n // Keep dividing `temp` until zero.\n temp := div(temp, 10)\n // prettier-ignore\n if iszero(temp) { break }\n }\n\n let length := sub(end, str)\n // Move the pointer 32 bytes leftwards to make room for the length.\n str := sub(str, 0x20)\n // Store the length.\n mstore(str, length)\n }\n }\n}\n" }, "lib/openzeppelin-contracts-upgradeable/contracts/security/ReentrancyGuardUpgradeable.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (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/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" }, "src/interfaces/ISeaDropTokenContractMetadata.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport { IERC2981 } from \"openzeppelin-contracts/interfaces/IERC2981.sol\";\n\ninterface ISeaDropTokenContractMetadata is IERC2981 {\n /**\n * @notice Throw if the max supply exceeds uint64, a limit\n * due to the storage of bit-packed variables in ERC721A.\n */\n error CannotExceedMaxSupplyOfUint64(uint256 newMaxSupply);\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 if the royalty basis points is greater than 10_000.\n */\n error InvalidRoyaltyBasisPoints(uint256 basisPoints);\n\n /**\n * @dev Revert if the royalty address is being set to the zero address.\n */\n error RoyaltyAddressCannotBeZeroAddress();\n\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 when the max token supply is updated.\n */\n event MaxSupplyUpdated(uint256 newMaxSupply);\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 royalties info is updated.\n */\n event RoyaltyInfoUpdated(address receiver, uint256 bps);\n\n /**\n * @notice A struct defining royalty info for the contract.\n */\n struct RoyaltyInfo {\n address royaltyAddress;\n uint96 royaltyBps;\n }\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 max supply and emits an event.\n *\n * @param newMaxSupply The new max supply to set.\n */\n function setMaxSupply(uint256 newMaxSupply) 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 address and basis points for royalties.\n *\n * @param newInfo The struct to configure royalties.\n */\n function setRoyaltyInfo(RoyaltyInfo calldata newInfo) 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 max token supply.\n */\n function maxSupply() external view returns (uint256);\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 /**\n * @notice Returns the address that receives royalties.\n */\n function royaltyAddress() external view returns (address);\n\n /**\n * @notice Returns the royalty basis points out of 10_000.\n */\n function royaltyBasisPoints() external view returns (uint256);\n}\n" }, "src/clones/ERC721AConduitPreapprovedCloneable.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport { ERC721ACloneable } from \"./ERC721ACloneable.sol\";\n\n/**\n * @title ERC721AConduitPreapprovedCloneable\n * @notice ERC721A with the OpenSea conduit preapproved.\n */\nabstract contract ERC721AConduitPreapprovedCloneable is ERC721ACloneable {\n /// @dev The canonical OpenSea conduit.\n address internal constant _CONDUIT =\n 0x1E0049783F008A0085193E00003D00cd54003c71;\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the\n * assets of `owner`. Always returns true for the conduit.\n */\n function isApprovedForAll(address owner, address operator)\n public\n view\n virtual\n override\n returns (bool)\n {\n if (operator == _CONDUIT) {\n return true;\n }\n return ERC721ACloneable.isApprovedForAll(owner, operator);\n }\n}\n" }, "src/lib/ERC721TransferValidator.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport { ICreatorToken } from \"../interfaces/ICreatorToken.sol\";\n\n/**\n * @title ERC721TransferValidator\n * @notice Functionality to use a transfer validator.\n */\nabstract contract ERC721TransferValidator 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" }, "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" }, "lib/utility-contracts/src/TwoStepOwnable.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport {ConstructorInitializable} from \"./ConstructorInitializable.sol\";\n\n/**\n@notice A two-step extension of Ownable, where the new owner must claim ownership of the contract after owner initiates transfer\nOwner can cancel the transfer at any point before the new owner claims ownership.\nHelpful in guarding against transferring ownership to an address that is unable to act as the Owner.\n*/\nabstract contract TwoStepOwnable is ConstructorInitializable {\n address private _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n address internal potentialOwner;\n\n event PotentialOwnerUpdated(address newPotentialAdministrator);\n\n error NewOwnerIsZeroAddress();\n error NotNextOwner();\n error OnlyOwner();\n\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n constructor() {\n _initialize();\n }\n\n function _initialize() private onlyConstructor {\n _transferOwnership(msg.sender);\n }\n\n ///@notice Initiate ownership transfer to newPotentialOwner. Note: new owner will have to manually acceptOwnership\n ///@param newPotentialOwner address of potential new owner\n function transferOwnership(address newPotentialOwner)\n public\n virtual\n onlyOwner\n {\n if (newPotentialOwner == address(0)) {\n revert NewOwnerIsZeroAddress();\n }\n potentialOwner = newPotentialOwner;\n emit PotentialOwnerUpdated(newPotentialOwner);\n }\n\n ///@notice Claim ownership of smart contract, after the current owner has initiated the process with transferOwnership\n function acceptOwnership() public virtual {\n address _potentialOwner = potentialOwner;\n if (msg.sender != _potentialOwner) {\n revert NotNextOwner();\n }\n delete potentialOwner;\n emit PotentialOwnerUpdated(address(0));\n _transferOwnership(_potentialOwner);\n }\n\n ///@notice cancel ownership transfer\n function cancelOwnershipTransfer() public virtual onlyOwner {\n delete potentialOwner;\n emit PotentialOwnerUpdated(address(0));\n }\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 != msg.sender) {\n revert OnlyOwner();\n }\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing 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 * 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" }, "lib/openzeppelin-contracts/contracts/interfaces/IERC2981.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Interface for the NFT Royalty Standard.\n *\n * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal\n * support for royalty payments across all NFT marketplaces and ecosystem participants.\n *\n * _Available since v4.5._\n */\ninterface IERC2981 is IERC165 {\n /**\n * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of\n * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.\n */\n function royaltyInfo(uint256 tokenId, uint256 salePrice)\n external\n view\n returns (address receiver, uint256 royaltyAmount);\n}\n" }, "src/lib/SeaDropErrorsAndEvents.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport { PublicDrop, TokenGatedDropStage, SignedMintValidationParams } from \"./SeaDropStructs.sol\";\n\ninterface SeaDropErrorsAndEvents {\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 is zero.\n */\n error MintQuantityCannotBeZero();\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();\n\n /**\n * @dev Revert if the creator payout address is the zero address.\n */\n error CreatorPayoutAddressCannotBeZeroAddress();\n\n /**\n * @dev Revert with an error if the received payment is incorrect.\n */\n error IncorrectPayment(uint256 got, uint256 want);\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 signer's signature is invalid.\n */\n error InvalidSignature(address recoveredSigner);\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 * Note: only applies when adding a single payer, as duplicates in\n * enumeration can be removed with updatePayer.\n */\n error DuplicatePayer();\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();\n\n /**\n * @dev Revert if a supplied payer address is the zero address.\n */\n error PayerCannotBeZeroAddress();\n\n /**\n * @dev Revert with an error if the sender does not\n * match the INonFungibleSeaDropToken interface.\n */\n error OnlyINonFungibleSeaDropToken(address sender);\n\n /**\n * @dev Revert with an error if the sender of a token gated supplied\n * drop stage redeem is not the owner of the token.\n */\n error TokenGatedNotTokenOwner(\n address nftContract,\n address allowedNftToken,\n uint256 allowedNftTokenId\n );\n\n /**\n * @dev Revert with an error if the token id has already been used to\n * redeem a token gated drop stage.\n */\n error TokenGatedTokenIdAlreadyRedeemed(\n address nftContract,\n address allowedNftToken,\n uint256 allowedNftTokenId\n );\n\n /**\n * @dev Revert with an error if an empty TokenGatedDropStage is provided\n * for an already-empty TokenGatedDropStage.\n */\n error TokenGatedDropStageNotPresent();\n\n /**\n * @dev Revert with an error if an allowedNftToken is set to\n * the zero address.\n */\n error TokenGatedDropAllowedNftTokenCannotBeZeroAddress();\n\n /**\n * @dev Revert with an error if an allowedNftToken is set to\n * the drop token itself.\n */\n error TokenGatedDropAllowedNftTokenCannotBeDropToken();\n\n\n /**\n * @dev Revert with an error if supplied signed mint price is less than\n * the minimum specified.\n */\n error InvalidSignedMintPrice(uint256 got, uint256 minimum);\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 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 An event with details of a SeaDrop mint, for analytical purposes.\n * \n * @param nftContract The nft contract.\n * @param minter The mint recipient.\n * @param feeRecipient The fee recipient.\n * @param payer The address who payed for the tx.\n * @param quantityMinted The number of tokens minted.\n * @param unitMintPrice The amount paid for each token.\n * @param feeBps The fee out of 10_000 basis points collected.\n * @param dropStageIndex The drop stage index. Items minted\n * through mintPublic() have\n * dropStageIndex of 0.\n */\n event SeaDropMint(\n address indexed nftContract,\n address indexed minter,\n address indexed feeRecipient,\n address payer,\n uint256 quantityMinted,\n uint256 unitMintPrice,\n uint256 feeBps,\n uint256 dropStageIndex\n );\n\n /**\n * @dev An event with updated public drop data for an nft contract.\n */\n event PublicDropUpdated(\n address indexed nftContract,\n PublicDrop publicDrop\n );\n\n /**\n * @dev An event with updated token gated drop stage data\n * for an nft contract.\n */\n event TokenGatedDropStageUpdated(\n address indexed nftContract,\n address indexed allowedNftToken,\n TokenGatedDropStage dropStage\n );\n\n /**\n * @dev An event with updated allow list data for an nft contract.\n * \n * @param nftContract The nft contract.\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 address indexed nftContract,\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 for an nft contract.\n */\n event DropURIUpdated(address indexed nftContract, string newDropURI);\n\n /**\n * @dev An event with the updated creator payout address for an nft\n * contract.\n */\n event CreatorPayoutAddressUpdated(\n address indexed nftContract,\n address indexed newPayoutAddress\n );\n\n /**\n * @dev An event with the updated allowed fee recipient for an nft\n * contract.\n */\n event AllowedFeeRecipientUpdated(\n address indexed nftContract,\n address indexed feeRecipient,\n bool indexed allowed\n );\n\n /**\n * @dev An event with the updated validation parameters for server-side\n * signers.\n */\n event SignedMintValidationParamsUpdated(\n address indexed nftContract,\n address indexed signer,\n SignedMintValidationParams signedMintValidationParams\n ); \n\n /**\n * @dev An event with the updated payer for an nft contract.\n */\n event PayerUpdated(\n address indexed nftContract,\n address indexed payer,\n bool indexed allowed\n );\n}\n" }, "lib/ERC721A/contracts/IERC721A.sol": { "content": "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.2.2\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\n/**\n * @dev Interface of ERC721A.\n */\ninterface IERC721A {\n /**\n * The caller must own the token or be an approved operator.\n */\n error ApprovalCallerNotOwnerNorApproved();\n\n /**\n * The token does not exist.\n */\n error ApprovalQueryForNonexistentToken();\n\n /**\n * Cannot query the balance for the zero address.\n */\n error BalanceQueryForZeroAddress();\n\n /**\n * Cannot mint to the zero address.\n */\n error MintToZeroAddress();\n\n /**\n * The quantity of tokens minted must be more than zero.\n */\n error MintZeroQuantity();\n\n /**\n * The token does not exist.\n */\n error OwnerQueryForNonexistentToken();\n\n /**\n * The caller must own the token or be an approved operator.\n */\n error TransferCallerNotOwnerNorApproved();\n\n /**\n * The token must be owned by `from`.\n */\n error TransferFromIncorrectOwner();\n\n /**\n * Cannot safely transfer to a contract that does not implement the\n * ERC721Receiver interface.\n */\n error TransferToNonERC721ReceiverImplementer();\n\n /**\n * Cannot transfer to the zero address.\n */\n error TransferToZeroAddress();\n\n /**\n * The token does not exist.\n */\n error URIQueryForNonexistentToken();\n\n /**\n * The `quantity` minted with ERC2309 exceeds the safety limit.\n */\n error MintERC2309QuantityExceedsLimit();\n\n /**\n * The `extraData` cannot be set on an unintialized ownership slot.\n */\n error OwnershipNotInitializedForExtraData();\n\n // =============================================================\n // STRUCTS\n // =============================================================\n\n struct TokenOwnership {\n // The address of the owner.\n address addr;\n // Stores the start time of ownership with minimal overhead for tokenomics.\n uint64 startTimestamp;\n // Whether the token has been burned.\n bool burned;\n // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.\n uint24 extraData;\n }\n\n // =============================================================\n // TOKEN COUNTERS\n // =============================================================\n\n /**\n * @dev Returns the total number of tokens in existence.\n * Burned tokens will reduce the count.\n * To get the total number of tokens minted, please see {_totalMinted}.\n */\n function totalSupply() external view returns (uint256);\n\n // =============================================================\n // IERC165\n // =============================================================\n\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n\n // =============================================================\n // IERC721\n // =============================================================\n\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\n * (`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`,\n * checking first that contract recipients are aware of the ERC721 protocol\n * 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\n * this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement\n * {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 /**\n * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom}\n * 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\n * 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\n * 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 Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom}\n * 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 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 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 // IERC721Metadata\n // =============================================================\n\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n\n // =============================================================\n // IERC2309\n // =============================================================\n\n /**\n * @dev Emitted when tokens in `fromTokenId` to `toTokenId`\n * (inclusive) is transferred from `from` to `to`, as defined in the\n * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.\n *\n * See {_mintERC2309} for more details.\n */\n event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);\n}\n" }, "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.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 * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\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 Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" }, "lib/utility-contracts/src/ConstructorInitializable.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\n/**\n * @author emo.eth\n * @notice Abstract smart contract that provides an onlyUninitialized modifier which only allows calling when\n * from within a constructor of some sort, whether directly instantiating an inherting contract,\n * or when delegatecalling from a proxy\n */\nabstract contract ConstructorInitializable {\n error AlreadyInitialized();\n\n modifier onlyConstructor() {\n if (address(this).code.length != 0) {\n revert AlreadyInitialized();\n }\n _;\n }\n}\n" }, "lib/openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.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 *\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.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 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(\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 (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 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": { "remappings": [ "ERC721A/=lib/ERC721A/contracts/", "ERC721A-Upgradeable/=lib/ERC721A-Upgradeable/contracts/", "ds-test/=lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "murky/=lib/murky/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "operator-filter-registry/=lib/operator-filter-registry/src/", "seadrop/=src/", "solmate/=lib/solmate/src/", "utility-contracts/=lib/utility-contracts/src/", "create2-scripts/=lib/create2-helpers/script/", "@openzeppelin/=lib/seaport/lib/openzeppelin-contracts/", "@rari-capital/solmate/=lib/seaport/lib/solmate/", "create2-helpers/=lib/create2-helpers/", "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/", "seaport-core/=lib/seaport/lib/seaport-core/", "seaport-sol/=lib/seaport/lib/seaport-sol/", "seaport-types/=lib/seaport/lib/seaport-types/", "seaport/=lib/seaport/", "solady/=lib/solady/", "solarray/=lib/seaport/lib/solarray/src/" ], "optimizer": { "enabled": true, "runs": 1000000 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "none" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "viaIR": false, "libraries": {} } }}
1
20,291,043
54e9e0e1bbbc11f7e1fd9142491080d748e2664c2b5b76a56f213bbcda52b041
01d2682dc30d0352b22fdb0c3990c35a0a0fe68017c96f79ab83214fc0e612b2
bb25b790a629d948aab8474f12e4448d064f6b09
5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f
8e07824021b06956f7bfb224bd3b11fb7c38c57b
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,291,043
54e9e0e1bbbc11f7e1fd9142491080d748e2664c2b5b76a56f213bbcda52b041
4d3df07873ba690a39d55d45647a7fa61f8f037d25a4f97e16c116158232ecae
a7fb5ca286fc3fd67525629048a4de3ba24cba2e
c77ad0a71008d7094a62cfbd250a2eb2afdf2776
84df97aa67b4a8ff333e241e6acc6bc64ff8bf3e
608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe
1
20,291,043
54e9e0e1bbbc11f7e1fd9142491080d748e2664c2b5b76a56f213bbcda52b041
e9ba001bc1167a323ef3c4472a46071a63f5d65a8a722f866ca5577aac91f717
c9aad2fc90eddacf02bd11fa690e3b44e318aa9b
a2a1bf5a83f9daec2dc364e1c561e937163cb613
46bc0d4d2808b90a12f20f40e803f5e9c2565195
3d602d80600a3d3981f3363d3d373d3d3d363d7387ae9be718aa310323042ab9806bd6692c1129b75af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7387ae9be718aa310323042ab9806bd6692c1129b75af43d82803e903d91602b57fd5bf3
1
20,291,046
f9fff43af9c44c1b8ce9ce0a0fee7550c4fbd19710748650de9fd7ff826219c3
8c5aba820a77cb3f13efd34a5e8f5dc595c2ef8e9963a0db07ea7a1041ed86c7
9a4ab43457b59ae507e37af09020121a81f257f3
9a4ab43457b59ae507e37af09020121a81f257f3
7dafaf13db416906536e2537d531cc0ae9b93945
608060405234801561001057600080fd5b506102c7806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806306b034e91461003b5780635270312a1461006c575b600080fd5b61005560048036038101906100509190610167565b61009d565b6040516100639291906101d1565b60405180910390f35b61008660048036038101906100819190610167565b6100fa565b6040516100949291906101d1565b60405180910390f35b600080837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6100cc9190610229565b8311156100e05760006001915091506100f3565b82846100ec919061025d565b6000915091505b9250929050565b60008083831115610112576000600191509150610125565b828461011e9190610229565b6000915091505b9250929050565b600080fd5b6000819050919050565b61014481610131565b811461014f57600080fd5b50565b6000813590506101618161013b565b92915050565b6000806040838503121561017e5761017d61012c565b5b600061018c85828601610152565b925050602061019d85828601610152565b9150509250929050565b6101b081610131565b82525050565b60008115159050919050565b6101cb816101b6565b82525050565b60006040820190506101e660008301856101a7565b6101f360208301846101c2565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061023482610131565b915061023f83610131565b9250828203905081811115610257576102566101fa565b5b92915050565b600061026882610131565b915061027383610131565b925082820190508082111561028b5761028a6101fa565b5b9291505056fea2646970667358221220c59dad856478b46096724cb924118347f31464a9c80a24e784bfb365aef8f9e564736f6c63430008110033
608060405234801561001057600080fd5b50600436106100365760003560e01c806306b034e91461003b5780635270312a1461006c575b600080fd5b61005560048036038101906100509190610167565b61009d565b6040516100639291906101d1565b60405180910390f35b61008660048036038101906100819190610167565b6100fa565b6040516100949291906101d1565b60405180910390f35b600080837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6100cc9190610229565b8311156100e05760006001915091506100f3565b82846100ec919061025d565b6000915091505b9250929050565b60008083831115610112576000600191509150610125565b828461011e9190610229565b6000915091505b9250929050565b600080fd5b6000819050919050565b61014481610131565b811461014f57600080fd5b50565b6000813590506101618161013b565b92915050565b6000806040838503121561017e5761017d61012c565b5b600061018c85828601610152565b925050602061019d85828601610152565b9150509250929050565b6101b081610131565b82525050565b60008115159050919050565b6101cb816101b6565b82525050565b60006040820190506101e660008301856101a7565b6101f360208301846101c2565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061023482610131565b915061023f83610131565b9250828203905081811115610257576102566101fa565b5b92915050565b600061026882610131565b915061027383610131565b925082820190508082111561028b5761028a6101fa565b5b9291505056fea2646970667358221220c59dad856478b46096724cb924118347f31464a9c80a24e784bfb365aef8f9e564736f6c63430008110033
1
20,291,060
03c45ea90baf5d359c04013e868d0056caf16acee51c4430d9c84ea3cda98599
e2aa844de1d13e99d37dff680b93af7b29155e2626b90074bfc36f3ed20a03f9
24b5c4b0571fc59220853641f81014a9ed280af6
5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f
18aa074ca80ffaf28aa0353a6dd2e528c9d6fc6b
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,291,061
af9037bb1643ff75fbcfff34bcab7dda628a3dd85908ed775396bcbc35dd18ed
e89536552cfaa68859698ba534f05c9ebcad90f88ac22590f314ff265de81502
2e05a304d3040f1399c8c20d2a9f659ae7521058
5be1de8021cc883456fd11dc5cd3806dbc48d304
a62f76174588e086295deca261a1069092799773
608060405273af1931c20ee0c11bea17a41bfbbad299b2763bc06000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600047905060008111156100cf576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156100cd573d6000803e3d6000fd5b505b5060b4806100de6000396000f3fe6080604052600047905060008111601557600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015607b573d6000803e3d6000fd5b505000fea265627a7a72315820b3e69ef9c4f661d59ada7e4a2a73e978652e4bfd9ebdfca6642edb185642883c64736f6c63430005110032
6080604052600047905060008111601557600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015607b573d6000803e3d6000fd5b505000fea265627a7a72315820b3e69ef9c4f661d59ada7e4a2a73e978652e4bfd9ebdfca6642edb185642883c64736f6c63430005110032
1
20,291,066
dd250de4299c01ba53b6d8322678d03cfdf15eb6db9f01edb160db99f156235a
3d1a40fc42f8a20b4488a627b90b395f2e303e7c33c10d9ad9ec8bd407e957fc
2e05a304d3040f1399c8c20d2a9f659ae7521058
5be1de8021cc883456fd11dc5cd3806dbc48d304
ed749d782c9fa2525cadbb28e75d3e3fefbc8409
608060405273af1931c20ee0c11bea17a41bfbbad299b2763bc06000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600047905060008111156100cf576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156100cd573d6000803e3d6000fd5b505b5060b4806100de6000396000f3fe6080604052600047905060008111601557600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015607b573d6000803e3d6000fd5b505000fea265627a7a72315820b3e69ef9c4f661d59ada7e4a2a73e978652e4bfd9ebdfca6642edb185642883c64736f6c63430005110032
6080604052600047905060008111601557600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015607b573d6000803e3d6000fd5b505000fea265627a7a72315820b3e69ef9c4f661d59ada7e4a2a73e978652e4bfd9ebdfca6642edb185642883c64736f6c63430005110032
1
20,291,069
1bd4f8a5c63411b1b8a2f12fd0d8180f4385e53d6e1212735143925fea4611eb
c08ef736fac04741b4f5cf14116e2c6e229d537004e59e2008db78dd1bfcab8f
0000db5c8b030ae20308ac975898e09741e70000
ed0e416e0feea5b484ba5c95d375545ac2b60572
05314c91a2b88a3857ff3692df2fa500b59496a0
608060405234801561001057600080fd5b50604051610a1a380380610a1a8339818101604052810190610032919061011c565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550326000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610149565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100e9826100be565b9050919050565b6100f9816100de565b811461010457600080fd5b50565b600081519050610116816100f0565b92915050565b600060208284031215610132576101316100b9565b5b600061014084828501610107565b91505092915050565b6108c2806101586000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063caa5c23f1461003b578063cce3d5d314610057575b600080fd5b610055600480360381019061005091906105fa565b610073565b005b610071600480360381019061006c9190610679565b6101ca565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f890610703565b60405180910390fd5b60005b81518110156101c6578181815181106101205761011f610723565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1682828151811061015557610154610723565b5b60200260200101516020015160405161016e91906107c3565b6000604051808303816000865af19150503d80600081146101ab576040519150601f19603f3d011682016040523d82523d6000602084013e6101b0565b606091505b50505080806101be90610809565b915050610104565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024f90610703565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160405161029e90610877565b60006040518083038185875af1925050503d80600081146102db576040519150601f19603f3d011682016040523d82523d6000602084013e6102e0565b606091505b50505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610348826102ff565b810181811067ffffffffffffffff8211171561036757610366610310565b5b80604052505050565b600061037a6102e6565b9050610386828261033f565b919050565b600067ffffffffffffffff8211156103a6576103a5610310565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f1826103c6565b9050919050565b610401816103e6565b811461040c57600080fd5b50565b60008135905061041e816103f8565b92915050565b600080fd5b600067ffffffffffffffff82111561044457610443610310565b5b61044d826102ff565b9050602081019050919050565b82818337600083830152505050565b600061047c61047784610429565b610370565b90508281526020810184848401111561049857610497610424565b5b6104a384828561045a565b509392505050565b600082601f8301126104c0576104bf6102fa565b5b81356104d0848260208601610469565b91505092915050565b6000604082840312156104ef576104ee6103bc565b5b6104f96040610370565b905060006105098482850161040f565b600083015250602082013567ffffffffffffffff81111561052d5761052c6103c1565b5b610539848285016104ab565b60208301525092915050565b60006105586105538461038b565b610370565b9050808382526020820190506020840283018581111561057b5761057a6103b7565b5b835b818110156105c257803567ffffffffffffffff8111156105a05761059f6102fa565b5b8086016105ad89826104d9565b8552602085019450505060208101905061057d565b5050509392505050565b600082601f8301126105e1576105e06102fa565b5b81356105f1848260208601610545565b91505092915050565b6000602082840312156106105761060f6102f0565b5b600082013567ffffffffffffffff81111561062e5761062d6102f5565b5b61063a848285016105cc565b91505092915050565b6000819050919050565b61065681610643565b811461066157600080fd5b50565b6000813590506106738161064d565b92915050565b60006020828403121561068f5761068e6102f0565b5b600061069d84828501610664565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000600082015250565b60006106ed6017836106a6565b91506106f8826106b7565b602082019050919050565b6000602082019050818103600083015261071c816106e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561078657808201518184015260208101905061076b565b60008484015250505050565b600061079d82610752565b6107a7818561075d565b93506107b7818560208601610768565b80840191505092915050565b60006107cf8284610792565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061081482610643565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610846576108456107da565b5b600182019050919050565b50565b600061086160008361075d565b915061086c82610851565b600082019050919050565b600061088282610854565b915081905091905056fea264697066735822122036692b46567a60a4f6844f8be0961cccba9ff2777bd37b4ea35791aba4c5159b64736f6c63430008120033000000000000000000000000000037bb05b2cef17c6469f4bcdb198826ce0000
608060405234801561001057600080fd5b50600436106100365760003560e01c8063caa5c23f1461003b578063cce3d5d314610057575b600080fd5b610055600480360381019061005091906105fa565b610073565b005b610071600480360381019061006c9190610679565b6101ca565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f890610703565b60405180910390fd5b60005b81518110156101c6578181815181106101205761011f610723565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1682828151811061015557610154610723565b5b60200260200101516020015160405161016e91906107c3565b6000604051808303816000865af19150503d80600081146101ab576040519150601f19603f3d011682016040523d82523d6000602084013e6101b0565b606091505b50505080806101be90610809565b915050610104565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024f90610703565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160405161029e90610877565b60006040518083038185875af1925050503d80600081146102db576040519150601f19603f3d011682016040523d82523d6000602084013e6102e0565b606091505b50505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610348826102ff565b810181811067ffffffffffffffff8211171561036757610366610310565b5b80604052505050565b600061037a6102e6565b9050610386828261033f565b919050565b600067ffffffffffffffff8211156103a6576103a5610310565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f1826103c6565b9050919050565b610401816103e6565b811461040c57600080fd5b50565b60008135905061041e816103f8565b92915050565b600080fd5b600067ffffffffffffffff82111561044457610443610310565b5b61044d826102ff565b9050602081019050919050565b82818337600083830152505050565b600061047c61047784610429565b610370565b90508281526020810184848401111561049857610497610424565b5b6104a384828561045a565b509392505050565b600082601f8301126104c0576104bf6102fa565b5b81356104d0848260208601610469565b91505092915050565b6000604082840312156104ef576104ee6103bc565b5b6104f96040610370565b905060006105098482850161040f565b600083015250602082013567ffffffffffffffff81111561052d5761052c6103c1565b5b610539848285016104ab565b60208301525092915050565b60006105586105538461038b565b610370565b9050808382526020820190506020840283018581111561057b5761057a6103b7565b5b835b818110156105c257803567ffffffffffffffff8111156105a05761059f6102fa565b5b8086016105ad89826104d9565b8552602085019450505060208101905061057d565b5050509392505050565b600082601f8301126105e1576105e06102fa565b5b81356105f1848260208601610545565b91505092915050565b6000602082840312156106105761060f6102f0565b5b600082013567ffffffffffffffff81111561062e5761062d6102f5565b5b61063a848285016105cc565b91505092915050565b6000819050919050565b61065681610643565b811461066157600080fd5b50565b6000813590506106738161064d565b92915050565b60006020828403121561068f5761068e6102f0565b5b600061069d84828501610664565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000600082015250565b60006106ed6017836106a6565b91506106f8826106b7565b602082019050919050565b6000602082019050818103600083015261071c816106e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561078657808201518184015260208101905061076b565b60008484015250505050565b600061079d82610752565b6107a7818561075d565b93506107b7818560208601610768565b80840191505092915050565b60006107cf8284610792565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061081482610643565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610846576108456107da565b5b600182019050919050565b50565b600061086160008361075d565b915061086c82610851565b600082019050919050565b600061088282610854565b915081905091905056fea264697066735822122036692b46567a60a4f6844f8be0961cccba9ff2777bd37b4ea35791aba4c5159b64736f6c63430008120033
1
20,291,070
35ffabb7594159415019818a1159a4043b4da1210af7062feb4e00bb9a717d22
a5c8a8d29c82eab49ec7b19aacd20f7e4d7bb6d0b22f6796ade0863d7ca27586
c371e50664e42cf9bb676f18ad15071ade842e3d
5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f
c4201bfeefd9a08f58c5e2d0877f788167e07666
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,291,071
1710e206a146d4b669fb12439f90739b340576ad6bc57d6acb7b7ef50ceb8f4c
a348c9c29c9f30a93d8f36cb0c0bd1ed0624cf53c5f0dcddc5ec5568f3158806
d2c82f2e5fa236e114a81173e375a73664610998
ffa397285ce46fb78c588a9e993286aac68c37cd
4f9684bc6c01a8d664143e3c6aed4da2e6b02d8c
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,291,074
5736dd3dfb609802a117b3375de6865948c766fa189f3d62ea4301623809ba55
c63d070addab02c57302464825a1039f3a68608187a371beece5dd19a7e9479f
a7fb5ca286fc3fd67525629048a4de3ba24cba2e
c77ad0a71008d7094a62cfbd250a2eb2afdf2776
0c28149b07e06e66f7da897c2fc0d1983e195b2b
608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe
1
20,291,076
2eb57ea1600891afccdb5229de9230434468bd57cb1cafbdf8e438374909e796
7f4710130b58fce5fc656eb066d94e411ae24e204fa72e5cb019f33c0f37b9a4
c9aad2fc90eddacf02bd11fa690e3b44e318aa9b
a2a1bf5a83f9daec2dc364e1c561e937163cb613
16ae268296c79bb4fd30d67bc6a07c487bb821da
3d602d80600a3d3981f3363d3d373d3d3d363d7387ae9be718aa310323042ab9806bd6692c1129b75af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7387ae9be718aa310323042ab9806bd6692c1129b75af43d82803e903d91602b57fd5bf3
1
20,291,080
d13a853c243f3ada033bcc9b3301ab90502e0ad74ca6fd4020f6cb0b46324fd8
5f87a56f598fd26a2c4d308e6eaa0a0c36e224d9167530754aeb0f1957a9c663
051c42ee7a529410a10e5ec11b9e9b8ba7cbb795
66807b5598a848602734b82e432dd88dbe13fc8f
e31855fae80b65e3332c96d1ec6f3f25d52dc997
3d602d80600a3d3981f3363d3d373d3d3d363d73c19cf0eaa43ee080c3cb8fb7db388091d3a13eb75af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d73c19cf0eaa43ee080c3cb8fb7db388091d3a13eb75af43d82803e903d91602b57fd5bf3
{{ "language": "Solidity", "sources": { "/contracts/StashTokenWrapper.sol": { "content": "// SPDX-License-Identifier: MIT\r\npragma solidity 0.6.12;\r\n\r\nimport \"./interfaces/IBooster.sol\";\r\nimport '@openzeppelin/contracts/token/ERC20/ERC20.sol';\r\nimport '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';\r\n\r\ncontract StashTokenWrapper {\r\n using SafeERC20 for ERC20;\r\n\r\n address public constant booster = address(0xF403C135812408BFbE8713b5A23a04b3D48AAE31);\r\n\r\n address public token;\r\n address public rewardPool;\r\n bool public isInvalid;\r\n\r\n constructor() public{}\r\n\r\n function init(address _token, address _rewardpool) external{\r\n require(token == address(0), \"init\");\r\n\r\n token = _token;\r\n rewardPool = _rewardpool;\r\n }\r\n\r\n function name() external view returns (string memory) {\r\n return ERC20(token).name();\r\n }\r\n\r\n function symbol() external view returns (string memory) {\r\n return ERC20(token).symbol();\r\n }\r\n\r\n function decimals() external view returns (uint8) {\r\n return ERC20(token).decimals();\r\n }\r\n\r\n function totalSupply() public view returns (uint256) {\r\n return ERC20(token).balanceOf(address(this));\r\n }\r\n\r\n function balanceOf(address _account) external view returns (uint256) {\r\n if(_account == rewardPool){\r\n return totalSupply();\r\n }\r\n return 0;\r\n }\r\n\r\n function transfer(address _recipient, uint256 _amount) external returns (bool) {\r\n if(msg.sender == rewardPool){\r\n ERC20(token).safeTransfer(_recipient, _amount);\r\n }\r\n return true;\r\n }\r\n\r\n function setInvalid(bool _isInvalid) external{\r\n require(IBooster(booster).owner() == msg.sender, \"!owner\");\r\n\r\n isInvalid = _isInvalid;\r\n }\r\n\r\n}\r\n" }, "/contracts/interfaces/IBooster.sol": { "content": "// SPDX-License-Identifier: MIT\r\npragma solidity 0.6.12;\r\n\r\ninterface IBooster {\r\n function owner() external view returns(address);\r\n function setVoteDelegate(address _voteDelegate) external;\r\n function vote(uint256 _voteId, address _votingAddress, bool _support) external returns(bool);\r\n function voteGaugeWeight(address[] calldata _gauge, uint256[] calldata _weight ) external returns(bool);\r\n function poolInfo(uint256 _pid) external view returns(address _lptoken, address _token, address _gauge, address _crvRewards, address _stash, bool _shutdown);\r\n}" }, "@openzeppelin/contracts/utils/Context.sol": { "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <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 GSN 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 payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n" }, "@openzeppelin/contracts/utils/Address.sol": { "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <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 // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\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 // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\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(address target, bytes memory data, string memory errorMessage) 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(address target, bytes memory data, uint256 value, string memory errorMessage) 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 // solhint-disable-next-line avoid-low-level-calls\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(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\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(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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 // solhint-disable-next-line no-inline-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}\n" }, "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": { "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.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 SafeMath for uint256;\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 // solhint-disable-next-line max-line-length\n require((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).add(value);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\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) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" }, "@openzeppelin/contracts/token/ERC20/IERC20.sol": { "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <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(address sender, address recipient, uint256 amount) 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/ERC20.sol": { "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../../utils/Context.sol\";\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.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.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin guidelines: functions revert instead\n * of returning `false` on failure. This behavior is nonetheless conventional\n * and does not conflict with the expectations of ERC20 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 ERC20 is Context, IERC20 {\n using SafeMath for uint256;\n\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 uint8 private _decimals;\n\n /**\n * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\n * a default value of 18.\n *\n * To select a different value for {decimals}, use {_setupDecimals}.\n *\n * All three of these values are immutable: they can only be set once during\n * construction.\n */\n constructor (string memory name_, string memory symbol_) public {\n _name = name_;\n _symbol = symbol_;\n _decimals = 18;\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 value {ERC20} uses, unless {_setupDecimals} is\n * called.\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 _decimals;\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 * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, 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 * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), 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 * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\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 _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(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 _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\"));\n return true;\n }\n\n /**\n * @dev Moves tokens `amount` from `sender` to `recipient`.\n *\n * This is 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 * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(address sender, address recipient, uint256 amount) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n _balances[sender] = _balances[sender].sub(amount, \"ERC20: transfer amount exceeds balance\");\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, 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 * - `to` 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 = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(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 _balances[account] = _balances[account].sub(amount, \"ERC20: burn amount exceeds balance\");\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(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 Sets {decimals} to a value other than the default one of 18.\n *\n * WARNING: This function should only be called from the constructor. Most\n * applications that interact with token contracts will not expect\n * {decimals} to ever change, and may work incorrectly if it does.\n */\n function _setupDecimals(uint8 decimals_) internal virtual {\n _decimals = decimals_;\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 to 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" }, "@openzeppelin/contracts/math/SafeMath.sol": { "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * 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 */\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 uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\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 if (b > a) return (false, 0);\n return (true, a - b);\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 // 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 * @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 if (b == 0) return (false, 0);\n return (true, a / b);\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 if (b == 0) return (false, 0);\n return (true, a % b);\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 uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\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 require(b <= a, \"SafeMath: subtraction overflow\");\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 if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\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. 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(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\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 require(b > 0, \"SafeMath: modulo by zero\");\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(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\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 * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\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(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\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(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" } }, "settings": { "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "istanbul", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } } }}
1
20,291,080
d13a853c243f3ada033bcc9b3301ab90502e0ad74ca6fd4020f6cb0b46324fd8
5f87a56f598fd26a2c4d308e6eaa0a0c36e224d9167530754aeb0f1957a9c663
051c42ee7a529410a10e5ec11b9e9b8ba7cbb795
edccb35798fae4925718a43cc608ae136208aa8d
0884fa6f4436d7fc99dd610b3f6b01ef17a78f46
60806040526000600355600060045560006007556000600855600060095561033e600a5534801561002f57600080fd5b5060405161113a38038061113a8339818101604052606081101561005257600080fd5b5080516020820151604090920151600080546001600160a01b039384166001600160a01b031991821617909155600180549484169482169490941790935560028054929091169190921617905561108c806100ae6000396000f3fe608060405234801561001057600080fd5b50600436106101725760003560e01c80637b0a47ee116100de578063c8f33c9111610097578063ebe2b12b11610071578063ebe2b12b1461031e578063f14faf6f14610326578063f3fef3a314610357578063f7c618c11461038357610172565b8063c8f33c9114610306578063cd3daf9d1461030e578063df136d651461031657610172565b80637b0a47ee1461027657806380faa57d1461027e5780638b87634714610286578063901a7d53146102ac578063adc9772e146102b4578063c00007b0146102e057610172565b80633d18b912116101305780633d18b91214610211578063570ca7351461021b578063590a41f51461022357806363d38c3b146102405780636c8bcee81461024857806370a082311461025057610172565b80628cc262146101775780630700037d146101af5780630fb5a6b4146101d557806318160ddd146101dd578063262d3d6d146101e5578063323a5e0b146101ed575b600080fd5b61019d6004803603602081101561018d57600080fd5b50356001600160a01b031661038b565b60408051918252519081900360200190f35b61019d600480360360208110156101c557600080fd5b50356001600160a01b03166103f9565b61019d61040b565b61019d610412565b61019d610493565b6101f5610499565b604080516001600160a01b039092168252519081900360200190f35b6102196104a8565b005b6101f56104b3565b6102196004803603602081101561023957600080fd5b50356104c2565b61019d6105a5565b61019d6105ab565b61019d6004803603602081101561026657600080fd5b50356001600160a01b03166105b1565b61019d610631565b61019d610637565b61019d6004803603602081101561029c57600080fd5b50356001600160a01b031661064a565b61019d61065c565b610219600480360360408110156102ca57600080fd5b506001600160a01b038135169060200135610662565b610219600480360360208110156102f657600080fd5b50356001600160a01b031661074e565b61019d61082a565b61019d610830565b61019d61087e565b61019d610884565b6103436004803603602081101561033c57600080fd5b503561088a565b604080519115158252519081900360200190f35b6102196004803603604081101561036d57600080fd5b506001600160a01b0381351690602001356108ba565b6101f56109a6565b6001600160a01b0381166000908152600c6020908152604080832054600b9092528220546103f391906103ed90670de0b6b3a7640000906103e7906103d8906103d2610830565b906109b5565b6103e1886105b1565b90610a12565b90610a72565b90610ad9565b92915050565b600c6020526000908152604090205481565b62093a8081565b60008060009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561046157600080fd5b505afa158015610475573d6000803e3d6000fd5b505050506040513d602081101561048b57600080fd5b505190505b90565b60095481565b6000546001600160a01b031681565b6104b13361074e565b565b6002546001600160a01b031681565b6002546001600160a01b0316331461050f576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b60075461051d908290610ad9565b9050600354421061053b5761053181610b33565b60006007556105a2565b600061055f61055862093a806003546109b590919063ffffffff16565b42906109b5565b60045490915081026000610579846103e7846103e8610a12565b9050600a548110156105985761058e84610b33565b600060075561059e565b60078490555b5050505b50565b60075481565b600a5481565b60008054604080516370a0823160e01b81526001600160a01b038581166004830152915191909216916370a08231916024808301926020929190829003018186803b1580156105ff57600080fd5b505afa158015610613573d6000803e3d6000fd5b505050506040513d602081101561062957600080fd5b505192915050565b60045481565b600061064542600354610c59565b905090565b600b6020526000908152604090205481565b60085481565b8161066b610830565b600655610676610637565b6005556001600160a01b038116156106bd576106918161038b565b6001600160a01b0382166000908152600c6020908152604080832093909355600654600b909152919020555b6000546001600160a01b0316331461070a576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b6040805183815290516001600160a01b038516917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a2505050565b80610757610830565b600655610762610637565b6005556001600160a01b038116156107a95761077d8161038b565b6001600160a01b0382166000908152600c6020908152604080832093909355600654600b909152919020555b60006107b48361038b565b90508015610825576001600160a01b038084166000908152600c60205260408120556001546107e591168483610c6f565b6040805182815290516001600160a01b038516917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b505050565b60055481565b600061083a610412565b6108475750600654610490565b610645610875610855610412565b6103e7670de0b6b3a76400006103e16004546103e16005546103d2610637565b60065490610ad9565b60065481565b60035481565b6001546000906108a5906001600160a01b0316333085610cc1565b6007546108b29083610ad9565b600755919050565b816108c3610830565b6006556108ce610637565b6005556001600160a01b03811615610915576108e98161038b565b6001600160a01b0382166000908152600c6020908152604080832093909355600654600b909152919020555b6000546001600160a01b03163314610962576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b6040805183815290516001600160a01b038516917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a2505050565b6001546001600160a01b031681565b600082821115610a0c576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082610a21575060006103f3565b82820282848281610a2e57fe5b0414610a6b5760405162461bcd60e51b815260040180806020018281038252602181526020018061100c6021913960400191505060405180910390fd5b9392505050565b6000808211610ac8576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610ad157fe5b049392505050565b600082820183811015610a6b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000610b3d610830565b600655610b48610637565b6005556001600160a01b03811615610b8f57610b638161038b565b6001600160a01b0382166000908152600c6020908152604080832093909355600654600b909152919020555b600954610b9c9083610ad9565b6009556003544210610bbd57610bb58262093a80610a72565b600455610c07565b600354600090610bcd90426109b5565b90506000610be660045483610a1290919063ffffffff16565b9050610bf28482610ad9565b9350610c018462093a80610a72565b60045550505b6008829055426005819055610c1f9062093a80610ad9565b6003556040805183815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a15050565b6000818310610c685781610a6b565b5090919050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610825908490610d17565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261059e9085905b6060610d6c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610dc89092919063ffffffff16565b80519091501561082557808060200190516020811015610d8b57600080fd5b50516108255760405162461bcd60e51b815260040180806020018281038252602a81526020018061102d602a913960400191505060405180910390fd5b6060610dd78484600085610ddf565b949350505050565b606082471015610e205760405162461bcd60e51b8152600401808060200182810382526026815260200180610fe66026913960400191505060405180910390fd5b610e2985610f3b565b610e7a576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310610eb95780518252601f199092019160209182019101610e9a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610f1b576040519150601f19603f3d011682016040523d82523d6000602084013e610f20565b606091505b5091509150610f30828286610f41565b979650505050505050565b3b151590565b60608315610f50575081610a6b565b825115610f605782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610faa578181015183820152602001610f92565b50505050905090810190601f168015610fd75780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220b1846f38f03004027517b5b4eb8715888a9f20b003182accc0cf65bce3d2999264736f6c634300060c0033000000000000000000000000c94208d230eedc4cdc4f80141e21aa485a515660000000000000000000000000e31855fae80b65e3332c96d1ec6f3f25d52dc99700000000000000000000000025f5ccd892985bf878327b15815bd90066eef28d
608060405234801561001057600080fd5b50600436106101725760003560e01c80637b0a47ee116100de578063c8f33c9111610097578063ebe2b12b11610071578063ebe2b12b1461031e578063f14faf6f14610326578063f3fef3a314610357578063f7c618c11461038357610172565b8063c8f33c9114610306578063cd3daf9d1461030e578063df136d651461031657610172565b80637b0a47ee1461027657806380faa57d1461027e5780638b87634714610286578063901a7d53146102ac578063adc9772e146102b4578063c00007b0146102e057610172565b80633d18b912116101305780633d18b91214610211578063570ca7351461021b578063590a41f51461022357806363d38c3b146102405780636c8bcee81461024857806370a082311461025057610172565b80628cc262146101775780630700037d146101af5780630fb5a6b4146101d557806318160ddd146101dd578063262d3d6d146101e5578063323a5e0b146101ed575b600080fd5b61019d6004803603602081101561018d57600080fd5b50356001600160a01b031661038b565b60408051918252519081900360200190f35b61019d600480360360208110156101c557600080fd5b50356001600160a01b03166103f9565b61019d61040b565b61019d610412565b61019d610493565b6101f5610499565b604080516001600160a01b039092168252519081900360200190f35b6102196104a8565b005b6101f56104b3565b6102196004803603602081101561023957600080fd5b50356104c2565b61019d6105a5565b61019d6105ab565b61019d6004803603602081101561026657600080fd5b50356001600160a01b03166105b1565b61019d610631565b61019d610637565b61019d6004803603602081101561029c57600080fd5b50356001600160a01b031661064a565b61019d61065c565b610219600480360360408110156102ca57600080fd5b506001600160a01b038135169060200135610662565b610219600480360360208110156102f657600080fd5b50356001600160a01b031661074e565b61019d61082a565b61019d610830565b61019d61087e565b61019d610884565b6103436004803603602081101561033c57600080fd5b503561088a565b604080519115158252519081900360200190f35b6102196004803603604081101561036d57600080fd5b506001600160a01b0381351690602001356108ba565b6101f56109a6565b6001600160a01b0381166000908152600c6020908152604080832054600b9092528220546103f391906103ed90670de0b6b3a7640000906103e7906103d8906103d2610830565b906109b5565b6103e1886105b1565b90610a12565b90610a72565b90610ad9565b92915050565b600c6020526000908152604090205481565b62093a8081565b60008060009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561046157600080fd5b505afa158015610475573d6000803e3d6000fd5b505050506040513d602081101561048b57600080fd5b505190505b90565b60095481565b6000546001600160a01b031681565b6104b13361074e565b565b6002546001600160a01b031681565b6002546001600160a01b0316331461050f576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b60075461051d908290610ad9565b9050600354421061053b5761053181610b33565b60006007556105a2565b600061055f61055862093a806003546109b590919063ffffffff16565b42906109b5565b60045490915081026000610579846103e7846103e8610a12565b9050600a548110156105985761058e84610b33565b600060075561059e565b60078490555b5050505b50565b60075481565b600a5481565b60008054604080516370a0823160e01b81526001600160a01b038581166004830152915191909216916370a08231916024808301926020929190829003018186803b1580156105ff57600080fd5b505afa158015610613573d6000803e3d6000fd5b505050506040513d602081101561062957600080fd5b505192915050565b60045481565b600061064542600354610c59565b905090565b600b6020526000908152604090205481565b60085481565b8161066b610830565b600655610676610637565b6005556001600160a01b038116156106bd576106918161038b565b6001600160a01b0382166000908152600c6020908152604080832093909355600654600b909152919020555b6000546001600160a01b0316331461070a576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b6040805183815290516001600160a01b038516917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a2505050565b80610757610830565b600655610762610637565b6005556001600160a01b038116156107a95761077d8161038b565b6001600160a01b0382166000908152600c6020908152604080832093909355600654600b909152919020555b60006107b48361038b565b90508015610825576001600160a01b038084166000908152600c60205260408120556001546107e591168483610c6f565b6040805182815290516001600160a01b038516917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b505050565b60055481565b600061083a610412565b6108475750600654610490565b610645610875610855610412565b6103e7670de0b6b3a76400006103e16004546103e16005546103d2610637565b60065490610ad9565b60065481565b60035481565b6001546000906108a5906001600160a01b0316333085610cc1565b6007546108b29083610ad9565b600755919050565b816108c3610830565b6006556108ce610637565b6005556001600160a01b03811615610915576108e98161038b565b6001600160a01b0382166000908152600c6020908152604080832093909355600654600b909152919020555b6000546001600160a01b03163314610962576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b6040805183815290516001600160a01b038516917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a2505050565b6001546001600160a01b031681565b600082821115610a0c576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082610a21575060006103f3565b82820282848281610a2e57fe5b0414610a6b5760405162461bcd60e51b815260040180806020018281038252602181526020018061100c6021913960400191505060405180910390fd5b9392505050565b6000808211610ac8576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610ad157fe5b049392505050565b600082820183811015610a6b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000610b3d610830565b600655610b48610637565b6005556001600160a01b03811615610b8f57610b638161038b565b6001600160a01b0382166000908152600c6020908152604080832093909355600654600b909152919020555b600954610b9c9083610ad9565b6009556003544210610bbd57610bb58262093a80610a72565b600455610c07565b600354600090610bcd90426109b5565b90506000610be660045483610a1290919063ffffffff16565b9050610bf28482610ad9565b9350610c018462093a80610a72565b60045550505b6008829055426005819055610c1f9062093a80610ad9565b6003556040805183815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a15050565b6000818310610c685781610a6b565b5090919050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610825908490610d17565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261059e9085905b6060610d6c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610dc89092919063ffffffff16565b80519091501561082557808060200190516020811015610d8b57600080fd5b50516108255760405162461bcd60e51b815260040180806020018281038252602a81526020018061102d602a913960400191505060405180910390fd5b6060610dd78484600085610ddf565b949350505050565b606082471015610e205760405162461bcd60e51b8152600401808060200182810382526026815260200180610fe66026913960400191505060405180910390fd5b610e2985610f3b565b610e7a576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310610eb95780518252601f199092019160209182019101610e9a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610f1b576040519150601f19603f3d011682016040523d82523d6000602084013e610f20565b606091505b5091509150610f30828286610f41565b979650505050505050565b3b151590565b60608315610f50575081610a6b565b825115610f605782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610faa578181015183820152602001610f92565b50505050905090810190601f168015610fd75780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220b1846f38f03004027517b5b4eb8715888a9f20b003182accc0cf65bce3d2999264736f6c634300060c0033
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUtil { /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } } contract ReentrancyGuard { uint256 private _guardCounter; constructor () internal { _guardCounter = 1; } modifier nonReentrant() { _guardCounter += 1; uint256 localCounter = _guardCounter; _; require(localCounter == _guardCounter, "ReentrancyGuard: reentrant call"); } } interface ICurveGauge { function deposit(uint256) external; function balanceOf(address) external view returns (uint256); function withdraw(uint256) external; function claim_rewards() external; function reward_tokens(uint256) external view returns(address);//v2 function rewarded_token() external view returns(address);//v1 } interface ICurveVoteEscrow { function create_lock(uint256, uint256) external; function increase_amount(uint256) external; function increase_unlock_time(uint256) external; function withdraw() external; function smart_wallet_checker() external view returns (address); } interface IWalletChecker { function check(address) external view returns (bool); } interface IVoting{ function vote(uint256, bool, bool) external; //voteId, support, executeIfDecided function getVote(uint256) external view returns(bool,bool,uint64,uint64,uint64,uint64,uint256,uint256,uint256,bytes memory); function vote_for_gauge_weights(address,uint256) external; } interface IMinter{ function mint(address) external; } interface IRegistry{ function get_registry() external view returns(address); function get_address(uint256 _id) external view returns(address); function gauge_controller() external view returns(address); function get_lp_token(address) external view returns(address); function get_gauges(address) external view returns(address[10] memory,uint128[10] memory); } interface IStaker{ function deposit(address, address) external; function withdraw(address) external; function withdraw(address, address, uint256) external; function withdrawAll(address, address) external; function createLock(uint256, uint256) external; function increaseAmount(uint256) external; function increaseTime(uint256) external; function release() external; function claimCrv(address) external returns (uint256); function claimRewards(address) external; function claimFees(address,address) external; function setStashAccess(address, bool) external; function vote(uint256,address,bool) external; function voteGaugeWeight(address,uint256) external; function balanceOfPool(address) external view returns (uint256); function operator() external view returns (address); function execute(address _to, uint256 _value, bytes calldata _data) external returns (bool, bytes memory); } interface IRewards{ function stake(address, uint256) external; function stakeFor(address, uint256) external; function withdraw(address, uint256) external; function exit(address) external; function getReward(address) external; function queueNewRewards(uint256) external; function notifyRewardAmount(uint256) external; function addExtraReward(address) external; function stakingToken() external returns (address); } interface IStash{ function stashRewards() external returns (bool); function processStash() external returns (bool); function claimRewards() external returns (bool); } interface IFeeDistro{ function claim() external; function token() external view returns(address); } interface ITokenMinter{ function mint(address,uint256) external; function burn(address,uint256) external; } interface IDeposit{ function isShutdown() external view returns(bool); function balanceOf(address _account) external view returns(uint256); function totalSupply() external view returns(uint256); function poolInfo(uint256) external view returns(address,address,address,address,address, bool); function rewardClaimed(uint256,address,uint256) external; function withdrawTo(uint256,uint256,address) external; function claimRewards(uint256,address) external returns(bool); function rewardArbitrator() external returns(address); } interface ICrvDeposit{ function deposit(uint256, bool) external; function lockIncentive() external view returns(uint256); } interface IRewardFactory{ function setAccess(address,bool) external; function CreateCrvRewards(uint256,address) external returns(address); function CreateTokenRewards(address,address,address) external returns(address); function activeRewardCount(address) external view returns(uint256); function addActiveReward(address,uint256) external returns(bool); function removeActiveReward(address,uint256) external returns(bool); } interface IStashFactory{ function CreateStash(uint256,address,address,uint256) external returns(address); } interface ITokenFactory{ function CreateDepositToken(address) external returns(address); } interface IPools{ function addPool(address _lptoken, address _gauge, uint256 _stashVersion) external returns(bool); function shutdownPool(uint256 _pid) external returns(bool); function poolInfo(uint256) external view returns(address,address,address,address,address,bool); function poolLength() external view returns (uint256); function gaugeMap(address) external view returns(bool); function setPoolManager(address _poolM) external; } interface IVestedEscrow{ function fund(address[] calldata _recipient, uint256[] calldata _amount) external returns(bool); } // File: @openzeppelin\contracts\math\SafeMath.sol pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } } // File: @openzeppelin\contracts\token\ERC20\IERC20.sol pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // File: @openzeppelin\contracts\utils\Address.sol pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // File: @openzeppelin\contracts\token\ERC20\SafeERC20.sol pragma solidity >=0.6.0 <0.8.0; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } // File: contracts\VirtualBalanceRewardPool.sol pragma solidity 0.6.12; /** *Submitted for verification at Etherscan.io on 2020-07-17 */ /* ____ __ __ __ _ / __/__ __ ___ / /_ / / ___ / /_ (_)__ __ _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ / /___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\ /___/ * Synthetix: VirtualBalanceRewardPool.sol * * Docs: https://docs.synthetix.io/ * * * MIT License * =========== * * Copyright (c) 2020 Synthetix * * 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 */ contract VirtualBalanceWrapper { using SafeMath for uint256; using SafeERC20 for IERC20; IDeposit public deposits; function totalSupply() public view returns (uint256) { return deposits.totalSupply(); } function balanceOf(address account) public view returns (uint256) { return deposits.balanceOf(account); } } contract VirtualBalanceRewardPool is VirtualBalanceWrapper { using SafeERC20 for IERC20; IERC20 public rewardToken; uint256 public constant duration = 7 days; address public operator; uint256 public periodFinish = 0; uint256 public rewardRate = 0; uint256 public lastUpdateTime; uint256 public rewardPerTokenStored; uint256 public queuedRewards = 0; uint256 public currentRewards = 0; uint256 public historicalRewards = 0; uint256 public newRewardRatio = 830; mapping(address => uint256) public userRewardPerTokenPaid; mapping(address => uint256) public rewards; event RewardAdded(uint256 reward); event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event RewardPaid(address indexed user, uint256 reward); constructor( address deposit_, address reward_, address op_ ) public { deposits = IDeposit(deposit_); rewardToken = IERC20(reward_); operator = op_; } modifier updateReward(address account) { rewardPerTokenStored = rewardPerToken(); lastUpdateTime = lastTimeRewardApplicable(); if (account != address(0)) { rewards[account] = earned(account); userRewardPerTokenPaid[account] = rewardPerTokenStored; } _; } function lastTimeRewardApplicable() public view returns (uint256) { return MathUtil.min(block.timestamp, periodFinish); } function rewardPerToken() public view returns (uint256) { if (totalSupply() == 0) { return rewardPerTokenStored; } return rewardPerTokenStored.add( lastTimeRewardApplicable() .sub(lastUpdateTime) .mul(rewardRate) .mul(1e18) .div(totalSupply()) ); } function earned(address account) public view returns (uint256) { return balanceOf(account) .mul(rewardPerToken().sub(userRewardPerTokenPaid[account])) .div(1e18) .add(rewards[account]); } //update reward, emit, call linked reward's stake function stake(address _account, uint256 amount) external updateReward(_account) { require(msg.sender == address(deposits), "!authorized"); // require(amount > 0, 'VirtualDepositRewardPool: Cannot stake 0'); emit Staked(_account, amount); } function withdraw(address _account, uint256 amount) public updateReward(_account) { require(msg.sender == address(deposits), "!authorized"); //require(amount > 0, 'VirtualDepositRewardPool : Cannot withdraw 0'); emit Withdrawn(_account, amount); } function getReward(address _account) public updateReward(_account){ uint256 reward = earned(_account); if (reward > 0) { rewards[_account] = 0; rewardToken.safeTransfer(_account, reward); emit RewardPaid(_account, reward); } } function getReward() external{ getReward(msg.sender); } function donate(uint256 _amount) external returns(bool){ IERC20(rewardToken).safeTransferFrom(msg.sender, address(this), _amount); queuedRewards = queuedRewards.add(_amount); } function queueNewRewards(uint256 _rewards) external{ require(msg.sender == operator, "!authorized"); _rewards = _rewards.add(queuedRewards); if (block.timestamp >= periodFinish) { notifyRewardAmount(_rewards); queuedRewards = 0; return; } //et = now - (finish-duration) uint256 elapsedTime = block.timestamp.sub(periodFinish.sub(duration)); //current at now: rewardRate * elapsedTime uint256 currentAtNow = rewardRate * elapsedTime; uint256 queuedRatio = currentAtNow.mul(1000).div(_rewards); if(queuedRatio < newRewardRatio){ notifyRewardAmount(_rewards); queuedRewards = 0; }else{ queuedRewards = _rewards; } } function notifyRewardAmount(uint256 reward) internal updateReward(address(0)) { historicalRewards = historicalRewards.add(reward); if (block.timestamp >= periodFinish) { rewardRate = reward.div(duration); } else { uint256 remaining = periodFinish.sub(block.timestamp); uint256 leftover = remaining.mul(rewardRate); reward = reward.add(leftover); rewardRate = reward.div(duration); } currentRewards = reward; lastUpdateTime = block.timestamp; periodFinish = block.timestamp.add(duration); emit RewardAdded(reward); } }
1
20,291,080
d13a853c243f3ada033bcc9b3301ab90502e0ad74ca6fd4020f6cb0b46324fd8
0eae92ef7b0e5c19882dcb6c96fb0e984037c505439db7f3589e86ded7e22b43
a9a0b8a5e1adca0caccc63a168f053cd3be30808
01cd62ed13d0b666e2a10d13879a763dfd1dab99
10f8ccf9eb2462071694e55bcdc52eb3cff47323
3d602d80600a3d3981f3363d3d373d3d3d363d7308656072fee78f1d07e38c189de56daa9863597a5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7308656072fee78f1d07e38c189de56daa9863597a5af43d82803e903d91602b57fd5bf3
1
20,291,083
df06e88442551b23bff3965113a822e09b66d93af904943edfa3d040d6604933
96efe100e0c2866538b277c00c75ef7d17c2d4f4878a3bda6e3d572f7e10a38b
9980fedf494f722887dd5d7eaee55efe354789c6
9980fedf494f722887dd5d7eaee55efe354789c6
34d43300204d36f24f532ee157ec8b981683d25a
60a06040523060805234801561001457600080fd5b506080516143ac61004c60003960008181610be801528181610c28015281816113220152818161136201526113da01526143ac6000f3fe60806040526004361061022e5760003560e01c806301ffc9a714610233578063081812fc14610268578063083118d51461029557806312064c34146102b757806314d140b0146102f257806318160ddd146103135780631b13ee8a14610328578063248a9ca3146103485780632f2ff15d14610368578063318cd6731461038a57806336568abe1461039d5780633659cfe6146103bd57806338d322ef146103dd5780633eb76b9c146103fd578063410a1db11461041d57806349dcc2041461043d5780634bb17b1f146104785780634f1ef2861461048d57806352d1902d146104a057806352e62a43146104b5578063544ffc9c146104d55780635bbb21771461054a5780635c975abb146105775780636352211e1461058f5780636927850a146105af578063696c81bb146105c55780636d1daa28146105e55780636dc0ae221461060557806370a082311461062557806375b238fc146106455780637a26db17146106675780637f66dea11461069d57806382d837a1146106be5780638462151c146106de57806389c15aa11461070b57806391d148541461072b578063926d7d7f1461074b57806399a2557a1461076d578063a217fddf1461078d578063b09de278146107a2578063b6699d0e146107b5578063c23dc68f146107d5578063c41c2f2414610802578063c4ae316814610822578063c850627714610837578063c87b56dd1461089a578063d547741f146108ba578063db7817f9146108da578063e985e9c5146108fa575b600080fd5b34801561023f57600080fd5b5061025361024e36600461353c565b61091a565b60405190151581526020015b60405180910390f35b34801561027457600080fd5b50610288610283366004613566565b610951565b60405161025f919061357f565b3480156102a157600080fd5b506102aa6109c1565b60405161025f91906135e3565b3480156102c357600080fd5b506102e46102d236600461360b565b60066020526000908152604090205481565b60405190815260200161025f565b3480156102fe57600080fd5b5061013654610288906001600160a01b031681565b34801561031f57600080fd5b506102e4610a50565b34801561033457600080fd5b506102e4610343366004613628565b610ac4565b34801561035457600080fd5b506102e4610363366004613566565b610aed565b34801561037457600080fd5b50610388610383366004613654565b610b02565b005b610388610398366004613696565b610b23565b3480156103a957600080fd5b506103886103b8366004613654565b610b5b565b3480156103c957600080fd5b506103886103d836600461360b565b610bde565b3480156103e957600080fd5b506103886103f8366004613628565b610ca6565b34801561040957600080fd5b50610388610418366004613566565b610d73565b34801561042957600080fd5b5061038861043836600461360b565b6110d4565b34801561044957600080fd5b5061045d6104583660046136c2565b61116b565b6040805182518152602092830151928101929092520161025f565b34801561048457600080fd5b506103886111f1565b61038861049b366004613779565b611318565b3480156104ac57600080fd5b506102e46113cd565b3480156104c157600080fd5b506103886104d036600461380b565b61147b565b3480156104e157600080fd5b506105206104f0366004613566565b600260205260009081526040902080546001909101546001600160801b0380831692600160801b90048116911683565b604080516001600160801b039485168152928416602084015292169181019190915260600161025f565b34801561055657600080fd5b5061056a610565366004613859565b6116f8565b60405161025f9190613925565b34801561058357600080fd5b50603a5460ff16610253565b34801561059b57600080fd5b506102886105aa366004613566565b61176f565b3480156105bb57600080fd5b506102e460075481565b3480156105d157600080fd5b506103886105e0366004613973565b6117a2565b3480156105f157600080fd5b5061038861060036600461398e565b61180b565b34801561061157600080fd5b50600354610288906001600160a01b031681565b34801561063157600080fd5b506102e461064036600461360b565b611867565b34801561065157600080fd5b506102e460008051602061435783398151915281565b34801561067357600080fd5b506101365461068a90600160a01b900461ffff1681565b60405161ffff909116815260200161025f565b3480156106a957600080fd5b5061013454610288906001600160a01b031681565b3480156106ca57600080fd5b506102e46106d9366004613566565b6118da565b3480156106ea57600080fd5b506106fe6106f936600461360b565b61190d565b60405161025f91906139aa565b34801561071757600080fd5b506103886107263660046139e2565b611984565b34801561073757600080fd5b50610253610746366004613654565b611bbb565b34801561075757600080fd5b506102e46000805160206142a483398151915281565b34801561077957600080fd5b506106fe610788366004613a53565b611be6565b34801561079957600080fd5b506102e4600081565b6103886107b0366004613a88565b611c70565b3480156107c157600080fd5b506102e46107d0366004613566565b611da8565b3480156107e157600080fd5b506107f56107f0366004613566565b611ddb565b60405161025f9190613b0b565b34801561080e57600080fd5b50600054610288906001600160a01b031681565b34801561082e57600080fd5b50610388611e69565b34801561084357600080fd5b50610857610852366004613566565b611e9c565b60405161025f919081516001600160801b039081168252602080840151821690830152604080840151821690830152606092830151169181019190915260800190565b3480156108a657600080fd5b506102aa6108b5366004613566565b611f8f565b3480156108c657600080fd5b506103886108d5366004613654565b612002565b3480156108e657600080fd5b506102e46108f5366004613566565b61201e565b34801561090657600080fd5b50610253610915366004613b19565b61202b565b60006001600160e01b03198216637965db0b60e01b148061094b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6101355460405163020604bf60e21b8152600481018390526000916001600160a01b03169063081812fc906024015b602060405180830381865afa15801561099d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094b9190613b47565b61013780546109cf90613b64565b80601f01602080910402602001604051908101604052809291908181526020018280546109fb90613b64565b8015610a485780601f10610a1d57610100808354040283529160200191610a48565b820191906000526020600020905b815481529060010190602001808311610a2b57829003601f168201915b505050505081565b61013554604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015610a9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abf9190613b98565b905090565b6001600160a01b0382166000908152600460205260408120610ae690836120a3565b9392505050565b6000908152609e602052604090206001015490565b610b0b82610aed565b610b14816121be565b610b1e83836121c8565b505050565b610b2b61224e565b6000610b3683612296565b9050600080610b4485612358565b91509150610b5483838387612516565b5050505050565b6001600160a01b0381163314610bd05760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610bda82826128aa565b5050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610c265760405162461bcd60e51b8152600401610bc790613bb1565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610c58612911565b6001600160a01b031614610c7e5760405162461bcd60e51b8152600401610bc790613beb565b610c878161292d565b60408051600080825260208201909252610ca391839190612945565b50565b600080516020614357833981519152610cbe816121be565b6101345460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb90610cf19086908690600401613c25565b6020604051808303816000875af1158015610d10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d349190613c4e565b507f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d58383604051610d66929190613c25565b60405180910390a1505050565b6000818152600260205260408120600181015481549192916001600160801b0391821691610dad9180821691600160801b90910416613c7f565b610db79190613c7f565b6001600160801b031611610e025760405162461bcd60e51b81526020600482015260126024820152711b9bc81d9bdd195cc8195e1c1c995cdcd95960721b6044820152606401610bc7565b600354604051632d63f69360e01b8152600481018490526000916001600160a01b031690632d63f69390602401602060405180830381865afa158015610e4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e709190613b98565b90506000610e7d8261201e565b90506000600360009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610ed6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efa9190613b47565b6001600160a01b0316633a46b1a830856040518363ffffffff1660e01b8152600401610f27929190613c25565b602060405180830381865afa158015610f44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f689190613b98565b8454909150600090610f9f908490610f9090600160801b90046001600160801b031685613ca6565b610f9a9190613cd3565b612ab0565b8554909150600090610fc0908590610f90906001600160801b031686613ca6565b6001870154909150600090610fe4908690610f90906001600160801b031687613ca6565b600089815260026020818152604080842084815560010180546001600160801b03199081169091558151608089811b83169482019490945289841b821660308201529286901b16908201529293509160500160408051601f198184030181529190526003549091506001600160a01b0316635f398a148b84611064612b1d565b856040518563ffffffff1660e01b81526004016110849493929190613cf5565b6020604051808303816000875af11580156110a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c79190613b98565b5050505050505050505050565b6000805160206143578339815191526110ec816121be565b6001600160a01b0382166111135760405163d92e233d60e01b815260040160405180910390fd5b61013680546001600160a01b0319166001600160a01b0384161790556040517f1defc7e59eeac6c8cb243873ba35cd0ac8c57fe81e330b6ab84c23c63c1f007d9061115f90849061357f565b60405180910390a15050565b60408051808201825260008082526020820152610135549151631277308160e21b8152600481018590526024810184905290916001600160a01b0316906349dcc204906044016040805180830381865afa1580156111cd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae69190613d29565b60008060009054906101000a90046001600160a01b03166001600160a01b031663cf11c26b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611245573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112699190613b47565b6000549091506001600160a01b039081169082160361129b5760405163ee9d4f0f60e01b815260040160405180910390fd5b6001600160a01b0381166112c25760405163e2417bff60e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0383161790556040517f7d4400cf8a02e5f0690de634d2ab700d2d987649dcf96cdd70a971657a041b4a9061130d90839061357f565b60405180910390a150565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036113605760405162461bcd60e51b8152600401610bc790613bb1565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611392612911565b6001600160a01b0316146113b85760405162461bcd60e51b8152600401610bc790613beb565b6113c18261292d565b610bda82826001612945565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114685760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608401610bc7565b506000805160206142e483398151915290565b600354604051632d63f69360e01b8152600481018490526000916114ef9133916001600160a01b031690632d63f69390602401602060405180830381865afa1580156114cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103439190613b98565b90506000811161152d5760405162461bcd60e51b81526020600482015260096024820152681b9bc81dd95a59da1d60ba1b6044820152606401610bc7565b600083815260016020908152604080832033845290915290205460ff16156115875760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e481d9bdd1959609a1b6044820152606401610bc7565b6000838152600160208181526040808420338552909152909120805460ff1916909117905560ff821661160d576115bd81612ab0565b600084815260026020526040812080549091906115e49084906001600160801b0316613c7f565b92506101000a8154816001600160801b0302191690836001600160801b03160217905550505050565b60001960ff8316016116505761162281612ab0565b600084815260026020526040902080546010906115e4908490600160801b90046001600160801b0316613c7f565b60011960ff83160161168f5761166581612ab0565b600084815260026020526040812060010180549091906115e49084906001600160801b0316613c7f565b60405162461bcd60e51b815260206004820152603860248201527f696e76616c696420737570706f72742076616c75652c206d75737420626520696044820152776e636c7564656420696e20566f74655479706520656e756d60401b6064820152608401610bc7565b61013554604051635bbb217760e01b81526060916001600160a01b031690635bbb21779061172a9085906004016139aa565b600060405180830381865afa158015611747573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261094b9190810190613df1565b610135546040516331a9108f60e11b8152600481018390526000916001600160a01b031690636352211e90602401610980565b6000805160206143578339815191526117ba816121be565b610136805461ffff60a01b1916600160a01b61ffff8516908102919091179091556040519081527f4638b9d191c13f7c818328022e9a587f4050f58d4714724cc187da6307c8f51a9060200161115f565b600080516020614357833981519152611823816121be565b61182d8383612b3d565b6040805161ffff85168152602081018490527f2350f7c37c954a84e89df0b239e6b79e60b0b0466691f95df03c1a7a6469de089101610d66565b610135546040516370a0823160e01b81526000916001600160a01b0316906370a082319061189990859060040161357f565b602060405180830381865afa1580156118b6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094b9190613b98565b610135546040516382d837a160e01b8152600481018390526000916001600160a01b0316906382d837a190602401611899565b61013554604051632118854760e21b81526060916001600160a01b031690638462151c9061193f90859060040161357f565b600060405180830381865afa15801561195c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261094b9190810190613e81565b600054600160a81b900460ff16158080156119ac57506000546001600160a01b90910460ff16105b806119d457506119bb30612b7c565b1580156119d45750600054600160a01b900460ff166001145b611a375760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610bc7565b6000805460ff60a01b1916600160a01b1790558015611a64576000805460ff60a81b1916600160a81b1790555b611ace836001600160a01b0316635e8430ee6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611aa5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ac99190613b47565b612b8b565b611ad783612bc5565b61013580546001600160a01b0319166001600160a01b038816179055611b016001621e8480612b3d565b610136805461ffff60a01b191660af60a01b179055611b216000866121c8565b611b39600080516020614357833981519152866121c8565b61013680546001600160a01b038087166001600160a01b0319928316179092556101348054928516929091169190911790558015611bb3576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6000918252609e602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61013554604051634cd12abd60e11b81526001600160a01b038581166004830152602482018590526044820184905260609216906399a2557a90606401600060405180830381865afa158015611c40573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611c689190810190613e81565b949350505050565b611c7861224e565b610135546000906001600160a01b0316636352211e85858481611c9d57611c9d613f06565b905060200201356040518263ffffffff1660e01b8152600401611cc291815260200190565b602060405180830381865afa158015611cdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d039190613b47565b905060008060005b85811015611d9b57836001600160a01b0316611d3e888884818110611d3257611d32613f06565b90506020020135612296565b6001600160a01b031614611d655760405163ea65cfc760e01b815260040160405180910390fd5b600080611d89898985818110611d7d57611d7d613f06565b90506020020135612358565b95019493909301925050600101611d0b565b50611bb383838387612516565b61013554604051635b34ce8760e11b8152600481018390526000916001600160a01b03169063b6699d0e90602401611899565b60408051608081018252600080825260208201819052818301819052606082015261013554915163c23dc68f60e01b81526004810184905290916001600160a01b03169063c23dc68f90602401608060405180830381865afa158015611e45573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094b9190613f1c565b600080516020614357833981519152611e81816121be565b603a5460ff1615611e9457610ca3612bf7565b610ca3612c43565b604080516080810182526000808252602082018190529181018290526060810191909152600082815261013860209081526040808320815160808101835281546001600160801b03808216808452600160801b9283900482169684019690965260019093015480841694830194909452909204166060820152910361094b576101355460405163c850627760e01b8152600481018590526001600160a01b039091169063c850627790602401608060405180830381865afa158015611f65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae69190613f4f565b50919050565b6101355460405163c87b56dd60e01b8152600481018390526060916001600160a01b03169063c87b56dd90602401600060405180830381865afa158015611fda573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261094b9190810190613fae565b61200b82610aed565b612014816121be565b610b1e83836128aa565b600061094b6005836120a3565b6101355460405163e985e9c560e01b81526001600160a01b0384811660048301528381166024830152600092169063e985e9c590604401602060405180830381865afa15801561207f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae69190613c4e565b60004382106120f45760405162461bcd60e51b815260206004820181905260248201527f436865636b706f696e74733a20626c6f636b206e6f7420796574206d696e65646044820152606401610bc7565b60006120ff83612c80565b8454909150600081600581111561215d57600061211b84612ce5565b6121259085614024565b60008981526020902090915081015463ffffffff908116908616101561214d5780915061215b565b612158816001614037565b92505b505b600061216b88868585612dcd565b905080156121a65761219088612182600184614024565b600091825260209091200190565b54600160201b90046001600160e01b03166121a9565b60005b6001600160e01b031698975050505050505050565b610ca38133612e2b565b6121d28282611bbb565b610bda576000828152609e602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561220a3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b603a5460ff16156122945760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610bc7565b565b610135546040516331a9108f60e11b8152600481018390526000916001600160a01b031690636352211e90602401602060405180830381865afa1580156122e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123059190613b47565b90506001600160a01b038116331480159061233557506123336000805160206142a483398151915233611bbb565b155b15612353576040516348f5c3ed60e01b815260040160405180910390fd5b919050565b60008181526101396020526040812054819060ff161561238b57604051634bc54ec360e11b815260040160405180910390fd5b600061239684612e84565b805461013554604051635b34ce8760e11b815260048101889052929350600160801b9091046001600160801b0316916001600160a01b039091169063b6699d0e90602401602060405180830381865afa1580156123f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061241b9190613b98565b6124259190614024565b81546001600160801b03908116600160801b8102808217855592955061244e9286921617614024565b61013654604051626fc27160e51b815260048101879052602481018390529193506001600160a01b031690630df84e2090604401600060405180830381600087803b15801561249c57600080fd5b505af11580156124b0573d6000803e3d6000fd5b50505060008581526101396020908152604091829020805460ff1916600117905581518781529081018690529081018490527f5bd8c92d7587f9cf8e315fbc1bc708d32bb8c94c4d9dad1f6f6307ece02a1853915060600160405180910390a150915091565b61013454610135546040516370a0823160e01b81526000926001600160a01b03908116926370a0823192612550929091169060040161357f565b602060405180830381865afa15801561256d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125919190613b98565b905080156125ff57610135546040516338d322ef60e01b81526001600160a01b03909116906338d322ef906125cc9030908590600401613c25565b600060405180830381600087803b1580156125e657600080fd5b505af11580156125fa573d6000803e3d6000fd5b505050505b6101365461ffff600160a01b909104811690831603612694576101345460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061264b9088908890600401613c25565b6020604051808303816000875af115801561266a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061268e9190613c4e565b5061282f565b60008054906101000a90046001600160a01b03166001600160a01b031663060bbbd96040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127099190613b47565b6001600160a01b031663695ef6bf3430856127338a6001600160a01b03166001600160a01b031690565b604080516060810182523381526000602082015261013780548d938301919061275b90613b64565b80601f016020809104026020016040519081016040528092919081815260200182805461278790613b64565b80156127d45780601f106127a9576101008083540402835291602001916127d4565b820191906000526020600020905b8154815290600101906020018083116127b757829003601f168201915b50505050508152506040518763ffffffff1660e01b81526004016127fc95949392919061404a565b6000604051808303818588803b15801561281557600080fd5b505af1158015612829573d6000803e3d6000fd5b50505050505b610134546101365460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb92612867929116908790600401613c25565b6020604051808303816000875af1158015612886573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bb39190613c4e565b6128b48282611bbb565b15610bda576000828152609e602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000805160206142e4833981519152546001600160a01b031690565b600080516020614357833981519152610bda816121be565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561297857610b1e83612ee2565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156129d2575060408051601f3d908101601f191682019092526129cf91810190613b98565b60015b612a355760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610bc7565b6000805160206142e48339815191528114612aa45760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610bc7565b50610b1e838383612f7c565b60006001600160801b03821115612b195760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610bc7565b5090565b60606040518060600160405280602c8152602001614304602c9139905090565b6040516001600160f01b031960f084901b166020820152602281018290526042016040516020818303038152906040526101379081610b1e91906140f7565b6001600160a01b03163b151590565b600054600160a81b900460ff16612bb45760405162461bcd60e51b8152600401610bc7906141b6565b612bbd81612fa7565b610ca3612ff2565b600054600160a81b900460ff16612bee5760405162461bcd60e51b8152600401610bc7906141b6565b610ca3816130c4565b612bff61310d565b603a805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051612c39919061357f565b60405180910390a1565b612c4b61224e565b603a805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612c2c3390565b600063ffffffff821115612b195760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608401610bc7565b600081600003612cf757506000919050565b60006001612d0484613156565b901c6001901b90506001818481612d1d57612d1d613cbd565b048201901c90506001818481612d3557612d35613cbd565b048201901c90506001818481612d4d57612d4d613cbd565b048201901c90506001818481612d6557612d65613cbd565b048201901c90506001818481612d7d57612d7d613cbd565b048201901c90506001818481612d9557612d95613cbd565b048201901c90506001818481612dad57612dad613cbd565b048201901c9050610ae681828581612dc757612dc7613cbd565b046131ea565b60005b81831015612e23576000612de48484613200565b60008781526020902090915063ffffffff86169082015463ffffffff161115612e0f57809250612e1d565b612e1a816001614037565b93505b50612dd0565b509392505050565b612e358282611bbb565b610bda57612e428161321b565b612e4d83602061322d565b604051602001612e5e929190614201565b60408051601f198184030181529082905262461bcd60e51b8252610bc7916004016135e3565b600080612e9083611e9c565b600093845261013860209081526040948590208251918301516001600160801b03928316600160801b918416820217825595830151606090930151928216929091169094021760018401555090919050565b612eeb81612b7c565b612f4d5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610bc7565b6000805160206142e483398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612f85836133c8565b600082511180612f925750805b15610b1e57612fa18383613408565b50505050565b600054600160a81b900460ff16612fd05760405162461bcd60e51b8152600401610bc7906141b6565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600360009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015613047573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061306b9190613b47565b6001600160a01b0316635c19a95c306040518263ffffffff1660e01b8152600401613096919061357f565b600060405180830381600087803b1580156130b057600080fd5b505af1158015612fa1573d6000803e3d6000fd5b6001600160a01b0381166130eb5760405163e2417bff60e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b603a5460ff166122945760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610bc7565b600080608083901c1561316b57608092831c92015b604083901c1561317d57604092831c92015b602083901c1561318f57602092831c92015b601083901c156131a157601092831c92015b600883901c156131b357600892831c92015b600483901c156131c557600492831c92015b600283901c156131d757600292831c92015b600183901c1561094b5760010192915050565b60008183106131f95781610ae6565b5090919050565b600061320f6002848418613cd3565b610ae690848416614037565b606061094b6001600160a01b03831660145b6060600061323c836002613ca6565b613247906002614037565b6001600160401b0381111561325e5761325e6136e4565b6040519080825280601f01601f191660200182016040528015613288576020820181803683370190505b509050600360fc1b816000815181106132a3576132a3613f06565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106132d2576132d2613f06565b60200101906001600160f81b031916908160001a90535060006132f6846002613ca6565b613301906001614037565b90505b6001811115613379576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061333557613335613f06565b1a60f81b82828151811061334b5761334b613f06565b60200101906001600160f81b031916908160001a90535060049490941c9361337281614270565b9050613304565b508315610ae65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610bc7565b6133d181612ee2565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610ae68383604051806060016040528060278152602001614330602791396060600080856001600160a01b0316856040516134459190614287565b600060405180830381855af49150503d8060008114613480576040519150601f19603f3d011682016040523d82523d6000602084013e613485565b606091505b5091509150613496868383876134a0565b9695505050505050565b6060831561350d578251600003613506576134ba85612b7c565b6135065760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610bc7565b5081611c68565b611c6883838151156135225781518083602001fd5b8060405162461bcd60e51b8152600401610bc791906135e3565b60006020828403121561354e57600080fd5b81356001600160e01b031981168114610ae657600080fd5b60006020828403121561357857600080fd5b5035919050565b6001600160a01b0391909116815260200190565b60005b838110156135ae578181015183820152602001613596565b50506000910152565b600081518084526135cf816020860160208601613593565b601f01601f19169290920160200192915050565b602081526000610ae660208301846135b7565b6001600160a01b0381168114610ca357600080fd5b60006020828403121561361d57600080fd5b8135610ae6816135f6565b6000806040838503121561363b57600080fd5b8235613646816135f6565b946020939093013593505050565b6000806040838503121561366757600080fd5b823591506020830135613679816135f6565b809150509250929050565b803561ffff8116811461235357600080fd5b600080604083850312156136a957600080fd5b823591506136b960208401613684565b90509250929050565b600080604083850312156136d557600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b038111828210171561371c5761371c6136e4565b60405290565b604051601f8201601f191681016001600160401b038111828210171561374a5761374a6136e4565b604052919050565b60006001600160401b0382111561376b5761376b6136e4565b50601f01601f191660200190565b6000806040838503121561378c57600080fd5b8235613797816135f6565b915060208301356001600160401b038111156137b257600080fd5b8301601f810185136137c357600080fd5b80356137d66137d182613752565b613722565b8181528660208385010111156137eb57600080fd5b816020840160208301376000602083830101528093505050509250929050565b6000806040838503121561381e57600080fd5b82359150602083013560ff8116811461367957600080fd5b60006001600160401b0382111561384f5761384f6136e4565b5060051b60200190565b6000602080838503121561386c57600080fd5b82356001600160401b0381111561388257600080fd5b8301601f8101851361389357600080fd5b80356138a16137d182613836565b81815260059190911b820183019083810190878311156138c057600080fd5b928401925b828410156138de578335825292840192908401906138c5565b979650505050505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b81811015613967576139548385516138e9565b9284019260809290920191600101613941565b50909695505050505050565b60006020828403121561398557600080fd5b610ae682613684565b600080604083850312156139a157600080fd5b61364683613684565b6020808252825182820181905260009190848201906040850190845b81811015613967578351835292840192918401916001016139c6565b600080600080600060a086880312156139fa57600080fd5b8535613a05816135f6565b94506020860135613a15816135f6565b93506040860135613a25816135f6565b92506060860135613a35816135f6565b91506080860135613a45816135f6565b809150509295509295909350565b600080600060608486031215613a6857600080fd5b8335613a73816135f6565b95602085013595506040909401359392505050565b600080600060408486031215613a9d57600080fd5b83356001600160401b0380821115613ab457600080fd5b818601915086601f830112613ac857600080fd5b813581811115613ad757600080fd5b8760208260051b8501011115613aec57600080fd5b602092830195509350613b029186019050613684565b90509250925092565b6080810161094b82846138e9565b60008060408385031215613b2c57600080fd5b8235613b37816135f6565b91506020830135613679816135f6565b600060208284031215613b5957600080fd5b8151610ae6816135f6565b600181811c90821680613b7857607f821691505b602082108103611f8957634e487b7160e01b600052602260045260246000fd5b600060208284031215613baa57600080fd5b5051919050565b6020808252602c908201526000805160206142c483398151915260408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201526000805160206142c483398151915260408201526b6163746976652070726f787960a01b606082015260800190565b6001600160a01b03929092168252602082015260400190565b8051801515811461235357600080fd5b600060208284031215613c6057600080fd5b610ae682613c3e565b634e487b7160e01b600052601160045260246000fd5b6001600160801b03818116838216019080821115613c9f57613c9f613c69565b5092915050565b808202811582820484141761094b5761094b613c69565b634e487b7160e01b600052601260045260246000fd5b600082613cf057634e487b7160e01b600052601260045260246000fd5b500490565b84815260ff84166020820152608060408201526000613d1760808301856135b7565b82810360608401526138de81856135b7565b600060408284031215613d3b57600080fd5b604080519081016001600160401b0381118282101715613d5d57613d5d6136e4565b604052825181526020928301519281019290925250919050565b600060808284031215613d8957600080fd5b613d916136fa565b90508151613d9e816135f6565b815260208201516001600160401b0381168114613dba57600080fd5b6020820152613dcb60408301613c3e565b6040820152606082015162ffffff81168114613de657600080fd5b606082015292915050565b60006020808385031215613e0457600080fd5b82516001600160401b03811115613e1a57600080fd5b8301601f81018513613e2b57600080fd5b8051613e396137d182613836565b81815260079190911b82018301908381019087831115613e5857600080fd5b928401925b828410156138de57613e6f8885613d77565b82528482019150608084019350613e5d565b60006020808385031215613e9457600080fd5b82516001600160401b03811115613eaa57600080fd5b8301601f81018513613ebb57600080fd5b8051613ec96137d182613836565b81815260059190911b82018301908381019087831115613ee857600080fd5b928401925b828410156138de57835182529284019290840190613eed565b634e487b7160e01b600052603260045260246000fd5b600060808284031215613f2e57600080fd5b610ae68383613d77565b80516001600160801b038116811461235357600080fd5b600060808284031215613f6157600080fd5b613f696136fa565b613f7283613f38565b8152613f8060208401613f38565b6020820152613f9160408401613f38565b6040820152613fa260608401613f38565b60608201529392505050565b600060208284031215613fc057600080fd5b81516001600160401b03811115613fd657600080fd5b8201601f81018413613fe757600080fd5b8051613ff56137d182613752565b81815285602083850101111561400a57600080fd5b61401b826020830160208601613593565b95945050505050565b8181038181111561094b5761094b613c69565b8082018082111561094b5761094b613c69565b600060018060a01b03808816835261ffff8716602084015285604084015284606084015260a060808401528084511660a08401528060208501511660c0840152506040830151606060e08401526140a56101008401826135b7565b98975050505050505050565b601f821115610b1e57600081815260208120601f850160051c810160208610156140d85750805b601f850160051c820191505b81811015611bb3578281556001016140e4565b81516001600160401b03811115614110576141106136e4565b6141248161411e8454613b64565b846140b1565b602080601f83116001811461415957600084156141415750858301515b600019600386901b1c1916600185901b178555611bb3565b600085815260208120601f198616915b8281101561418857888601518255948401946001909101908401614169565b50858210156141a65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351614233816017850160208801613593565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614264816028840160208801613593565b01602801949350505050565b60008161427f5761427f613c69565b506000190190565b60008251614299818460208701613593565b919091019291505056fee2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc446756e6374696f6e206d7573742062652063616c6c6564207468726f75676820360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc726f6c6c65642d757020766f74652066726f6d20676f7665726e616e636520746f6b656e20686f6c64657273416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a264697066735822122023c9c69398f2037290af29deefab711b1291a683cef72c278d91d6e35136c38464736f6c63430008130033
60806040526004361061022e5760003560e01c806301ffc9a714610233578063081812fc14610268578063083118d51461029557806312064c34146102b757806314d140b0146102f257806318160ddd146103135780631b13ee8a14610328578063248a9ca3146103485780632f2ff15d14610368578063318cd6731461038a57806336568abe1461039d5780633659cfe6146103bd57806338d322ef146103dd5780633eb76b9c146103fd578063410a1db11461041d57806349dcc2041461043d5780634bb17b1f146104785780634f1ef2861461048d57806352d1902d146104a057806352e62a43146104b5578063544ffc9c146104d55780635bbb21771461054a5780635c975abb146105775780636352211e1461058f5780636927850a146105af578063696c81bb146105c55780636d1daa28146105e55780636dc0ae221461060557806370a082311461062557806375b238fc146106455780637a26db17146106675780637f66dea11461069d57806382d837a1146106be5780638462151c146106de57806389c15aa11461070b57806391d148541461072b578063926d7d7f1461074b57806399a2557a1461076d578063a217fddf1461078d578063b09de278146107a2578063b6699d0e146107b5578063c23dc68f146107d5578063c41c2f2414610802578063c4ae316814610822578063c850627714610837578063c87b56dd1461089a578063d547741f146108ba578063db7817f9146108da578063e985e9c5146108fa575b600080fd5b34801561023f57600080fd5b5061025361024e36600461353c565b61091a565b60405190151581526020015b60405180910390f35b34801561027457600080fd5b50610288610283366004613566565b610951565b60405161025f919061357f565b3480156102a157600080fd5b506102aa6109c1565b60405161025f91906135e3565b3480156102c357600080fd5b506102e46102d236600461360b565b60066020526000908152604090205481565b60405190815260200161025f565b3480156102fe57600080fd5b5061013654610288906001600160a01b031681565b34801561031f57600080fd5b506102e4610a50565b34801561033457600080fd5b506102e4610343366004613628565b610ac4565b34801561035457600080fd5b506102e4610363366004613566565b610aed565b34801561037457600080fd5b50610388610383366004613654565b610b02565b005b610388610398366004613696565b610b23565b3480156103a957600080fd5b506103886103b8366004613654565b610b5b565b3480156103c957600080fd5b506103886103d836600461360b565b610bde565b3480156103e957600080fd5b506103886103f8366004613628565b610ca6565b34801561040957600080fd5b50610388610418366004613566565b610d73565b34801561042957600080fd5b5061038861043836600461360b565b6110d4565b34801561044957600080fd5b5061045d6104583660046136c2565b61116b565b6040805182518152602092830151928101929092520161025f565b34801561048457600080fd5b506103886111f1565b61038861049b366004613779565b611318565b3480156104ac57600080fd5b506102e46113cd565b3480156104c157600080fd5b506103886104d036600461380b565b61147b565b3480156104e157600080fd5b506105206104f0366004613566565b600260205260009081526040902080546001909101546001600160801b0380831692600160801b90048116911683565b604080516001600160801b039485168152928416602084015292169181019190915260600161025f565b34801561055657600080fd5b5061056a610565366004613859565b6116f8565b60405161025f9190613925565b34801561058357600080fd5b50603a5460ff16610253565b34801561059b57600080fd5b506102886105aa366004613566565b61176f565b3480156105bb57600080fd5b506102e460075481565b3480156105d157600080fd5b506103886105e0366004613973565b6117a2565b3480156105f157600080fd5b5061038861060036600461398e565b61180b565b34801561061157600080fd5b50600354610288906001600160a01b031681565b34801561063157600080fd5b506102e461064036600461360b565b611867565b34801561065157600080fd5b506102e460008051602061435783398151915281565b34801561067357600080fd5b506101365461068a90600160a01b900461ffff1681565b60405161ffff909116815260200161025f565b3480156106a957600080fd5b5061013454610288906001600160a01b031681565b3480156106ca57600080fd5b506102e46106d9366004613566565b6118da565b3480156106ea57600080fd5b506106fe6106f936600461360b565b61190d565b60405161025f91906139aa565b34801561071757600080fd5b506103886107263660046139e2565b611984565b34801561073757600080fd5b50610253610746366004613654565b611bbb565b34801561075757600080fd5b506102e46000805160206142a483398151915281565b34801561077957600080fd5b506106fe610788366004613a53565b611be6565b34801561079957600080fd5b506102e4600081565b6103886107b0366004613a88565b611c70565b3480156107c157600080fd5b506102e46107d0366004613566565b611da8565b3480156107e157600080fd5b506107f56107f0366004613566565b611ddb565b60405161025f9190613b0b565b34801561080e57600080fd5b50600054610288906001600160a01b031681565b34801561082e57600080fd5b50610388611e69565b34801561084357600080fd5b50610857610852366004613566565b611e9c565b60405161025f919081516001600160801b039081168252602080840151821690830152604080840151821690830152606092830151169181019190915260800190565b3480156108a657600080fd5b506102aa6108b5366004613566565b611f8f565b3480156108c657600080fd5b506103886108d5366004613654565b612002565b3480156108e657600080fd5b506102e46108f5366004613566565b61201e565b34801561090657600080fd5b50610253610915366004613b19565b61202b565b60006001600160e01b03198216637965db0b60e01b148061094b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6101355460405163020604bf60e21b8152600481018390526000916001600160a01b03169063081812fc906024015b602060405180830381865afa15801561099d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094b9190613b47565b61013780546109cf90613b64565b80601f01602080910402602001604051908101604052809291908181526020018280546109fb90613b64565b8015610a485780601f10610a1d57610100808354040283529160200191610a48565b820191906000526020600020905b815481529060010190602001808311610a2b57829003601f168201915b505050505081565b61013554604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015610a9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abf9190613b98565b905090565b6001600160a01b0382166000908152600460205260408120610ae690836120a3565b9392505050565b6000908152609e602052604090206001015490565b610b0b82610aed565b610b14816121be565b610b1e83836121c8565b505050565b610b2b61224e565b6000610b3683612296565b9050600080610b4485612358565b91509150610b5483838387612516565b5050505050565b6001600160a01b0381163314610bd05760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610bda82826128aa565b5050565b6001600160a01b037f00000000000000000000000034d43300204d36f24f532ee157ec8b981683d25a163003610c265760405162461bcd60e51b8152600401610bc790613bb1565b7f00000000000000000000000034d43300204d36f24f532ee157ec8b981683d25a6001600160a01b0316610c58612911565b6001600160a01b031614610c7e5760405162461bcd60e51b8152600401610bc790613beb565b610c878161292d565b60408051600080825260208201909252610ca391839190612945565b50565b600080516020614357833981519152610cbe816121be565b6101345460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb90610cf19086908690600401613c25565b6020604051808303816000875af1158015610d10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d349190613c4e565b507f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d58383604051610d66929190613c25565b60405180910390a1505050565b6000818152600260205260408120600181015481549192916001600160801b0391821691610dad9180821691600160801b90910416613c7f565b610db79190613c7f565b6001600160801b031611610e025760405162461bcd60e51b81526020600482015260126024820152711b9bc81d9bdd195cc8195e1c1c995cdcd95960721b6044820152606401610bc7565b600354604051632d63f69360e01b8152600481018490526000916001600160a01b031690632d63f69390602401602060405180830381865afa158015610e4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e709190613b98565b90506000610e7d8261201e565b90506000600360009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610ed6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efa9190613b47565b6001600160a01b0316633a46b1a830856040518363ffffffff1660e01b8152600401610f27929190613c25565b602060405180830381865afa158015610f44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f689190613b98565b8454909150600090610f9f908490610f9090600160801b90046001600160801b031685613ca6565b610f9a9190613cd3565b612ab0565b8554909150600090610fc0908590610f90906001600160801b031686613ca6565b6001870154909150600090610fe4908690610f90906001600160801b031687613ca6565b600089815260026020818152604080842084815560010180546001600160801b03199081169091558151608089811b83169482019490945289841b821660308201529286901b16908201529293509160500160408051601f198184030181529190526003549091506001600160a01b0316635f398a148b84611064612b1d565b856040518563ffffffff1660e01b81526004016110849493929190613cf5565b6020604051808303816000875af11580156110a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c79190613b98565b5050505050505050505050565b6000805160206143578339815191526110ec816121be565b6001600160a01b0382166111135760405163d92e233d60e01b815260040160405180910390fd5b61013680546001600160a01b0319166001600160a01b0384161790556040517f1defc7e59eeac6c8cb243873ba35cd0ac8c57fe81e330b6ab84c23c63c1f007d9061115f90849061357f565b60405180910390a15050565b60408051808201825260008082526020820152610135549151631277308160e21b8152600481018590526024810184905290916001600160a01b0316906349dcc204906044016040805180830381865afa1580156111cd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae69190613d29565b60008060009054906101000a90046001600160a01b03166001600160a01b031663cf11c26b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611245573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112699190613b47565b6000549091506001600160a01b039081169082160361129b5760405163ee9d4f0f60e01b815260040160405180910390fd5b6001600160a01b0381166112c25760405163e2417bff60e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0383161790556040517f7d4400cf8a02e5f0690de634d2ab700d2d987649dcf96cdd70a971657a041b4a9061130d90839061357f565b60405180910390a150565b6001600160a01b037f00000000000000000000000034d43300204d36f24f532ee157ec8b981683d25a1630036113605760405162461bcd60e51b8152600401610bc790613bb1565b7f00000000000000000000000034d43300204d36f24f532ee157ec8b981683d25a6001600160a01b0316611392612911565b6001600160a01b0316146113b85760405162461bcd60e51b8152600401610bc790613beb565b6113c18261292d565b610bda82826001612945565b6000306001600160a01b037f00000000000000000000000034d43300204d36f24f532ee157ec8b981683d25a16146114685760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608401610bc7565b506000805160206142e483398151915290565b600354604051632d63f69360e01b8152600481018490526000916114ef9133916001600160a01b031690632d63f69390602401602060405180830381865afa1580156114cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103439190613b98565b90506000811161152d5760405162461bcd60e51b81526020600482015260096024820152681b9bc81dd95a59da1d60ba1b6044820152606401610bc7565b600083815260016020908152604080832033845290915290205460ff16156115875760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e481d9bdd1959609a1b6044820152606401610bc7565b6000838152600160208181526040808420338552909152909120805460ff1916909117905560ff821661160d576115bd81612ab0565b600084815260026020526040812080549091906115e49084906001600160801b0316613c7f565b92506101000a8154816001600160801b0302191690836001600160801b03160217905550505050565b60001960ff8316016116505761162281612ab0565b600084815260026020526040902080546010906115e4908490600160801b90046001600160801b0316613c7f565b60011960ff83160161168f5761166581612ab0565b600084815260026020526040812060010180549091906115e49084906001600160801b0316613c7f565b60405162461bcd60e51b815260206004820152603860248201527f696e76616c696420737570706f72742076616c75652c206d75737420626520696044820152776e636c7564656420696e20566f74655479706520656e756d60401b6064820152608401610bc7565b61013554604051635bbb217760e01b81526060916001600160a01b031690635bbb21779061172a9085906004016139aa565b600060405180830381865afa158015611747573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261094b9190810190613df1565b610135546040516331a9108f60e11b8152600481018390526000916001600160a01b031690636352211e90602401610980565b6000805160206143578339815191526117ba816121be565b610136805461ffff60a01b1916600160a01b61ffff8516908102919091179091556040519081527f4638b9d191c13f7c818328022e9a587f4050f58d4714724cc187da6307c8f51a9060200161115f565b600080516020614357833981519152611823816121be565b61182d8383612b3d565b6040805161ffff85168152602081018490527f2350f7c37c954a84e89df0b239e6b79e60b0b0466691f95df03c1a7a6469de089101610d66565b610135546040516370a0823160e01b81526000916001600160a01b0316906370a082319061189990859060040161357f565b602060405180830381865afa1580156118b6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094b9190613b98565b610135546040516382d837a160e01b8152600481018390526000916001600160a01b0316906382d837a190602401611899565b61013554604051632118854760e21b81526060916001600160a01b031690638462151c9061193f90859060040161357f565b600060405180830381865afa15801561195c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261094b9190810190613e81565b600054600160a81b900460ff16158080156119ac57506000546001600160a01b90910460ff16105b806119d457506119bb30612b7c565b1580156119d45750600054600160a01b900460ff166001145b611a375760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610bc7565b6000805460ff60a01b1916600160a01b1790558015611a64576000805460ff60a81b1916600160a81b1790555b611ace836001600160a01b0316635e8430ee6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611aa5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ac99190613b47565b612b8b565b611ad783612bc5565b61013580546001600160a01b0319166001600160a01b038816179055611b016001621e8480612b3d565b610136805461ffff60a01b191660af60a01b179055611b216000866121c8565b611b39600080516020614357833981519152866121c8565b61013680546001600160a01b038087166001600160a01b0319928316179092556101348054928516929091169190911790558015611bb3576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6000918252609e602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61013554604051634cd12abd60e11b81526001600160a01b038581166004830152602482018590526044820184905260609216906399a2557a90606401600060405180830381865afa158015611c40573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611c689190810190613e81565b949350505050565b611c7861224e565b610135546000906001600160a01b0316636352211e85858481611c9d57611c9d613f06565b905060200201356040518263ffffffff1660e01b8152600401611cc291815260200190565b602060405180830381865afa158015611cdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d039190613b47565b905060008060005b85811015611d9b57836001600160a01b0316611d3e888884818110611d3257611d32613f06565b90506020020135612296565b6001600160a01b031614611d655760405163ea65cfc760e01b815260040160405180910390fd5b600080611d89898985818110611d7d57611d7d613f06565b90506020020135612358565b95019493909301925050600101611d0b565b50611bb383838387612516565b61013554604051635b34ce8760e11b8152600481018390526000916001600160a01b03169063b6699d0e90602401611899565b60408051608081018252600080825260208201819052818301819052606082015261013554915163c23dc68f60e01b81526004810184905290916001600160a01b03169063c23dc68f90602401608060405180830381865afa158015611e45573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094b9190613f1c565b600080516020614357833981519152611e81816121be565b603a5460ff1615611e9457610ca3612bf7565b610ca3612c43565b604080516080810182526000808252602082018190529181018290526060810191909152600082815261013860209081526040808320815160808101835281546001600160801b03808216808452600160801b9283900482169684019690965260019093015480841694830194909452909204166060820152910361094b576101355460405163c850627760e01b8152600481018590526001600160a01b039091169063c850627790602401608060405180830381865afa158015611f65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae69190613f4f565b50919050565b6101355460405163c87b56dd60e01b8152600481018390526060916001600160a01b03169063c87b56dd90602401600060405180830381865afa158015611fda573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261094b9190810190613fae565b61200b82610aed565b612014816121be565b610b1e83836128aa565b600061094b6005836120a3565b6101355460405163e985e9c560e01b81526001600160a01b0384811660048301528381166024830152600092169063e985e9c590604401602060405180830381865afa15801561207f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae69190613c4e565b60004382106120f45760405162461bcd60e51b815260206004820181905260248201527f436865636b706f696e74733a20626c6f636b206e6f7420796574206d696e65646044820152606401610bc7565b60006120ff83612c80565b8454909150600081600581111561215d57600061211b84612ce5565b6121259085614024565b60008981526020902090915081015463ffffffff908116908616101561214d5780915061215b565b612158816001614037565b92505b505b600061216b88868585612dcd565b905080156121a65761219088612182600184614024565b600091825260209091200190565b54600160201b90046001600160e01b03166121a9565b60005b6001600160e01b031698975050505050505050565b610ca38133612e2b565b6121d28282611bbb565b610bda576000828152609e602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561220a3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b603a5460ff16156122945760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610bc7565b565b610135546040516331a9108f60e11b8152600481018390526000916001600160a01b031690636352211e90602401602060405180830381865afa1580156122e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123059190613b47565b90506001600160a01b038116331480159061233557506123336000805160206142a483398151915233611bbb565b155b15612353576040516348f5c3ed60e01b815260040160405180910390fd5b919050565b60008181526101396020526040812054819060ff161561238b57604051634bc54ec360e11b815260040160405180910390fd5b600061239684612e84565b805461013554604051635b34ce8760e11b815260048101889052929350600160801b9091046001600160801b0316916001600160a01b039091169063b6699d0e90602401602060405180830381865afa1580156123f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061241b9190613b98565b6124259190614024565b81546001600160801b03908116600160801b8102808217855592955061244e9286921617614024565b61013654604051626fc27160e51b815260048101879052602481018390529193506001600160a01b031690630df84e2090604401600060405180830381600087803b15801561249c57600080fd5b505af11580156124b0573d6000803e3d6000fd5b50505060008581526101396020908152604091829020805460ff1916600117905581518781529081018690529081018490527f5bd8c92d7587f9cf8e315fbc1bc708d32bb8c94c4d9dad1f6f6307ece02a1853915060600160405180910390a150915091565b61013454610135546040516370a0823160e01b81526000926001600160a01b03908116926370a0823192612550929091169060040161357f565b602060405180830381865afa15801561256d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125919190613b98565b905080156125ff57610135546040516338d322ef60e01b81526001600160a01b03909116906338d322ef906125cc9030908590600401613c25565b600060405180830381600087803b1580156125e657600080fd5b505af11580156125fa573d6000803e3d6000fd5b505050505b6101365461ffff600160a01b909104811690831603612694576101345460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061264b9088908890600401613c25565b6020604051808303816000875af115801561266a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061268e9190613c4e565b5061282f565b60008054906101000a90046001600160a01b03166001600160a01b031663060bbbd96040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127099190613b47565b6001600160a01b031663695ef6bf3430856127338a6001600160a01b03166001600160a01b031690565b604080516060810182523381526000602082015261013780548d938301919061275b90613b64565b80601f016020809104026020016040519081016040528092919081815260200182805461278790613b64565b80156127d45780601f106127a9576101008083540402835291602001916127d4565b820191906000526020600020905b8154815290600101906020018083116127b757829003601f168201915b50505050508152506040518763ffffffff1660e01b81526004016127fc95949392919061404a565b6000604051808303818588803b15801561281557600080fd5b505af1158015612829573d6000803e3d6000fd5b50505050505b610134546101365460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb92612867929116908790600401613c25565b6020604051808303816000875af1158015612886573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bb39190613c4e565b6128b48282611bbb565b15610bda576000828152609e602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000805160206142e4833981519152546001600160a01b031690565b600080516020614357833981519152610bda816121be565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561297857610b1e83612ee2565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156129d2575060408051601f3d908101601f191682019092526129cf91810190613b98565b60015b612a355760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610bc7565b6000805160206142e48339815191528114612aa45760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610bc7565b50610b1e838383612f7c565b60006001600160801b03821115612b195760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610bc7565b5090565b60606040518060600160405280602c8152602001614304602c9139905090565b6040516001600160f01b031960f084901b166020820152602281018290526042016040516020818303038152906040526101379081610b1e91906140f7565b6001600160a01b03163b151590565b600054600160a81b900460ff16612bb45760405162461bcd60e51b8152600401610bc7906141b6565b612bbd81612fa7565b610ca3612ff2565b600054600160a81b900460ff16612bee5760405162461bcd60e51b8152600401610bc7906141b6565b610ca3816130c4565b612bff61310d565b603a805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051612c39919061357f565b60405180910390a1565b612c4b61224e565b603a805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612c2c3390565b600063ffffffff821115612b195760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608401610bc7565b600081600003612cf757506000919050565b60006001612d0484613156565b901c6001901b90506001818481612d1d57612d1d613cbd565b048201901c90506001818481612d3557612d35613cbd565b048201901c90506001818481612d4d57612d4d613cbd565b048201901c90506001818481612d6557612d65613cbd565b048201901c90506001818481612d7d57612d7d613cbd565b048201901c90506001818481612d9557612d95613cbd565b048201901c90506001818481612dad57612dad613cbd565b048201901c9050610ae681828581612dc757612dc7613cbd565b046131ea565b60005b81831015612e23576000612de48484613200565b60008781526020902090915063ffffffff86169082015463ffffffff161115612e0f57809250612e1d565b612e1a816001614037565b93505b50612dd0565b509392505050565b612e358282611bbb565b610bda57612e428161321b565b612e4d83602061322d565b604051602001612e5e929190614201565b60408051601f198184030181529082905262461bcd60e51b8252610bc7916004016135e3565b600080612e9083611e9c565b600093845261013860209081526040948590208251918301516001600160801b03928316600160801b918416820217825595830151606090930151928216929091169094021760018401555090919050565b612eeb81612b7c565b612f4d5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610bc7565b6000805160206142e483398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612f85836133c8565b600082511180612f925750805b15610b1e57612fa18383613408565b50505050565b600054600160a81b900460ff16612fd05760405162461bcd60e51b8152600401610bc7906141b6565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600360009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015613047573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061306b9190613b47565b6001600160a01b0316635c19a95c306040518263ffffffff1660e01b8152600401613096919061357f565b600060405180830381600087803b1580156130b057600080fd5b505af1158015612fa1573d6000803e3d6000fd5b6001600160a01b0381166130eb5760405163e2417bff60e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b603a5460ff166122945760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610bc7565b600080608083901c1561316b57608092831c92015b604083901c1561317d57604092831c92015b602083901c1561318f57602092831c92015b601083901c156131a157601092831c92015b600883901c156131b357600892831c92015b600483901c156131c557600492831c92015b600283901c156131d757600292831c92015b600183901c1561094b5760010192915050565b60008183106131f95781610ae6565b5090919050565b600061320f6002848418613cd3565b610ae690848416614037565b606061094b6001600160a01b03831660145b6060600061323c836002613ca6565b613247906002614037565b6001600160401b0381111561325e5761325e6136e4565b6040519080825280601f01601f191660200182016040528015613288576020820181803683370190505b509050600360fc1b816000815181106132a3576132a3613f06565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106132d2576132d2613f06565b60200101906001600160f81b031916908160001a90535060006132f6846002613ca6565b613301906001614037565b90505b6001811115613379576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061333557613335613f06565b1a60f81b82828151811061334b5761334b613f06565b60200101906001600160f81b031916908160001a90535060049490941c9361337281614270565b9050613304565b508315610ae65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610bc7565b6133d181612ee2565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610ae68383604051806060016040528060278152602001614330602791396060600080856001600160a01b0316856040516134459190614287565b600060405180830381855af49150503d8060008114613480576040519150601f19603f3d011682016040523d82523d6000602084013e613485565b606091505b5091509150613496868383876134a0565b9695505050505050565b6060831561350d578251600003613506576134ba85612b7c565b6135065760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610bc7565b5081611c68565b611c6883838151156135225781518083602001fd5b8060405162461bcd60e51b8152600401610bc791906135e3565b60006020828403121561354e57600080fd5b81356001600160e01b031981168114610ae657600080fd5b60006020828403121561357857600080fd5b5035919050565b6001600160a01b0391909116815260200190565b60005b838110156135ae578181015183820152602001613596565b50506000910152565b600081518084526135cf816020860160208601613593565b601f01601f19169290920160200192915050565b602081526000610ae660208301846135b7565b6001600160a01b0381168114610ca357600080fd5b60006020828403121561361d57600080fd5b8135610ae6816135f6565b6000806040838503121561363b57600080fd5b8235613646816135f6565b946020939093013593505050565b6000806040838503121561366757600080fd5b823591506020830135613679816135f6565b809150509250929050565b803561ffff8116811461235357600080fd5b600080604083850312156136a957600080fd5b823591506136b960208401613684565b90509250929050565b600080604083850312156136d557600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b038111828210171561371c5761371c6136e4565b60405290565b604051601f8201601f191681016001600160401b038111828210171561374a5761374a6136e4565b604052919050565b60006001600160401b0382111561376b5761376b6136e4565b50601f01601f191660200190565b6000806040838503121561378c57600080fd5b8235613797816135f6565b915060208301356001600160401b038111156137b257600080fd5b8301601f810185136137c357600080fd5b80356137d66137d182613752565b613722565b8181528660208385010111156137eb57600080fd5b816020840160208301376000602083830101528093505050509250929050565b6000806040838503121561381e57600080fd5b82359150602083013560ff8116811461367957600080fd5b60006001600160401b0382111561384f5761384f6136e4565b5060051b60200190565b6000602080838503121561386c57600080fd5b82356001600160401b0381111561388257600080fd5b8301601f8101851361389357600080fd5b80356138a16137d182613836565b81815260059190911b820183019083810190878311156138c057600080fd5b928401925b828410156138de578335825292840192908401906138c5565b979650505050505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b81811015613967576139548385516138e9565b9284019260809290920191600101613941565b50909695505050505050565b60006020828403121561398557600080fd5b610ae682613684565b600080604083850312156139a157600080fd5b61364683613684565b6020808252825182820181905260009190848201906040850190845b81811015613967578351835292840192918401916001016139c6565b600080600080600060a086880312156139fa57600080fd5b8535613a05816135f6565b94506020860135613a15816135f6565b93506040860135613a25816135f6565b92506060860135613a35816135f6565b91506080860135613a45816135f6565b809150509295509295909350565b600080600060608486031215613a6857600080fd5b8335613a73816135f6565b95602085013595506040909401359392505050565b600080600060408486031215613a9d57600080fd5b83356001600160401b0380821115613ab457600080fd5b818601915086601f830112613ac857600080fd5b813581811115613ad757600080fd5b8760208260051b8501011115613aec57600080fd5b602092830195509350613b029186019050613684565b90509250925092565b6080810161094b82846138e9565b60008060408385031215613b2c57600080fd5b8235613b37816135f6565b91506020830135613679816135f6565b600060208284031215613b5957600080fd5b8151610ae6816135f6565b600181811c90821680613b7857607f821691505b602082108103611f8957634e487b7160e01b600052602260045260246000fd5b600060208284031215613baa57600080fd5b5051919050565b6020808252602c908201526000805160206142c483398151915260408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201526000805160206142c483398151915260408201526b6163746976652070726f787960a01b606082015260800190565b6001600160a01b03929092168252602082015260400190565b8051801515811461235357600080fd5b600060208284031215613c6057600080fd5b610ae682613c3e565b634e487b7160e01b600052601160045260246000fd5b6001600160801b03818116838216019080821115613c9f57613c9f613c69565b5092915050565b808202811582820484141761094b5761094b613c69565b634e487b7160e01b600052601260045260246000fd5b600082613cf057634e487b7160e01b600052601260045260246000fd5b500490565b84815260ff84166020820152608060408201526000613d1760808301856135b7565b82810360608401526138de81856135b7565b600060408284031215613d3b57600080fd5b604080519081016001600160401b0381118282101715613d5d57613d5d6136e4565b604052825181526020928301519281019290925250919050565b600060808284031215613d8957600080fd5b613d916136fa565b90508151613d9e816135f6565b815260208201516001600160401b0381168114613dba57600080fd5b6020820152613dcb60408301613c3e565b6040820152606082015162ffffff81168114613de657600080fd5b606082015292915050565b60006020808385031215613e0457600080fd5b82516001600160401b03811115613e1a57600080fd5b8301601f81018513613e2b57600080fd5b8051613e396137d182613836565b81815260079190911b82018301908381019087831115613e5857600080fd5b928401925b828410156138de57613e6f8885613d77565b82528482019150608084019350613e5d565b60006020808385031215613e9457600080fd5b82516001600160401b03811115613eaa57600080fd5b8301601f81018513613ebb57600080fd5b8051613ec96137d182613836565b81815260059190911b82018301908381019087831115613ee857600080fd5b928401925b828410156138de57835182529284019290840190613eed565b634e487b7160e01b600052603260045260246000fd5b600060808284031215613f2e57600080fd5b610ae68383613d77565b80516001600160801b038116811461235357600080fd5b600060808284031215613f6157600080fd5b613f696136fa565b613f7283613f38565b8152613f8060208401613f38565b6020820152613f9160408401613f38565b6040820152613fa260608401613f38565b60608201529392505050565b600060208284031215613fc057600080fd5b81516001600160401b03811115613fd657600080fd5b8201601f81018413613fe757600080fd5b8051613ff56137d182613752565b81815285602083850101111561400a57600080fd5b61401b826020830160208601613593565b95945050505050565b8181038181111561094b5761094b613c69565b8082018082111561094b5761094b613c69565b600060018060a01b03808816835261ffff8716602084015285604084015284606084015260a060808401528084511660a08401528060208501511660c0840152506040830151606060e08401526140a56101008401826135b7565b98975050505050505050565b601f821115610b1e57600081815260208120601f850160051c810160208610156140d85750805b601f850160051c820191505b81811015611bb3578281556001016140e4565b81516001600160401b03811115614110576141106136e4565b6141248161411e8454613b64565b846140b1565b602080601f83116001811461415957600084156141415750858301515b600019600386901b1c1916600185901b178555611bb3565b600085815260208120601f198616915b8281101561418857888601518255948401946001909101908401614169565b50858210156141a65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351614233816017850160208801613593565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614264816028840160208801613593565b01602801949350505050565b60008161427f5761427f613c69565b506000190190565b60008251614299818460208701613593565b919091019291505056fee2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc446756e6374696f6e206d7573742062652063616c6c6564207468726f75676820360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc726f6c6c65642d757020766f74652066726f6d20676f7665726e616e636520746f6b656e20686f6c64657273416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a264697066735822122023c9c69398f2037290af29deefab711b1291a683cef72c278d91d6e35136c38464736f6c63430008130033
1
20,291,086
03e740fae63973646cff95a1dc7167ecad968ca2962c6b9465e64980f419258e
63e4c1449733ceca57d50c8c5392d6c3489c45433d4e0c56eaceec0a88a957b3
e90e278116574589fe37634739db2fbfcba4b2a2
e90e278116574589fe37634739db2fbfcba4b2a2
0db20f3b52bfdb93ba14a9bc06ab523d2afd8ef6
60806040526611c37937e080006004553480156019575f80fd5b503380603e57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b604581605c565b50600180546001600160a01b0319163317905560ab565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b614f23806100b85f395ff3fe6080604052600436106100a5575f3560e01c80637854ed12116100625780637854ed121461017f5780637d707aad1461019e5780638da5cb5b146101bd5780639ee67e10146101d9578063f2fde38b14610210578063f73aed201461022f575f80fd5b8063090e5465146100a95780631bec5b7a146100d15780632f03012e146100fc57806331b221cd146101235780635cd046d11461014a578063715018a614610169575b5f80fd5b3480156100b4575f80fd5b506100be60045481565b6040519081526020015b60405180910390f35b6100e46100df3660046105db565b61024e565b6040516001600160a01b0390911681526020016100c8565b348015610107575f80fd5b506100e473c3287bdef03b925a7c7f54791edadcd88e632ccd81565b34801561012e575f80fd5b506100e4730a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b348015610155575f80fd5b506001546100e4906001600160a01b031681565b348015610174575f80fd5b5061017d61043f565b005b34801561018a575f80fd5b5061017d61019936600461067a565b610452565b3480156101a9575f80fd5b5061017d6101b83660046106ac565b61045f565b3480156101c8575f80fd5b505f546001600160a01b03166100e4565b3480156101e4575f80fd5b506100be6101f336600461076b565b805160208183018101805160038252928201919093012091525481565b34801561021b575f80fd5b5061017d61022a3660046106ac565b610489565b34801561023a575f80fd5b506100e46102493660046107a5565b6104c6565b5f60045434101561029b5760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b60448201526064015b60405180910390fd5b5f8787878787876040516102ae90610586565b6102bd96959493929190610885565b604051809103905ff0801580156102d6573d5f803e3d5ffd5b5090506002888860048181106102ee576102ee610950565b90506020028101906103009190610964565b60405161030e9291906109a7565b908152604051602091819003820190208054600180820183555f928352929091200180546001600160a01b0319166001600160a01b03841617905560038989600481811061035e5761035e610950565b90506020028101906103709190610964565b60405161037e9291906109a7565b90815260200160405180910390205f82825461039a91906109b6565b90915550506001546040516001600160a01b03909116903480156108fc02915f818181858888f193505050501580156103d5573d5f803e3d5ffd5b507f986b269bc298e243448f506d0cf973af56bf7b2d5c2b37841394d10d236eb826338989600481811061040b5761040b610950565b905060200281019061041d9190610964565b60405161042c939291906109db565b60405180910390a1979650505050505050565b61044761050b565b6104505f610537565b565b61045a61050b565b600455565b61046761050b565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61049161050b565b6001600160a01b0381166104ba57604051631e4fbdf760e01b81525f6004820152602401610292565b6104c381610537565b50565b815160208184018101805160028252928201918501919091209190528054829081106104f0575f80fd5b5f918252602090912001546001600160a01b03169150829050565b5f546001600160a01b031633146104505760405163118cdaa760e01b8152336004820152602401610292565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6144e580610a0983390190565b5f8083601f8401126105a3575f80fd5b50813567ffffffffffffffff8111156105ba575f80fd5b6020830191508360208260051b85010111156105d4575f80fd5b9250929050565b5f805f805f80606087890312156105f0575f80fd5b863567ffffffffffffffff811115610606575f80fd5b61061289828a01610593565b909750955050602087013567ffffffffffffffff811115610631575f80fd5b61063d89828a01610593565b909550935050604087013567ffffffffffffffff81111561065c575f80fd5b61066889828a01610593565b979a9699509497509295939492505050565b5f6020828403121561068a575f80fd5b5035919050565b80356001600160a01b03811681146106a7575f80fd5b919050565b5f602082840312156106bc575f80fd5b6106c582610691565b9392505050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f8301126106ef575f80fd5b813567ffffffffffffffff811115610709576107096106cc565b604051601f8201601f19908116603f0116810167ffffffffffffffff81118282101715610738576107386106cc565b60405281815283820160200185101561074f575f80fd5b816020850160208301375f918101602001919091529392505050565b5f6020828403121561077b575f80fd5b813567ffffffffffffffff811115610791575f80fd5b61079d848285016106e0565b949350505050565b5f80604083850312156107b6575f80fd5b823567ffffffffffffffff8111156107cc575f80fd5b6107d8858286016106e0565b95602094909401359450505050565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b8183525f6001600160fb1b03831115610826575f80fd5b8260051b80836020870137939093016020019392505050565b8183526020830192505f815f5b8481101561087b576001600160a01b0361086583610691565b168652602095860195919091019060010161084c565b5093949350505050565b606080825281018690525f6080600588901b830181019083018983601e1936839003015b8b82101561091757868503607f1901845282358181126108c7575f80fd5b8d0160208101903567ffffffffffffffff8111156108e3575f80fd5b8036038213156108f1575f80fd5b6108fc8782846107e7565b965050506020830192506020840193506001820191506108a9565b50505050828103602084015261092e81878961080f565b9050828103604084015261094381858761083f565b9998505050505050505050565b634e487b7160e01b5f52603260045260245ffd5b5f808335601e19843603018112610979575f80fd5b83018035915067ffffffffffffffff821115610993575f80fd5b6020019150368190038213156105d4575f80fd5b818382375f9101908152919050565b808201808211156109d557634e487b7160e01b5f52601160045260245ffd5b92915050565b6001600160a01b03841681526040602082018190525f906109ff90830184866107e7565b9594505050505056fe60a060405260118054600160a01b600160e01b031916613d0960a51b179055348015610029575f80fd5b506040516144e53803806144e583398101604081905261004891610445565b825f8151811061005a5761005a6105a8565b602002602001015183600181518110610075576100756105a8565b6020026020010151825f8151811061008f5761008f6105a8565b6020908102919091010151730a0f4321214bb6c7811dd8a71cf587bdaf03f0a06080526001600160a01b0381166100df57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100e8816102b7565b5060016100f58382610640565b5060026101028282610640565b505050815f81518110610117576101176105a8565b6020026020010151600781905550805f81518110610137576101376105a8565b602002602001015160105f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600181518110610177576101776105a8565b602002602001015160115f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550826002815181106101b7576101b76105a8565b6020026020010151600c90816101cd9190610640565b50826003815181106101e1576101e16105a8565b6020026020010151600d90816101f79190610640565b508260048151811061020b5761020b6105a8565b6020026020010151600e90816102219190610640565b5081600181518110610235576102356105a8565b6020026020010151600b8190555081600281518110610256576102566105a8565b602002602001015160098190555081600381518110610277576102776105a8565b6020026020010151600a8190555082600581518110610298576102986105a8565b6020026020010151600f90816102ae9190610640565b505050506106fa565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171561034257610342610306565b604052919050565b5f6001600160401b0382111561036257610362610306565b5060051b60200190565b5f82601f83011261037b575f80fd5b815161038e6103898261034a565b61031a565b8082825260208201915060208360051b8601019250858311156103af575f80fd5b602085015b838110156103cc5780518352602092830192016103b4565b5095945050505050565b5f82601f8301126103e5575f80fd5b81516103f36103898261034a565b8082825260208201915060208360051b860101925085831115610414575f80fd5b602085015b838110156103cc5780516001600160a01b0381168114610437575f80fd5b835260209283019201610419565b5f805f60608486031215610457575f80fd5b83516001600160401b0381111561046c575f80fd5b8401601f8101861361047c575f80fd5b805161048a6103898261034a565b8082825260208201915060208360051b8501019250888311156104ab575f80fd5b602084015b838110156105495780516001600160401b038111156104cd575f80fd5b8501603f81018b136104dd575f80fd5b60208101516001600160401b038111156104f9576104f9610306565b61050c601f8201601f191660200161031a565b8181526040838301018d1015610520575f80fd5b8160408401602083015e5f602083830101528086525050506020830192506020810190506104b0565b506020880151909650925050506001600160401b03811115610569575f80fd5b6105758682870161036c565b604086015190935090506001600160401b03811115610592575f80fd5b61059e868287016103d6565b9150509250925092565b634e487b7160e01b5f52603260045260245ffd5b600181811c908216806105d057607f821691505b6020821081036105ee57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561063b57805f5260205f20601f840160051c810160208510156106195750805b601f840160051c820191505b81811015610638575f8155600101610625565b50505b505050565b81516001600160401b0381111561065957610659610306565b61066d8161066784546105bc565b846105f4565b6020601f82116001811461069f575f83156106885750848201515b5f19600385901b1c1916600184901b178455610638565b5f84815260208120601f198516915b828110156106ce57878501518255602094850194600190920191016106ae565b50848210156106eb57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b608051613db06107355f395f81816104ed01528181610cdd01528181611a7401528181611ab101528181611c5801526121f70152613db05ff3fe60806040526004361061035b575f3560e01c806370a08231116101bd578063b0347814116100f2578063de8f50a111610092578063ebd7edaf1161006d578063ebd7edaf146109a5578063ec3e5f45146109b9578063eda47704146109f7578063f2fde38b14610a16575f80fd5b8063de8f50a114610948578063e0be9bf914610967578063e985e9c514610986575f80fd5b8063b88d4fde116100cd578063b88d4fde146108e2578063c1d88c4414610901578063c745e3ff14610915578063c87b56dd14610929575f80fd5b8063b03478141461089a578063b0f7a3ff146108b9578063b7b6ccd5146108ce575f80fd5b80638da5cb5b1161015d578063a1a0e7fc11610138578063a1a0e7fc14610812578063a22cb46514610831578063ad72e1a514610850578063aea305071461087b575f80fd5b80638da5cb5b146107cf57806395d89b41146107eb5780639ee74dd1146107ff575f80fd5b80637df04787116101985780637df047871461073557806381d12c581461076c5780638500a45d1461079b5780638cbc52d9146107b0575f80fd5b806370a08231146106e3578063715018a61461070257806378564b7414610716575f80fd5b80633ccfd60b1161029357806358fd416d11610233578063628ae0a31161020e578063628ae0a3146106875780636352211e1461069b5780636817c76c146106ba578063702de1e3146106cf575f80fd5b806358fd416d146106235780635bb4688d146106425780635cec1b7614610672575f80fd5b8063414f11451161026e578063414f11451461059f57806342842e0e146105be5780634c34e4dc146105dd5780634ca0ce4c146105fc575f80fd5b80633ccfd60b1461054d5780633f37dce2146105615780633f3e4c1114610580575f80fd5b80632ab4d052116102fe5780632f03012e116102d95780632f03012e146104b557806331b221cd146104dc57806333727c4d1461050f5780633c1c8e491461052e575f80fd5b80632ab4d052146104625780632cfb2080146104775780632ddfb80714610496575f80fd5b8063095ea7b311610339578063095ea7b3146103eb578063122d1bad1461040c57806318160ddd1461042057806323b872dd14610443575f80fd5b806301ffc9a71461035f57806306fdde0314610393578063081812fc146103b4575b5f80fd5b34801561036a575f80fd5b5061037e610379366004612b52565b610a35565b60405190151581526020015b60405180910390f35b34801561039e575f80fd5b506103a7610a86565b60405161038a9190612ba2565b3480156103bf575f80fd5b506103d36103ce366004612bb4565b610b16565b6040516001600160a01b03909116815260200161038a565b3480156103f6575f80fd5b5061040a610405366004612be1565b610b3d565b005b348015610417575f80fd5b506103a7610b4c565b34801561042b575f80fd5b5061043560085481565b60405190815260200161038a565b34801561044e575f80fd5b5061040a61045d366004612c09565b610bd8565b34801561046d575f80fd5b50610435600b5481565b348015610482575f80fd5b5061040a610491366004612c43565b610c66565b3480156104a1575f80fd5b5061040a6104b0366004612c69565b610c9b565b3480156104c0575f80fd5b506103d373c3287bdef03b925a7c7f54791edadcd88e632ccd81565b3480156104e7575f80fd5b506103d37f000000000000000000000000000000000000000000000000000000000000000081565b34801561051a575f80fd5b5061037e610529366004612bb4565b610cc5565b348015610539575f80fd5b506103a7610548366004612d40565b610d4e565b348015610558575f80fd5b5061040a610d7c565b34801561056c575f80fd5b5061040a61057b366004612dc5565b610d90565b34801561058b575f80fd5b5061040a61059a366004612bb4565b610e6c565b3480156105aa575f80fd5b5061040a6105b9366004612e2f565b610e79565b3480156105c9575f80fd5b5061040a6105d8366004612c09565b610e93565b3480156105e8575f80fd5b506011546103d3906001600160a01b031681565b348015610607575f80fd5b506103d3730a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b34801561062e575f80fd5b506103a761063d366004612bb4565b610ead565b34801561064d575f80fd5b5061066161065c366004612bb4565b6110ef565b60405161038a959493929190612e6d565b34801561067d575f80fd5b50610435600a5481565b348015610692575f80fd5b506103a76112b8565b3480156106a6575f80fd5b506103d36106b5366004612bb4565b6112c5565b3480156106c5575f80fd5b5061043560075481565b3480156106da575f80fd5b506104356112cf565b3480156106ee575f80fd5b506104356106fd366004612c69565b6112ea565b34801561070d575f80fd5b5061040a61132f565b348015610721575f80fd5b5061040a610730366004612e2f565b611340565b348015610740575f80fd5b5061043561074f366004612ec8565b805160208183018101805160148252928201919093012091525481565b348015610777575f80fd5b5061078b610786366004612bb4565b611355565b60405161038a9493929190612ef9565b3480156107a6575f80fd5b5061043560095481565b3480156107bb575f80fd5b506103a76107ca366004612f3c565b611493565b3480156107da575f80fd5b505f546001600160a01b03166103d3565b3480156107f6575f80fd5b506103a76114c7565b61043561080d366004612f7f565b6114d6565b34801561081d575f80fd5b5061040a61082c366004612e2f565b6118fa565b34801561083c575f80fd5b5061040a61084b36600461303f565b61190f565b34801561085b575f80fd5b5061043561086a366004612bb4565b60166020525f908152604090205481565b348015610886575f80fd5b5061040a610895366004613074565b61191a565b3480156108a5575f80fd5b5061040a6108b4366004613119565b611a69565b3480156108c4575f80fd5b50610435611b5f81565b3480156108d9575f80fd5b5061040a611bef565b3480156108ed575f80fd5b5061040a6108fc366004613190565b611c10565b34801561090c575f80fd5b50610435611c27565b348015610920575f80fd5b506103a7611cc8565b348015610934575f80fd5b506103a7610943366004612bb4565b611cd5565b348015610953575f80fd5b5061037e6109623660046131f3565b611d84565b348015610972575f80fd5b506010546103d3906001600160a01b031681565b348015610991575f80fd5b5061037e6109a036600461328f565b611ee9565b3480156109b0575f80fd5b506103a7611f16565b3480156109c4575f80fd5b506011546109df90600160a01b90046001600160401b031681565b6040516001600160401b03909116815260200161038a565b348015610a02575f80fd5b5061040a610a11366004612c69565b611f23565b348015610a21575f80fd5b5061040a610a30366004612c69565b611f4d565b5f6001600160e01b031982166380ac58cd60e01b1480610a6557506001600160e01b03198216635b5e139f60e01b145b80610a8057506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060018054610a95906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac1906132c0565b8015610b0c5780601f10610ae357610100808354040283529160200191610b0c565b820191905f5260205f20905b815481529060010190602001808311610aef57829003601f168201915b5050505050905090565b5f610b2082611f8a565b505f828152600560205260409020546001600160a01b0316610a80565b610b48828233611fc2565b5050565b600f8054610b59906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054610b85906132c0565b8015610bd05780601f10610ba757610100808354040283529160200191610bd0565b820191905f5260205f20905b815481529060010190602001808311610bb357829003601f168201915b505050505081565b6001600160a01b038216610c0657604051633250574960e11b81525f60048201526024015b60405180910390fd5b5f610c12838333611fcf565b9050836001600160a01b0316816001600160a01b031614610c60576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610bfd565b50505050565b610c6e6120c1565b601180546001600160401b03909216600160a01b0267ffffffffffffffff60a01b19909216919091179055565b610ca36120c1565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516333727c4d60e01b8152600481018290525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906333727c4d90602401602060405180830381865afa158015610d2a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a8091906132f8565b60605f8284604051602001610d6492919061332a565b60408051808303601f19018152919052949350505050565b610d846120c1565b610d8e33476120ed565b565b610d9e848484848888611d84565b610dea5760405162461bcd60e51b815260206004820152601960248201527f455243373030373a20696e76616c6964206169676344617461000000000000006044820152606401610bfd565b5f60148585604051610dfd92919061333b565b908152604051908190036020018120549150610e1c908490849061333b565b60405180910390208585604051610e3492919061333b565b6040519081900381209083907fd77aab0eeab3a3cbdac072fcdbc34709b18d6c4af91f7869c71cbbb13d71a6b9905f90a45050505050565b610e746120c1565b600b55565b610e816120c1565b600e610e8e82848361338e565b505050565b610e8e83838360405180602001604052805f815250611c10565b5f8181526012602052604081206003015460609103610fc2575f8281526012602090815260409182902091517f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e392610f0c9290916001830191016134b5565b60408051601f1981840301815290829052610f26916134df565b90815260200160405180910390208054610f3f906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6b906132c0565b8015610fb65780601f10610f8d57610100808354040283529160200191610fb6565b820191905f5260205f20905b815481529060010190602001808311610f9957829003601f168201915b50505050509050919050565b5f828152601260209081526040808320600381015491519192610fea926001830191016134b5565b60408051601f1981840301815290829052611008929160200161332a565b60408051601f1981840301815290829052611b5f5f52601560205291507f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e3906110529083906134df565b9081526020016040518091039020805461106b906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054611097906132c0565b80156110e25780601f106110b9576101008083540402835291602001916110e2565b820191905f5260205f20905b8154815290600101906020018083116110c557829003601f168201915b5050505050915050919050565b60126020525f9081526040902080548190611109906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054611135906132c0565b80156111805780601f1061115757610100808354040283529160200191611180565b820191905f5260205f20905b81548152906001019060200180831161116357829003601f168201915b505050505090806001018054611195906132c0565b80601f01602080910402602001604051908101604052809291908181526020018280546111c1906132c0565b801561120c5780601f106111e35761010080835404028352916020019161120c565b820191905f5260205f20905b8154815290600101906020018083116111ef57829003601f168201915b505050505090806002018054611221906132c0565b80601f016020809104026020016040519081016040528092919081815260200182805461124d906132c0565b80156112985780601f1061126f57610100808354040283529160200191611298565b820191905f5260205f20905b81548152906001019060200180831161127b57829003601f168201915b5050505060038301546004909301549192916001600160a01b0316905085565b600c8054610b59906132c0565b5f610a8082611f8a565b5f6007546112db611c27565b6112e591906134fe565b905090565b5f6001600160a01b038216611314576040516322718ad960e21b81525f6004820152602401610bfd565b506001600160a01b03165f9081526004602052604090205490565b6113376120c1565b610d8e5f612180565b6113486120c1565b600c610e8e82848361338e565b60136020525f90815260409020805460018201546002830180546001600160a01b03909316939192611386906132c0565b80601f01602080910402602001604051908101604052809291908181526020018280546113b2906132c0565b80156113fd5780601f106113d4576101008083540402835291602001916113fd565b820191905f5260205f20905b8154815290600101906020018083116113e057829003601f168201915b505050505090806003018054611412906132c0565b80601f016020809104026020016040519081016040528092919081815260200182805461143e906132c0565b80156114895780601f1061146057610100808354040283529160200191611489565b820191905f5260205f20905b81548152906001019060200180831161146c57829003601f168201915b5050505050905084565b601560209081525f9283526040909220815180830184018051928152908401929093019190912091528054610b59906132c0565b606060028054610a95906132c0565b5f6009545f141580156114ea575060095442115b6115295760405162461bcd60e51b815260206004820152601060248201526f14d85b19481b9bdd081cdd185c9d195960821b6044820152606401610bfd565b600a5415806115395750600a5442105b6115725760405162461bcd60e51b815260206004820152600a60248201526914d85b1948195b99195960b21b6044820152606401610bfd565b5f8888888860405160200161158a9493929190613511565b604051602081830303815290604052905060146115a78285610d4e565b6040516115b491906134df565b9081526020016040518091039020545f1461161c5760405162461bcd60e51b815260206004820152602260248201527f70726f6d707420616e6420736565642068617320616c7265616479206d696e74604482015261195960f21b6064820152608401610bfd565b6116246112cf565b3410156116735760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f7567682066756e6420746f206d696e74204e465400000000006044820152606401610bfd565b600b5415806116855750600b54600854105b6116d15760405162461bcd60e51b815260206004820152601860248201527f4d617820746f74616c20737570706c79207265616368656400000000000000006044820152606401610bfd565b6011546001600160a01b03161561170757601154600754611707916001600160a01b03169061170290600a90613550565b6120ed565b6010546001600160a01b03161561174457601054600754611744916001600160a01b031690600a9061173a906009613563565b6117029190613550565b6040518060a001604052808a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250505090825250604080516020601f8b0181900481028201810190925289815291810191908a908a90819084018382808284375f92019190915250505090825250604080516020601f8901819004810282018101909252878152918101919088908890819084018382808284375f92018290525093855250505060208083018790526001600160a01b038e16604093840152600854825260129052208151819061182a908261357a565b506020820151600182019061183f908261357a565b5060408201516002820190611854908261357a565b5060608201516003820155608090910151600490910180546001600160a01b0319166001600160a01b0390921691909117905561189181846121cf565b61189d8a600854612347565b60088054905f6118ac83613634565b919050555060085460146118c08386610d4e565b6040516118cd91906134df565b908152604051908190036020019020556008546118ec9060019061364c565b9a9950505050505050505050565b6119026120c1565b600d610e8e82848361338e565b610b48338383612360565b60405163c4be5cab60e01b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9063c4be5cab906119539089908990600401613687565b6020604051808303815f875af115801561196f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611993919061369a565b5f888152601660205260409081902082905551630901e0f960e31b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9163480f07c8916119dd9190889088906004016136b1565b5f604051808303815f87803b1580156119f4575f80fd5b505af1158015611a06573d5f803e3d5ffd5b505050508585604051611a1a92919061333b565b6040518091039020877f65deac95b53ba76b9cdc6cf446af81731e1218c91eaf9811a95d28bde23b893e86868686604051611a5894939291906136ca565b60405180910390a350505050505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168114611ae65760405163432e033760e11b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015282166024820152604401610bfd565b5f86815260136020526040902080546001600160a01b0316611b3f5760405162461bcd60e51b815260206004820152601260248201527172657175657374206e6f742065786973747360701b6044820152606401610bfd565b611b5f5f526015602052604051869086907f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e390611b809060028601906136f0565b90815260200160405180910390209182611b9b92919061338e565b507faf2b2381ddcb18a2b18a7826186fd216acdd9c852a8c7a9a49e7eab127f96ccf8782600101548360020189898989604051611bde97969594939291906136fb565b60405180910390a150505050505050565b611bf76120c1565b6009545f03611c065742600955565b42600a555f600955565b611c1b848484610bd8565b610c60848484846123fe565b601154604051620e1d8d60e41b8152611b5f6004820152600160a01b9091046001600160401b031660248201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169062e1d8d090604401602060405180830381865afa158015611ca4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112e5919061369a565b600d8054610b59906132c0565b5f818152601260205260408120600381015460609291611d58916002820191906001820190611d0390612524565b5f88815260126020526040902060040154611d26906001600160a01b0316612628565b611d2f89610ead565b604051602001611d44969594939291906137ae565b604051602081830303815290604052612761565b90505f81604051602001611d6c9190613a3e565b60408051601f19818403018152919052949350505050565b5f8060148888604051611d9892919061333b565b9081526040805160209281900383018120545f8181526016909452918320546317861f8760e01b8252600482015290925073c3287bdef03b925a7c7f54791edadcd88e632ccd906317861f87906024015f60405180830381865afa158015611e02573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611e299190810190613a6f565b5f83815260166020526040908190205490516333727c4d60e01b815291925073c3287bdef03b925a7c7f54791edadcd88e632ccd916333727c4d91611e749160040190815260200190565b602060405180830381865afa158015611e8f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611eb391906132f8565b8015611edc57508686604051611eca92919061333b565b60405180910390208180519060200120145b9998505050505050505050565b6001600160a01b039182165f90815260066020908152604080832093909416825291909152205460ff1690565b600e8054610b59906132c0565b611f2b6120c1565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b611f556120c1565b6001600160a01b038116611f7e57604051631e4fbdf760e01b81525f6004820152602401610bfd565b611f8781612180565b50565b5f818152600360205260408120546001600160a01b031680610a8057604051637e27328960e01b815260048101849052602401610bfd565b610e8e83838360016128c3565b5f828152600360205260408120546001600160a01b0390811690831615611ffb57611ffb8184866129c7565b6001600160a01b03811615612035576120165f855f806128c3565b6001600160a01b0381165f90815260046020526040902080545f190190555b6001600160a01b03851615612063576001600160a01b0385165f908152600460205260409020805460010190555b5f8481526003602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b5f546001600160a01b03163314610d8e5760405163118cdaa760e01b8152336004820152602401610bfd565b804710156121105760405163cd78605960e01b8152306004820152602401610bfd565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114612159576040519150601f19603f3d011682016040523d82523d5f602084013e61215e565b606091505b5050905080610e8e57604051630a12f52160e11b815260040160405180910390fd5b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f81836040516020016121e392919061332a565b60405160208183030381529060405290505f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635b953806600754600a6122316112cf565b61223c90600b613563565b6122469190613550565b612250919061364c565b611b5f8530601160149054906101000a90046001600160401b03166040518663ffffffff1660e01b815260040161228a9493929190613ae3565b60206040518083038185885af11580156122a6573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906122cb919061369a565b5f818152601360205260409020909150600281016122e9848261357a565b5080546001600160a01b031916339081178255611b5f600183018190556040517fa0faead83d70148ae18b694377f9bef079251342ab90e14af0f9ef68b891269f926123389286928a90613b33565b60405180910390a15050505050565b610b48828260405180602001604052805f815250612a2b565b6001600160a01b03821661239257604051630b61174360e31b81526001600160a01b0383166004820152602401610bfd565b6001600160a01b038381165f81815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b15610c6057604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290612440903390889087908790600401613b69565b6020604051808303815f875af192505050801561247a575060408051601f3d908101601f1916820190925261247791810190613b9b565b60015b6124e1573d8080156124a7576040519150601f19603f3d011682016040523d82523d5f602084013e6124ac565b606091505b5080515f036124d957604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461251d57604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b5050505050565b6060815f0361254a5750506040805180820190915260018152600360fc1b602082015290565b815f5b8115612573578061255d81613634565b915061256c9050600a83613550565b915061254d565b5f816001600160401b0381111561258c5761258c612c82565b6040519080825280601f01601f1916602001820160405280156125b6576020820181803683370190505b5090505b8415612620576125cb60018361364c565b91506125d8600a86613bb6565b6125e39060306134fe565b60f81b8183815181106125f8576125f8613bc9565b60200101906001600160f81b03191690815f1a905350612619600a86613550565b94506125ba565b949350505050565b60408051602880825260608281019093525f91906020820181803683370190505090505f5b601481101561275a575f61266282601361364c565b61266d906008613563565b612678906002613cc0565b61268b906001600160a01b038716613550565b60f81b90505f60108260f81c6126a19190613ccb565b60f81b90505f8160f81c60106126b79190613cec565b8360f81c6126c59190613d08565b60f81b90506126d382612a41565b856126df866002613563565b815181106126ef576126ef613bc9565b60200101906001600160f81b03191690815f1a90535061270e81612a41565b8561271a866002613563565b6127259060016134fe565b8151811061273557612735613bc9565b60200101906001600160f81b03191690815f1a905350506001909201915061264d9050565b5092915050565b80516060905f81900361278357505060408051602081019091525f8152919050565b5f60036127918360026134fe565b61279b9190613550565b6127a6906004613563565b90505f6127b48260206134fe565b6001600160401b038111156127cb576127cb612c82565b6040519080825280601f01601f1916602001820160405280156127f5576020820181803683370190505b5090505f604051806060016040528060408152602001613d3b60409139905060018101602083015f5b8681101561287f576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b83526004909201910161281e565b50600386066001811461289957600281146128aa576128b5565b613d3d60f01b6001198301526128b5565b603d60f81b5f198301525b505050918152949350505050565b80806128d757506001600160a01b03821615155b15612998575f6128e684611f8a565b90506001600160a01b038316158015906129125750826001600160a01b0316816001600160a01b031614155b801561292557506129238184611ee9565b155b1561294e5760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610bfd565b81156129965783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260056020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6129d2838383612a7b565b610e8e576001600160a01b038316612a0057604051637e27328960e01b815260048101829052602401610bfd565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610bfd565b612a358383612adc565b610e8e5f8484846123fe565b5f600a60f883901c1015612a6757612a5e60f883901c6030613d21565b60f81b92915050565b612a5e60f883901c6057613d21565b919050565b5f6001600160a01b038316158015906126205750826001600160a01b0316846001600160a01b03161480612ab45750612ab48484611ee9565b806126205750505f908152600560205260409020546001600160a01b03908116911614919050565b6001600160a01b038216612b0557604051633250574960e11b81525f6004820152602401610bfd565b5f612b1183835f611fcf565b90506001600160a01b03811615610e8e576040516339e3563760e11b81525f6004820152602401610bfd565b6001600160e01b031981168114611f87575f80fd5b5f60208284031215612b62575f80fd5b8135612b6d81612b3d565b9392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f612b6d6020830184612b74565b5f60208284031215612bc4575f80fd5b5035919050565b80356001600160a01b0381168114612a76575f80fd5b5f8060408385031215612bf2575f80fd5b612bfb83612bcb565b946020939093013593505050565b5f805f60608486031215612c1b575f80fd5b612c2484612bcb565b9250612c3260208501612bcb565b929592945050506040919091013590565b5f60208284031215612c53575f80fd5b81356001600160401b0381168114612b6d575f80fd5b5f60208284031215612c79575f80fd5b612b6d82612bcb565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715612cbe57612cbe612c82565b604052919050565b5f6001600160401b03821115612cde57612cde612c82565b50601f01601f191660200190565b5f82601f830112612cfb575f80fd5b8135602083015f612d13612d0e84612cc6565b612c96565b9050828152858383011115612d26575f80fd5b828260208301375f92810160200192909252509392505050565b5f8060408385031215612d51575f80fd5b82356001600160401b03811115612d66575f80fd5b612d7285828601612cec565b95602094909401359450505050565b5f8083601f840112612d91575f80fd5b5081356001600160401b03811115612da7575f80fd5b602083019150836020828501011115612dbe575f80fd5b9250929050565b5f805f8060408587031215612dd8575f80fd5b84356001600160401b03811115612ded575f80fd5b612df987828801612d81565b90955093505060208501356001600160401b03811115612e17575f80fd5b612e2387828801612d81565b95989497509550505050565b5f8060208385031215612e40575f80fd5b82356001600160401b03811115612e55575f80fd5b612e6185828601612d81565b90969095509350505050565b60a081525f612e7f60a0830188612b74565b8281036020840152612e918188612b74565b90508281036040840152612ea58187612b74565b606084019590955250506001600160a01b03919091166080909101529392505050565b5f60208284031215612ed8575f80fd5b81356001600160401b03811115612eed575f80fd5b61262084828501612cec565b60018060a01b0385168152836020820152608060408201525f612f1f6080830185612b74565b8281036060840152612f318185612b74565b979650505050505050565b5f8060408385031215612f4d575f80fd5b8235915060208301356001600160401b03811115612f69575f80fd5b612f7585828601612cec565b9150509250929050565b5f805f805f805f8060a0898b031215612f96575f80fd5b612f9f89612bcb565b975060208901356001600160401b03811115612fb9575f80fd5b612fc58b828c01612d81565b90985096505060408901356001600160401b03811115612fe3575f80fd5b612fef8b828c01612d81565b90965094505060608901356001600160401b0381111561300d575f80fd5b6130198b828c01612d81565b999c989b50969995989497949560800135949350505050565b8015158114611f87575f80fd5b5f8060408385031215613050575f80fd5b61305983612bcb565b9150602083013561306981613032565b809150509250929050565b5f805f805f805f6080888a03121561308a575f80fd5b8735965060208801356001600160401b038111156130a6575f80fd5b6130b28a828b01612d81565b90975095505060408801356001600160401b038111156130d0575f80fd5b6130dc8a828b01612d81565b90955093505060608801356001600160401b038111156130fa575f80fd5b6131068a828b01612d81565b989b979a50959850939692959293505050565b5f805f805f6060868803121561312d575f80fd5b8535945060208601356001600160401b03811115613149575f80fd5b61315588828901612d81565b90955093505060408601356001600160401b03811115613173575f80fd5b61317f88828901612d81565b969995985093965092949392505050565b5f805f80608085870312156131a3575f80fd5b6131ac85612bcb565b93506131ba60208601612bcb565b92506040850135915060608501356001600160401b038111156131db575f80fd5b6131e787828801612cec565b91505092959194509250565b5f805f805f8060608789031215613208575f80fd5b86356001600160401b0381111561321d575f80fd5b61322989828a01612d81565b90975095505060208701356001600160401b03811115613247575f80fd5b61325389828a01612d81565b90955093505060408701356001600160401b03811115613271575f80fd5b61327d89828a01612d81565b979a9699509497509295939492505050565b5f80604083850312156132a0575f80fd5b6132a983612bcb565b91506132b760208401612bcb565b90509250929050565b600181811c908216806132d457607f821691505b6020821081036132f257634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215613308575f80fd5b8151612b6d81613032565b5f81518060208401855e5f93019283525090919050565b8281525f6126206020830184613313565b818382375f9101908152919050565b601f821115610e8e57805f5260205f20601f840160051c8101602085101561336f5750805b601f840160051c820191505b8181101561251d575f815560010161337b565b6001600160401b038311156133a5576133a5612c82565b6133b9836133b383546132c0565b8361334a565b5f601f8411600181146133ea575f85156133d35750838201355b5f19600387901b1c1916600186901b17835561251d565b5f83815260208120601f198716915b8281101561341957868501358255602094850194600190920191016133f9565b5086821015613435575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f8154613453816132c0565b60018216801561346a576001811461347f576134ac565b60ff19831686528115158202860193506134ac565b845f5260205f205f5b838110156134a457815488820152600190910190602001613488565b505081860193505b50505092915050565b5f6134c08285613447565b622d2d2d60e81b81526134d66003820185613447565b95945050505050565b5f612b6d8284613313565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610a8057610a806134ea565b838582375f848201622d2d2d60e81b8152838560038301375f93016003019283525090949350505050565b634e487b7160e01b5f52601260045260245ffd5b5f8261355e5761355e61353c565b500490565b8082028115828204841417610a8057610a806134ea565b81516001600160401b0381111561359357613593612c82565b6135a7816135a184546132c0565b8461334a565b6020601f8211600181146135d9575f83156135c25750848201515b5f19600385901b1c1916600184901b17845561251d565b5f84815260208120601f198516915b8281101561360857878501518255602094850194600190920191016135e8565b508482101561362557868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f60018201613645576136456134ea565b5060010190565b81810381811115610a8057610a806134ea565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b602081525f61262060208301848661365f565b5f602082840312156136aa575f80fd5b5051919050565b838152604060208201525f6134d660408301848661365f565b604081525f6136dd60408301868861365f565b8281036020840152612f3181858761365f565b5f612b6d8284613447565b87815286602082015260a060408201525f808754613718816132c0565b8060a0860152600182165f8114613736576001811461375257613783565b60ff19831660c087015260c082151560051b8701019350613783565b8a5f5260205f205f5b8381101561377a57815488820160c0015260019091019060200161375b565b870160c0019450505b505050828103606084015261379981878961365f565b905082810360808401526118ec81858761365f565b683d913730b6b2911d1160b91b81525f6137cb6009830189613447565b7f222c202261747472696275746573223a205b7b2274726169745f74797065223a81527f2022706f7369746976655f70726f6d7074222c202276616c7565223a202200006020820152613821603e820189613447565b7f227d2c207b2274726169745f74797065223a20226e656761746976655f70726f81526f36b83a111610113b30b63ab2911d101160811b6020820152905061386c6030820188613447565b7f227d2c207b2274726169745f74797065223a202273656564222c202276616c7581526432911d101160d91b602082015290506138ac6025820187613313565b7f227d2c207b2274726169745f74797065223a2022617574686f72222c202276618152680d8eaca4474404460f60bb1b602082015290506138f06029820186613313565b7f227d2c207b2274726169745f74797065223a20226d6f64656c222c202276616c81527f7565223a2022537461626c6520446966667573696f6e227d5d2c20226465736360208201527f72697074696f6e223a2022537461626c6520446966667573696f6e206973206160408201527f206c6174656e7420746578742d746f2d696d61676520646966667573696f6e2060608201527f6d6f64656c2063617061626c65206f662067656e65726174696e672070686f7460808201527f6f2d7265616c697374696320696d6167657320676976656e20616e792074657860a08201527f7420696e7075742e222c2022696d616765223a202268747470733a2f2f67617460c08201527f657761792e70696e6174612e636c6f75642f697066732f00000000000000000060e0820152905060f781016118ec613a308287613313565b61227d60f01b815260020190565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081525f612b6d601d830184613313565b5f60208284031215613a7f575f80fd5b81516001600160401b03811115613a94575f80fd5b8201601f81018413613aa4575f80fd5b8051613ab2612d0e82612cc6565b818152856020838501011115613ac6575f80fd5b8160208401602083015e5f91810160200191909152949350505050565b84815260a060208201525f613afb60a0830186612b74565b6001600160a01b03949094166040830152506001600160401b039190911660608201528082036080909101525f815260200192915050565b84815260018060a01b0384166020820152826040820152608060608201525f613b5f6080830184612b74565b9695505050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90613b5f90830184612b74565b5f60208284031215613bab575f80fd5b8151612b6d81612b3d565b5f82613bc457613bc461353c565b500690565b634e487b7160e01b5f52603260045260245ffd5b6001815b6001841115613c1857808504811115613bfc57613bfc6134ea565b6001841615613c0a57908102905b60019390931c928002613be1565b935093915050565b5f82613c2e57506001610a80565b81613c3a57505f610a80565b8160018114613c505760028114613c5a57613c76565b6001915050610a80565b60ff841115613c6b57613c6b6134ea565b50506001821b610a80565b5060208310610133831016604e8410600b8410161715613c99575081810a610a80565b613ca55f198484613bdd565b805f1904821115613cb857613cb86134ea565b029392505050565b5f612b6d8383613c20565b5f60ff831680613cdd57613cdd61353c565b8060ff84160491505092915050565b60ff818116838216029081169081811461275a5761275a6134ea565b60ff8281168282160390811115610a8057610a806134ea565b60ff8181168382160190811115610a8057610a806134ea56fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220aff7a61b300fa2c725d72029241f4a226edc4a3406524cc217685fb8c760ed9864736f6c634300081a0033a2646970667358221220280a1846e27b2758fe40d8b29f60ba2a26730f608c33803e56dc066a28d6c40664736f6c634300081a0033
6080604052600436106100a5575f3560e01c80637854ed12116100625780637854ed121461017f5780637d707aad1461019e5780638da5cb5b146101bd5780639ee67e10146101d9578063f2fde38b14610210578063f73aed201461022f575f80fd5b8063090e5465146100a95780631bec5b7a146100d15780632f03012e146100fc57806331b221cd146101235780635cd046d11461014a578063715018a614610169575b5f80fd5b3480156100b4575f80fd5b506100be60045481565b6040519081526020015b60405180910390f35b6100e46100df3660046105db565b61024e565b6040516001600160a01b0390911681526020016100c8565b348015610107575f80fd5b506100e473c3287bdef03b925a7c7f54791edadcd88e632ccd81565b34801561012e575f80fd5b506100e4730a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b348015610155575f80fd5b506001546100e4906001600160a01b031681565b348015610174575f80fd5b5061017d61043f565b005b34801561018a575f80fd5b5061017d61019936600461067a565b610452565b3480156101a9575f80fd5b5061017d6101b83660046106ac565b61045f565b3480156101c8575f80fd5b505f546001600160a01b03166100e4565b3480156101e4575f80fd5b506100be6101f336600461076b565b805160208183018101805160038252928201919093012091525481565b34801561021b575f80fd5b5061017d61022a3660046106ac565b610489565b34801561023a575f80fd5b506100e46102493660046107a5565b6104c6565b5f60045434101561029b5760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b60448201526064015b60405180910390fd5b5f8787878787876040516102ae90610586565b6102bd96959493929190610885565b604051809103905ff0801580156102d6573d5f803e3d5ffd5b5090506002888860048181106102ee576102ee610950565b90506020028101906103009190610964565b60405161030e9291906109a7565b908152604051602091819003820190208054600180820183555f928352929091200180546001600160a01b0319166001600160a01b03841617905560038989600481811061035e5761035e610950565b90506020028101906103709190610964565b60405161037e9291906109a7565b90815260200160405180910390205f82825461039a91906109b6565b90915550506001546040516001600160a01b03909116903480156108fc02915f818181858888f193505050501580156103d5573d5f803e3d5ffd5b507f986b269bc298e243448f506d0cf973af56bf7b2d5c2b37841394d10d236eb826338989600481811061040b5761040b610950565b905060200281019061041d9190610964565b60405161042c939291906109db565b60405180910390a1979650505050505050565b61044761050b565b6104505f610537565b565b61045a61050b565b600455565b61046761050b565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61049161050b565b6001600160a01b0381166104ba57604051631e4fbdf760e01b81525f6004820152602401610292565b6104c381610537565b50565b815160208184018101805160028252928201918501919091209190528054829081106104f0575f80fd5b5f918252602090912001546001600160a01b03169150829050565b5f546001600160a01b031633146104505760405163118cdaa760e01b8152336004820152602401610292565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6144e580610a0983390190565b5f8083601f8401126105a3575f80fd5b50813567ffffffffffffffff8111156105ba575f80fd5b6020830191508360208260051b85010111156105d4575f80fd5b9250929050565b5f805f805f80606087890312156105f0575f80fd5b863567ffffffffffffffff811115610606575f80fd5b61061289828a01610593565b909750955050602087013567ffffffffffffffff811115610631575f80fd5b61063d89828a01610593565b909550935050604087013567ffffffffffffffff81111561065c575f80fd5b61066889828a01610593565b979a9699509497509295939492505050565b5f6020828403121561068a575f80fd5b5035919050565b80356001600160a01b03811681146106a7575f80fd5b919050565b5f602082840312156106bc575f80fd5b6106c582610691565b9392505050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f8301126106ef575f80fd5b813567ffffffffffffffff811115610709576107096106cc565b604051601f8201601f19908116603f0116810167ffffffffffffffff81118282101715610738576107386106cc565b60405281815283820160200185101561074f575f80fd5b816020850160208301375f918101602001919091529392505050565b5f6020828403121561077b575f80fd5b813567ffffffffffffffff811115610791575f80fd5b61079d848285016106e0565b949350505050565b5f80604083850312156107b6575f80fd5b823567ffffffffffffffff8111156107cc575f80fd5b6107d8858286016106e0565b95602094909401359450505050565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b8183525f6001600160fb1b03831115610826575f80fd5b8260051b80836020870137939093016020019392505050565b8183526020830192505f815f5b8481101561087b576001600160a01b0361086583610691565b168652602095860195919091019060010161084c565b5093949350505050565b606080825281018690525f6080600588901b830181019083018983601e1936839003015b8b82101561091757868503607f1901845282358181126108c7575f80fd5b8d0160208101903567ffffffffffffffff8111156108e3575f80fd5b8036038213156108f1575f80fd5b6108fc8782846107e7565b965050506020830192506020840193506001820191506108a9565b50505050828103602084015261092e81878961080f565b9050828103604084015261094381858761083f565b9998505050505050505050565b634e487b7160e01b5f52603260045260245ffd5b5f808335601e19843603018112610979575f80fd5b83018035915067ffffffffffffffff821115610993575f80fd5b6020019150368190038213156105d4575f80fd5b818382375f9101908152919050565b808201808211156109d557634e487b7160e01b5f52601160045260245ffd5b92915050565b6001600160a01b03841681526040602082018190525f906109ff90830184866107e7565b9594505050505056fe60a060405260118054600160a01b600160e01b031916613d0960a51b179055348015610029575f80fd5b506040516144e53803806144e583398101604081905261004891610445565b825f8151811061005a5761005a6105a8565b602002602001015183600181518110610075576100756105a8565b6020026020010151825f8151811061008f5761008f6105a8565b6020908102919091010151730a0f4321214bb6c7811dd8a71cf587bdaf03f0a06080526001600160a01b0381166100df57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100e8816102b7565b5060016100f58382610640565b5060026101028282610640565b505050815f81518110610117576101176105a8565b6020026020010151600781905550805f81518110610137576101376105a8565b602002602001015160105f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600181518110610177576101776105a8565b602002602001015160115f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550826002815181106101b7576101b76105a8565b6020026020010151600c90816101cd9190610640565b50826003815181106101e1576101e16105a8565b6020026020010151600d90816101f79190610640565b508260048151811061020b5761020b6105a8565b6020026020010151600e90816102219190610640565b5081600181518110610235576102356105a8565b6020026020010151600b8190555081600281518110610256576102566105a8565b602002602001015160098190555081600381518110610277576102776105a8565b6020026020010151600a8190555082600581518110610298576102986105a8565b6020026020010151600f90816102ae9190610640565b505050506106fa565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171561034257610342610306565b604052919050565b5f6001600160401b0382111561036257610362610306565b5060051b60200190565b5f82601f83011261037b575f80fd5b815161038e6103898261034a565b61031a565b8082825260208201915060208360051b8601019250858311156103af575f80fd5b602085015b838110156103cc5780518352602092830192016103b4565b5095945050505050565b5f82601f8301126103e5575f80fd5b81516103f36103898261034a565b8082825260208201915060208360051b860101925085831115610414575f80fd5b602085015b838110156103cc5780516001600160a01b0381168114610437575f80fd5b835260209283019201610419565b5f805f60608486031215610457575f80fd5b83516001600160401b0381111561046c575f80fd5b8401601f8101861361047c575f80fd5b805161048a6103898261034a565b8082825260208201915060208360051b8501019250888311156104ab575f80fd5b602084015b838110156105495780516001600160401b038111156104cd575f80fd5b8501603f81018b136104dd575f80fd5b60208101516001600160401b038111156104f9576104f9610306565b61050c601f8201601f191660200161031a565b8181526040838301018d1015610520575f80fd5b8160408401602083015e5f602083830101528086525050506020830192506020810190506104b0565b506020880151909650925050506001600160401b03811115610569575f80fd5b6105758682870161036c565b604086015190935090506001600160401b03811115610592575f80fd5b61059e868287016103d6565b9150509250925092565b634e487b7160e01b5f52603260045260245ffd5b600181811c908216806105d057607f821691505b6020821081036105ee57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561063b57805f5260205f20601f840160051c810160208510156106195750805b601f840160051c820191505b81811015610638575f8155600101610625565b50505b505050565b81516001600160401b0381111561065957610659610306565b61066d8161066784546105bc565b846105f4565b6020601f82116001811461069f575f83156106885750848201515b5f19600385901b1c1916600184901b178455610638565b5f84815260208120601f198516915b828110156106ce57878501518255602094850194600190920191016106ae565b50848210156106eb57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b608051613db06107355f395f81816104ed01528181610cdd01528181611a7401528181611ab101528181611c5801526121f70152613db05ff3fe60806040526004361061035b575f3560e01c806370a08231116101bd578063b0347814116100f2578063de8f50a111610092578063ebd7edaf1161006d578063ebd7edaf146109a5578063ec3e5f45146109b9578063eda47704146109f7578063f2fde38b14610a16575f80fd5b8063de8f50a114610948578063e0be9bf914610967578063e985e9c514610986575f80fd5b8063b88d4fde116100cd578063b88d4fde146108e2578063c1d88c4414610901578063c745e3ff14610915578063c87b56dd14610929575f80fd5b8063b03478141461089a578063b0f7a3ff146108b9578063b7b6ccd5146108ce575f80fd5b80638da5cb5b1161015d578063a1a0e7fc11610138578063a1a0e7fc14610812578063a22cb46514610831578063ad72e1a514610850578063aea305071461087b575f80fd5b80638da5cb5b146107cf57806395d89b41146107eb5780639ee74dd1146107ff575f80fd5b80637df04787116101985780637df047871461073557806381d12c581461076c5780638500a45d1461079b5780638cbc52d9146107b0575f80fd5b806370a08231146106e3578063715018a61461070257806378564b7414610716575f80fd5b80633ccfd60b1161029357806358fd416d11610233578063628ae0a31161020e578063628ae0a3146106875780636352211e1461069b5780636817c76c146106ba578063702de1e3146106cf575f80fd5b806358fd416d146106235780635bb4688d146106425780635cec1b7614610672575f80fd5b8063414f11451161026e578063414f11451461059f57806342842e0e146105be5780634c34e4dc146105dd5780634ca0ce4c146105fc575f80fd5b80633ccfd60b1461054d5780633f37dce2146105615780633f3e4c1114610580575f80fd5b80632ab4d052116102fe5780632f03012e116102d95780632f03012e146104b557806331b221cd146104dc57806333727c4d1461050f5780633c1c8e491461052e575f80fd5b80632ab4d052146104625780632cfb2080146104775780632ddfb80714610496575f80fd5b8063095ea7b311610339578063095ea7b3146103eb578063122d1bad1461040c57806318160ddd1461042057806323b872dd14610443575f80fd5b806301ffc9a71461035f57806306fdde0314610393578063081812fc146103b4575b5f80fd5b34801561036a575f80fd5b5061037e610379366004612b52565b610a35565b60405190151581526020015b60405180910390f35b34801561039e575f80fd5b506103a7610a86565b60405161038a9190612ba2565b3480156103bf575f80fd5b506103d36103ce366004612bb4565b610b16565b6040516001600160a01b03909116815260200161038a565b3480156103f6575f80fd5b5061040a610405366004612be1565b610b3d565b005b348015610417575f80fd5b506103a7610b4c565b34801561042b575f80fd5b5061043560085481565b60405190815260200161038a565b34801561044e575f80fd5b5061040a61045d366004612c09565b610bd8565b34801561046d575f80fd5b50610435600b5481565b348015610482575f80fd5b5061040a610491366004612c43565b610c66565b3480156104a1575f80fd5b5061040a6104b0366004612c69565b610c9b565b3480156104c0575f80fd5b506103d373c3287bdef03b925a7c7f54791edadcd88e632ccd81565b3480156104e7575f80fd5b506103d37f000000000000000000000000000000000000000000000000000000000000000081565b34801561051a575f80fd5b5061037e610529366004612bb4565b610cc5565b348015610539575f80fd5b506103a7610548366004612d40565b610d4e565b348015610558575f80fd5b5061040a610d7c565b34801561056c575f80fd5b5061040a61057b366004612dc5565b610d90565b34801561058b575f80fd5b5061040a61059a366004612bb4565b610e6c565b3480156105aa575f80fd5b5061040a6105b9366004612e2f565b610e79565b3480156105c9575f80fd5b5061040a6105d8366004612c09565b610e93565b3480156105e8575f80fd5b506011546103d3906001600160a01b031681565b348015610607575f80fd5b506103d3730a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b34801561062e575f80fd5b506103a761063d366004612bb4565b610ead565b34801561064d575f80fd5b5061066161065c366004612bb4565b6110ef565b60405161038a959493929190612e6d565b34801561067d575f80fd5b50610435600a5481565b348015610692575f80fd5b506103a76112b8565b3480156106a6575f80fd5b506103d36106b5366004612bb4565b6112c5565b3480156106c5575f80fd5b5061043560075481565b3480156106da575f80fd5b506104356112cf565b3480156106ee575f80fd5b506104356106fd366004612c69565b6112ea565b34801561070d575f80fd5b5061040a61132f565b348015610721575f80fd5b5061040a610730366004612e2f565b611340565b348015610740575f80fd5b5061043561074f366004612ec8565b805160208183018101805160148252928201919093012091525481565b348015610777575f80fd5b5061078b610786366004612bb4565b611355565b60405161038a9493929190612ef9565b3480156107a6575f80fd5b5061043560095481565b3480156107bb575f80fd5b506103a76107ca366004612f3c565b611493565b3480156107da575f80fd5b505f546001600160a01b03166103d3565b3480156107f6575f80fd5b506103a76114c7565b61043561080d366004612f7f565b6114d6565b34801561081d575f80fd5b5061040a61082c366004612e2f565b6118fa565b34801561083c575f80fd5b5061040a61084b36600461303f565b61190f565b34801561085b575f80fd5b5061043561086a366004612bb4565b60166020525f908152604090205481565b348015610886575f80fd5b5061040a610895366004613074565b61191a565b3480156108a5575f80fd5b5061040a6108b4366004613119565b611a69565b3480156108c4575f80fd5b50610435611b5f81565b3480156108d9575f80fd5b5061040a611bef565b3480156108ed575f80fd5b5061040a6108fc366004613190565b611c10565b34801561090c575f80fd5b50610435611c27565b348015610920575f80fd5b506103a7611cc8565b348015610934575f80fd5b506103a7610943366004612bb4565b611cd5565b348015610953575f80fd5b5061037e6109623660046131f3565b611d84565b348015610972575f80fd5b506010546103d3906001600160a01b031681565b348015610991575f80fd5b5061037e6109a036600461328f565b611ee9565b3480156109b0575f80fd5b506103a7611f16565b3480156109c4575f80fd5b506011546109df90600160a01b90046001600160401b031681565b6040516001600160401b03909116815260200161038a565b348015610a02575f80fd5b5061040a610a11366004612c69565b611f23565b348015610a21575f80fd5b5061040a610a30366004612c69565b611f4d565b5f6001600160e01b031982166380ac58cd60e01b1480610a6557506001600160e01b03198216635b5e139f60e01b145b80610a8057506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060018054610a95906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac1906132c0565b8015610b0c5780601f10610ae357610100808354040283529160200191610b0c565b820191905f5260205f20905b815481529060010190602001808311610aef57829003601f168201915b5050505050905090565b5f610b2082611f8a565b505f828152600560205260409020546001600160a01b0316610a80565b610b48828233611fc2565b5050565b600f8054610b59906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054610b85906132c0565b8015610bd05780601f10610ba757610100808354040283529160200191610bd0565b820191905f5260205f20905b815481529060010190602001808311610bb357829003601f168201915b505050505081565b6001600160a01b038216610c0657604051633250574960e11b81525f60048201526024015b60405180910390fd5b5f610c12838333611fcf565b9050836001600160a01b0316816001600160a01b031614610c60576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610bfd565b50505050565b610c6e6120c1565b601180546001600160401b03909216600160a01b0267ffffffffffffffff60a01b19909216919091179055565b610ca36120c1565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516333727c4d60e01b8152600481018290525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906333727c4d90602401602060405180830381865afa158015610d2a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a8091906132f8565b60605f8284604051602001610d6492919061332a565b60408051808303601f19018152919052949350505050565b610d846120c1565b610d8e33476120ed565b565b610d9e848484848888611d84565b610dea5760405162461bcd60e51b815260206004820152601960248201527f455243373030373a20696e76616c6964206169676344617461000000000000006044820152606401610bfd565b5f60148585604051610dfd92919061333b565b908152604051908190036020018120549150610e1c908490849061333b565b60405180910390208585604051610e3492919061333b565b6040519081900381209083907fd77aab0eeab3a3cbdac072fcdbc34709b18d6c4af91f7869c71cbbb13d71a6b9905f90a45050505050565b610e746120c1565b600b55565b610e816120c1565b600e610e8e82848361338e565b505050565b610e8e83838360405180602001604052805f815250611c10565b5f8181526012602052604081206003015460609103610fc2575f8281526012602090815260409182902091517f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e392610f0c9290916001830191016134b5565b60408051601f1981840301815290829052610f26916134df565b90815260200160405180910390208054610f3f906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6b906132c0565b8015610fb65780601f10610f8d57610100808354040283529160200191610fb6565b820191905f5260205f20905b815481529060010190602001808311610f9957829003601f168201915b50505050509050919050565b5f828152601260209081526040808320600381015491519192610fea926001830191016134b5565b60408051601f1981840301815290829052611008929160200161332a565b60408051601f1981840301815290829052611b5f5f52601560205291507f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e3906110529083906134df565b9081526020016040518091039020805461106b906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054611097906132c0565b80156110e25780601f106110b9576101008083540402835291602001916110e2565b820191905f5260205f20905b8154815290600101906020018083116110c557829003601f168201915b5050505050915050919050565b60126020525f9081526040902080548190611109906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054611135906132c0565b80156111805780601f1061115757610100808354040283529160200191611180565b820191905f5260205f20905b81548152906001019060200180831161116357829003601f168201915b505050505090806001018054611195906132c0565b80601f01602080910402602001604051908101604052809291908181526020018280546111c1906132c0565b801561120c5780601f106111e35761010080835404028352916020019161120c565b820191905f5260205f20905b8154815290600101906020018083116111ef57829003601f168201915b505050505090806002018054611221906132c0565b80601f016020809104026020016040519081016040528092919081815260200182805461124d906132c0565b80156112985780601f1061126f57610100808354040283529160200191611298565b820191905f5260205f20905b81548152906001019060200180831161127b57829003601f168201915b5050505060038301546004909301549192916001600160a01b0316905085565b600c8054610b59906132c0565b5f610a8082611f8a565b5f6007546112db611c27565b6112e591906134fe565b905090565b5f6001600160a01b038216611314576040516322718ad960e21b81525f6004820152602401610bfd565b506001600160a01b03165f9081526004602052604090205490565b6113376120c1565b610d8e5f612180565b6113486120c1565b600c610e8e82848361338e565b60136020525f90815260409020805460018201546002830180546001600160a01b03909316939192611386906132c0565b80601f01602080910402602001604051908101604052809291908181526020018280546113b2906132c0565b80156113fd5780601f106113d4576101008083540402835291602001916113fd565b820191905f5260205f20905b8154815290600101906020018083116113e057829003601f168201915b505050505090806003018054611412906132c0565b80601f016020809104026020016040519081016040528092919081815260200182805461143e906132c0565b80156114895780601f1061146057610100808354040283529160200191611489565b820191905f5260205f20905b81548152906001019060200180831161146c57829003601f168201915b5050505050905084565b601560209081525f9283526040909220815180830184018051928152908401929093019190912091528054610b59906132c0565b606060028054610a95906132c0565b5f6009545f141580156114ea575060095442115b6115295760405162461bcd60e51b815260206004820152601060248201526f14d85b19481b9bdd081cdd185c9d195960821b6044820152606401610bfd565b600a5415806115395750600a5442105b6115725760405162461bcd60e51b815260206004820152600a60248201526914d85b1948195b99195960b21b6044820152606401610bfd565b5f8888888860405160200161158a9493929190613511565b604051602081830303815290604052905060146115a78285610d4e565b6040516115b491906134df565b9081526020016040518091039020545f1461161c5760405162461bcd60e51b815260206004820152602260248201527f70726f6d707420616e6420736565642068617320616c7265616479206d696e74604482015261195960f21b6064820152608401610bfd565b6116246112cf565b3410156116735760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f7567682066756e6420746f206d696e74204e465400000000006044820152606401610bfd565b600b5415806116855750600b54600854105b6116d15760405162461bcd60e51b815260206004820152601860248201527f4d617820746f74616c20737570706c79207265616368656400000000000000006044820152606401610bfd565b6011546001600160a01b03161561170757601154600754611707916001600160a01b03169061170290600a90613550565b6120ed565b6010546001600160a01b03161561174457601054600754611744916001600160a01b031690600a9061173a906009613563565b6117029190613550565b6040518060a001604052808a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250505090825250604080516020601f8b0181900481028201810190925289815291810191908a908a90819084018382808284375f92019190915250505090825250604080516020601f8901819004810282018101909252878152918101919088908890819084018382808284375f92018290525093855250505060208083018790526001600160a01b038e16604093840152600854825260129052208151819061182a908261357a565b506020820151600182019061183f908261357a565b5060408201516002820190611854908261357a565b5060608201516003820155608090910151600490910180546001600160a01b0319166001600160a01b0390921691909117905561189181846121cf565b61189d8a600854612347565b60088054905f6118ac83613634565b919050555060085460146118c08386610d4e565b6040516118cd91906134df565b908152604051908190036020019020556008546118ec9060019061364c565b9a9950505050505050505050565b6119026120c1565b600d610e8e82848361338e565b610b48338383612360565b60405163c4be5cab60e01b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9063c4be5cab906119539089908990600401613687565b6020604051808303815f875af115801561196f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611993919061369a565b5f888152601660205260409081902082905551630901e0f960e31b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9163480f07c8916119dd9190889088906004016136b1565b5f604051808303815f87803b1580156119f4575f80fd5b505af1158015611a06573d5f803e3d5ffd5b505050508585604051611a1a92919061333b565b6040518091039020877f65deac95b53ba76b9cdc6cf446af81731e1218c91eaf9811a95d28bde23b893e86868686604051611a5894939291906136ca565b60405180910390a350505050505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168114611ae65760405163432e033760e11b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015282166024820152604401610bfd565b5f86815260136020526040902080546001600160a01b0316611b3f5760405162461bcd60e51b815260206004820152601260248201527172657175657374206e6f742065786973747360701b6044820152606401610bfd565b611b5f5f526015602052604051869086907f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e390611b809060028601906136f0565b90815260200160405180910390209182611b9b92919061338e565b507faf2b2381ddcb18a2b18a7826186fd216acdd9c852a8c7a9a49e7eab127f96ccf8782600101548360020189898989604051611bde97969594939291906136fb565b60405180910390a150505050505050565b611bf76120c1565b6009545f03611c065742600955565b42600a555f600955565b611c1b848484610bd8565b610c60848484846123fe565b601154604051620e1d8d60e41b8152611b5f6004820152600160a01b9091046001600160401b031660248201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169062e1d8d090604401602060405180830381865afa158015611ca4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112e5919061369a565b600d8054610b59906132c0565b5f818152601260205260408120600381015460609291611d58916002820191906001820190611d0390612524565b5f88815260126020526040902060040154611d26906001600160a01b0316612628565b611d2f89610ead565b604051602001611d44969594939291906137ae565b604051602081830303815290604052612761565b90505f81604051602001611d6c9190613a3e565b60408051601f19818403018152919052949350505050565b5f8060148888604051611d9892919061333b565b9081526040805160209281900383018120545f8181526016909452918320546317861f8760e01b8252600482015290925073c3287bdef03b925a7c7f54791edadcd88e632ccd906317861f87906024015f60405180830381865afa158015611e02573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611e299190810190613a6f565b5f83815260166020526040908190205490516333727c4d60e01b815291925073c3287bdef03b925a7c7f54791edadcd88e632ccd916333727c4d91611e749160040190815260200190565b602060405180830381865afa158015611e8f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611eb391906132f8565b8015611edc57508686604051611eca92919061333b565b60405180910390208180519060200120145b9998505050505050505050565b6001600160a01b039182165f90815260066020908152604080832093909416825291909152205460ff1690565b600e8054610b59906132c0565b611f2b6120c1565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b611f556120c1565b6001600160a01b038116611f7e57604051631e4fbdf760e01b81525f6004820152602401610bfd565b611f8781612180565b50565b5f818152600360205260408120546001600160a01b031680610a8057604051637e27328960e01b815260048101849052602401610bfd565b610e8e83838360016128c3565b5f828152600360205260408120546001600160a01b0390811690831615611ffb57611ffb8184866129c7565b6001600160a01b03811615612035576120165f855f806128c3565b6001600160a01b0381165f90815260046020526040902080545f190190555b6001600160a01b03851615612063576001600160a01b0385165f908152600460205260409020805460010190555b5f8481526003602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b5f546001600160a01b03163314610d8e5760405163118cdaa760e01b8152336004820152602401610bfd565b804710156121105760405163cd78605960e01b8152306004820152602401610bfd565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114612159576040519150601f19603f3d011682016040523d82523d5f602084013e61215e565b606091505b5050905080610e8e57604051630a12f52160e11b815260040160405180910390fd5b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f81836040516020016121e392919061332a565b60405160208183030381529060405290505f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635b953806600754600a6122316112cf565b61223c90600b613563565b6122469190613550565b612250919061364c565b611b5f8530601160149054906101000a90046001600160401b03166040518663ffffffff1660e01b815260040161228a9493929190613ae3565b60206040518083038185885af11580156122a6573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906122cb919061369a565b5f818152601360205260409020909150600281016122e9848261357a565b5080546001600160a01b031916339081178255611b5f600183018190556040517fa0faead83d70148ae18b694377f9bef079251342ab90e14af0f9ef68b891269f926123389286928a90613b33565b60405180910390a15050505050565b610b48828260405180602001604052805f815250612a2b565b6001600160a01b03821661239257604051630b61174360e31b81526001600160a01b0383166004820152602401610bfd565b6001600160a01b038381165f81815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b15610c6057604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290612440903390889087908790600401613b69565b6020604051808303815f875af192505050801561247a575060408051601f3d908101601f1916820190925261247791810190613b9b565b60015b6124e1573d8080156124a7576040519150601f19603f3d011682016040523d82523d5f602084013e6124ac565b606091505b5080515f036124d957604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461251d57604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b5050505050565b6060815f0361254a5750506040805180820190915260018152600360fc1b602082015290565b815f5b8115612573578061255d81613634565b915061256c9050600a83613550565b915061254d565b5f816001600160401b0381111561258c5761258c612c82565b6040519080825280601f01601f1916602001820160405280156125b6576020820181803683370190505b5090505b8415612620576125cb60018361364c565b91506125d8600a86613bb6565b6125e39060306134fe565b60f81b8183815181106125f8576125f8613bc9565b60200101906001600160f81b03191690815f1a905350612619600a86613550565b94506125ba565b949350505050565b60408051602880825260608281019093525f91906020820181803683370190505090505f5b601481101561275a575f61266282601361364c565b61266d906008613563565b612678906002613cc0565b61268b906001600160a01b038716613550565b60f81b90505f60108260f81c6126a19190613ccb565b60f81b90505f8160f81c60106126b79190613cec565b8360f81c6126c59190613d08565b60f81b90506126d382612a41565b856126df866002613563565b815181106126ef576126ef613bc9565b60200101906001600160f81b03191690815f1a90535061270e81612a41565b8561271a866002613563565b6127259060016134fe565b8151811061273557612735613bc9565b60200101906001600160f81b03191690815f1a905350506001909201915061264d9050565b5092915050565b80516060905f81900361278357505060408051602081019091525f8152919050565b5f60036127918360026134fe565b61279b9190613550565b6127a6906004613563565b90505f6127b48260206134fe565b6001600160401b038111156127cb576127cb612c82565b6040519080825280601f01601f1916602001820160405280156127f5576020820181803683370190505b5090505f604051806060016040528060408152602001613d3b60409139905060018101602083015f5b8681101561287f576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b83526004909201910161281e565b50600386066001811461289957600281146128aa576128b5565b613d3d60f01b6001198301526128b5565b603d60f81b5f198301525b505050918152949350505050565b80806128d757506001600160a01b03821615155b15612998575f6128e684611f8a565b90506001600160a01b038316158015906129125750826001600160a01b0316816001600160a01b031614155b801561292557506129238184611ee9565b155b1561294e5760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610bfd565b81156129965783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260056020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6129d2838383612a7b565b610e8e576001600160a01b038316612a0057604051637e27328960e01b815260048101829052602401610bfd565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610bfd565b612a358383612adc565b610e8e5f8484846123fe565b5f600a60f883901c1015612a6757612a5e60f883901c6030613d21565b60f81b92915050565b612a5e60f883901c6057613d21565b919050565b5f6001600160a01b038316158015906126205750826001600160a01b0316846001600160a01b03161480612ab45750612ab48484611ee9565b806126205750505f908152600560205260409020546001600160a01b03908116911614919050565b6001600160a01b038216612b0557604051633250574960e11b81525f6004820152602401610bfd565b5f612b1183835f611fcf565b90506001600160a01b03811615610e8e576040516339e3563760e11b81525f6004820152602401610bfd565b6001600160e01b031981168114611f87575f80fd5b5f60208284031215612b62575f80fd5b8135612b6d81612b3d565b9392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f612b6d6020830184612b74565b5f60208284031215612bc4575f80fd5b5035919050565b80356001600160a01b0381168114612a76575f80fd5b5f8060408385031215612bf2575f80fd5b612bfb83612bcb565b946020939093013593505050565b5f805f60608486031215612c1b575f80fd5b612c2484612bcb565b9250612c3260208501612bcb565b929592945050506040919091013590565b5f60208284031215612c53575f80fd5b81356001600160401b0381168114612b6d575f80fd5b5f60208284031215612c79575f80fd5b612b6d82612bcb565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715612cbe57612cbe612c82565b604052919050565b5f6001600160401b03821115612cde57612cde612c82565b50601f01601f191660200190565b5f82601f830112612cfb575f80fd5b8135602083015f612d13612d0e84612cc6565b612c96565b9050828152858383011115612d26575f80fd5b828260208301375f92810160200192909252509392505050565b5f8060408385031215612d51575f80fd5b82356001600160401b03811115612d66575f80fd5b612d7285828601612cec565b95602094909401359450505050565b5f8083601f840112612d91575f80fd5b5081356001600160401b03811115612da7575f80fd5b602083019150836020828501011115612dbe575f80fd5b9250929050565b5f805f8060408587031215612dd8575f80fd5b84356001600160401b03811115612ded575f80fd5b612df987828801612d81565b90955093505060208501356001600160401b03811115612e17575f80fd5b612e2387828801612d81565b95989497509550505050565b5f8060208385031215612e40575f80fd5b82356001600160401b03811115612e55575f80fd5b612e6185828601612d81565b90969095509350505050565b60a081525f612e7f60a0830188612b74565b8281036020840152612e918188612b74565b90508281036040840152612ea58187612b74565b606084019590955250506001600160a01b03919091166080909101529392505050565b5f60208284031215612ed8575f80fd5b81356001600160401b03811115612eed575f80fd5b61262084828501612cec565b60018060a01b0385168152836020820152608060408201525f612f1f6080830185612b74565b8281036060840152612f318185612b74565b979650505050505050565b5f8060408385031215612f4d575f80fd5b8235915060208301356001600160401b03811115612f69575f80fd5b612f7585828601612cec565b9150509250929050565b5f805f805f805f8060a0898b031215612f96575f80fd5b612f9f89612bcb565b975060208901356001600160401b03811115612fb9575f80fd5b612fc58b828c01612d81565b90985096505060408901356001600160401b03811115612fe3575f80fd5b612fef8b828c01612d81565b90965094505060608901356001600160401b0381111561300d575f80fd5b6130198b828c01612d81565b999c989b50969995989497949560800135949350505050565b8015158114611f87575f80fd5b5f8060408385031215613050575f80fd5b61305983612bcb565b9150602083013561306981613032565b809150509250929050565b5f805f805f805f6080888a03121561308a575f80fd5b8735965060208801356001600160401b038111156130a6575f80fd5b6130b28a828b01612d81565b90975095505060408801356001600160401b038111156130d0575f80fd5b6130dc8a828b01612d81565b90955093505060608801356001600160401b038111156130fa575f80fd5b6131068a828b01612d81565b989b979a50959850939692959293505050565b5f805f805f6060868803121561312d575f80fd5b8535945060208601356001600160401b03811115613149575f80fd5b61315588828901612d81565b90955093505060408601356001600160401b03811115613173575f80fd5b61317f88828901612d81565b969995985093965092949392505050565b5f805f80608085870312156131a3575f80fd5b6131ac85612bcb565b93506131ba60208601612bcb565b92506040850135915060608501356001600160401b038111156131db575f80fd5b6131e787828801612cec565b91505092959194509250565b5f805f805f8060608789031215613208575f80fd5b86356001600160401b0381111561321d575f80fd5b61322989828a01612d81565b90975095505060208701356001600160401b03811115613247575f80fd5b61325389828a01612d81565b90955093505060408701356001600160401b03811115613271575f80fd5b61327d89828a01612d81565b979a9699509497509295939492505050565b5f80604083850312156132a0575f80fd5b6132a983612bcb565b91506132b760208401612bcb565b90509250929050565b600181811c908216806132d457607f821691505b6020821081036132f257634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215613308575f80fd5b8151612b6d81613032565b5f81518060208401855e5f93019283525090919050565b8281525f6126206020830184613313565b818382375f9101908152919050565b601f821115610e8e57805f5260205f20601f840160051c8101602085101561336f5750805b601f840160051c820191505b8181101561251d575f815560010161337b565b6001600160401b038311156133a5576133a5612c82565b6133b9836133b383546132c0565b8361334a565b5f601f8411600181146133ea575f85156133d35750838201355b5f19600387901b1c1916600186901b17835561251d565b5f83815260208120601f198716915b8281101561341957868501358255602094850194600190920191016133f9565b5086821015613435575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f8154613453816132c0565b60018216801561346a576001811461347f576134ac565b60ff19831686528115158202860193506134ac565b845f5260205f205f5b838110156134a457815488820152600190910190602001613488565b505081860193505b50505092915050565b5f6134c08285613447565b622d2d2d60e81b81526134d66003820185613447565b95945050505050565b5f612b6d8284613313565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610a8057610a806134ea565b838582375f848201622d2d2d60e81b8152838560038301375f93016003019283525090949350505050565b634e487b7160e01b5f52601260045260245ffd5b5f8261355e5761355e61353c565b500490565b8082028115828204841417610a8057610a806134ea565b81516001600160401b0381111561359357613593612c82565b6135a7816135a184546132c0565b8461334a565b6020601f8211600181146135d9575f83156135c25750848201515b5f19600385901b1c1916600184901b17845561251d565b5f84815260208120601f198516915b8281101561360857878501518255602094850194600190920191016135e8565b508482101561362557868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f60018201613645576136456134ea565b5060010190565b81810381811115610a8057610a806134ea565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b602081525f61262060208301848661365f565b5f602082840312156136aa575f80fd5b5051919050565b838152604060208201525f6134d660408301848661365f565b604081525f6136dd60408301868861365f565b8281036020840152612f3181858761365f565b5f612b6d8284613447565b87815286602082015260a060408201525f808754613718816132c0565b8060a0860152600182165f8114613736576001811461375257613783565b60ff19831660c087015260c082151560051b8701019350613783565b8a5f5260205f205f5b8381101561377a57815488820160c0015260019091019060200161375b565b870160c0019450505b505050828103606084015261379981878961365f565b905082810360808401526118ec81858761365f565b683d913730b6b2911d1160b91b81525f6137cb6009830189613447565b7f222c202261747472696275746573223a205b7b2274726169745f74797065223a81527f2022706f7369746976655f70726f6d7074222c202276616c7565223a202200006020820152613821603e820189613447565b7f227d2c207b2274726169745f74797065223a20226e656761746976655f70726f81526f36b83a111610113b30b63ab2911d101160811b6020820152905061386c6030820188613447565b7f227d2c207b2274726169745f74797065223a202273656564222c202276616c7581526432911d101160d91b602082015290506138ac6025820187613313565b7f227d2c207b2274726169745f74797065223a2022617574686f72222c202276618152680d8eaca4474404460f60bb1b602082015290506138f06029820186613313565b7f227d2c207b2274726169745f74797065223a20226d6f64656c222c202276616c81527f7565223a2022537461626c6520446966667573696f6e227d5d2c20226465736360208201527f72697074696f6e223a2022537461626c6520446966667573696f6e206973206160408201527f206c6174656e7420746578742d746f2d696d61676520646966667573696f6e2060608201527f6d6f64656c2063617061626c65206f662067656e65726174696e672070686f7460808201527f6f2d7265616c697374696320696d6167657320676976656e20616e792074657860a08201527f7420696e7075742e222c2022696d616765223a202268747470733a2f2f67617460c08201527f657761792e70696e6174612e636c6f75642f697066732f00000000000000000060e0820152905060f781016118ec613a308287613313565b61227d60f01b815260020190565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081525f612b6d601d830184613313565b5f60208284031215613a7f575f80fd5b81516001600160401b03811115613a94575f80fd5b8201601f81018413613aa4575f80fd5b8051613ab2612d0e82612cc6565b818152856020838501011115613ac6575f80fd5b8160208401602083015e5f91810160200191909152949350505050565b84815260a060208201525f613afb60a0830186612b74565b6001600160a01b03949094166040830152506001600160401b039190911660608201528082036080909101525f815260200192915050565b84815260018060a01b0384166020820152826040820152608060608201525f613b5f6080830184612b74565b9695505050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90613b5f90830184612b74565b5f60208284031215613bab575f80fd5b8151612b6d81612b3d565b5f82613bc457613bc461353c565b500690565b634e487b7160e01b5f52603260045260245ffd5b6001815b6001841115613c1857808504811115613bfc57613bfc6134ea565b6001841615613c0a57908102905b60019390931c928002613be1565b935093915050565b5f82613c2e57506001610a80565b81613c3a57505f610a80565b8160018114613c505760028114613c5a57613c76565b6001915050610a80565b60ff841115613c6b57613c6b6134ea565b50506001821b610a80565b5060208310610133831016604e8410600b8410161715613c99575081810a610a80565b613ca55f198484613bdd565b805f1904821115613cb857613cb86134ea565b029392505050565b5f612b6d8383613c20565b5f60ff831680613cdd57613cdd61353c565b8060ff84160491505092915050565b60ff818116838216029081169081811461275a5761275a6134ea565b60ff8281168282160390811115610a8057610a806134ea565b60ff8181168382160190811115610a8057610a806134ea56fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220aff7a61b300fa2c725d72029241f4a226edc4a3406524cc217685fb8c760ed9864736f6c634300081a0033a2646970667358221220280a1846e27b2758fe40d8b29f60ba2a26730f608c33803e56dc066a28d6c40664736f6c634300081a0033
{{ "language": "Solidity", "sources": { "contracts/AIGC_NFT_LoraFactory.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./AIGC_NFT_Lora.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract AIGC_NFT_LoraFactory is Ownable {\n\n address public constant aiOracle = 0x0A0f4321214BB6C7811dD8a71cF587bdaF03f0A0;\n address public constant opmlLib = 0xC3287BDEF03b925A7C7f54791EDADCD88e632CcD;\n\n address public trainFeeReceiver;\n\n mapping(string => address[]) public baseAIModelToLora;\n mapping(string => uint256) public baseAIModelToLoraCount;\n\n uint256 public trainFee = 0.005 ether;\n\n event TrainAI(address user, string baseAIModel);\n\n constructor() Ownable(msg.sender) {\n trainFeeReceiver = msg.sender;\n }\n\n function setTrainFee(uint256 _trainFee) external onlyOwner {\n trainFee = _trainFee;\n }\n\n function createAIGC_NFT_Lora(\n string[] calldata vars,\n uint256[] calldata varInt,\n address[] calldata varAddrs\n ) external payable returns (address) {\n require(msg.value >= trainFee, \"Insufficient funds\");\n AIGC_NFT_Lora newAIGC_NFT_Lora = new AIGC_NFT_Lora(\n vars,\n varInt,\n varAddrs\n );\n baseAIModelToLora[vars[4]].push(address(newAIGC_NFT_Lora));\n baseAIModelToLoraCount[vars[4]] += 1;\n\n // transfer training fee to the team\n payable(trainFeeReceiver).transfer(msg.value);\n\n emit TrainAI(msg.sender, vars[4]);\n\n return address(newAIGC_NFT_Lora);\n }\n\n function setTrainFeeReceiver(address _trainFeeReceiver) external onlyOwner {\n trainFeeReceiver = _trainFeeReceiver;\n }\n}\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" }, "contracts/AIGC_NFT_Lora.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\n// ref: https://sepolia.etherscan.io/address/0xe75af5294f4CB4a8423ef8260595a54298c7a2FB#code\n\nimport \"./IERC7007Updatable.sol\";\nimport \"./IAIOracle.sol\";\nimport \"./IOpmlLib.sol\";\nimport \"./AIOracleCallbackReceiver.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\n\ncontract AIGC_NFT_Lora is IERC7007Updatable, AIOracleCallbackReceiver, Ownable, ERC721 {\n\n using Address for address;\n\n uint256 public constant aiModelId = 7007;\n address public constant opmlLib = 0xC3287BDEF03b925A7C7f54791EDADCD88e632CcD;\n address public constant _aiOracle = 0x0A0f4321214BB6C7811dD8a71cF587bdaF03f0A0;\n\n uint256 public mintPrice;\n uint256 public totalSupply;\n uint256 public startMintTime;\n uint256 public stopMintTime;\n uint256 public maxTotalSupply; // 0 for no totalsupply limit\n\n string public bannerImg;\n string public logoImg;\n string public baseAIModel;\n string public basePrompt;\n\n address public royaltyReceiverLora;\n address public royaltyReceiverModelOwner;\n\n /// @notice Gas limit set on the callback from AIOracle.\n /// @dev Should be set to the maximum amount of gas your callback might reasonably consume.\n uint64 public aiOracleCallbackGasLimit = 500000; // default sd: 500k\n // mapping(address => uint256) public _mintedCounts;\n\n struct AIGC_Token {\n string prompt;\n string neg_prompt;\n string title;\n uint256 seed;\n address author;\n }\n\n struct AIOracleRequest {\n address sender;\n uint256 modelId;\n bytes input;\n bytes output;\n }\n\n mapping(uint256 => AIGC_Token) public AIGC_tokens; // token ID => xx\n mapping(uint256 => AIOracleRequest) public requests;\n mapping(bytes => uint256) public promptSeedToTokenId;\n mapping(uint256 => mapping(string => string)) public prompts;\n mapping (uint256 => uint256) public tokenIdToRequestId;\n\n event promptsUpdated(\n uint256 requestId,\n uint256 modelId,\n string input,\n string output,\n bytes callbackData\n );\n\n event promptRequest(\n uint256 requestId,\n address sender, \n uint256 modelId,\n string prompt\n );\n\n constructor(\n string[] memory vars,\n uint256[] memory varInt,\n address[] memory varAddrs\n )\n AIOracleCallbackReceiver(IAIOracle(_aiOracle))\n ERC721(vars[0], vars[1])\n Ownable(varAddrs[0]) { // the lora trainer is the owner of this contract\n mintPrice = varInt[0];\n royaltyReceiverLora = varAddrs[0];\n royaltyReceiverModelOwner = varAddrs[1];\n bannerImg = vars[2];\n logoImg = vars[3];\n baseAIModel = vars[4];\n maxTotalSupply = varInt[1];\n startMintTime = varInt[2];\n stopMintTime = varInt[3];\n basePrompt = vars[5];\n }\n\n function setBannerImg(string calldata _bannerImg) external onlyOwner {\n bannerImg = _bannerImg;\n }\n function setLogoImg(string calldata _logoImg) external onlyOwner {\n logoImg = _logoImg;\n }\n function setBaseAIModel(string calldata _baseAIModel) external onlyOwner {\n baseAIModel = _baseAIModel;\n }\n\n function encode(string memory prompt, uint256 seed) public pure returns (bytes memory) {\n bytes memory data = abi.encodePacked(seed, prompt);\n return data;\n } \n\n function getAIResultFromTokenId(uint256 tokenId) public view returns (string memory) {\n if (AIGC_tokens[tokenId].seed == 0) {\n return prompts[aiModelId][string(abi.encodePacked(AIGC_tokens[tokenId].prompt, \"---\", AIGC_tokens[tokenId].neg_prompt))];\n }\n bytes memory data = abi.encodePacked(AIGC_tokens[tokenId].seed, string(abi.encodePacked(AIGC_tokens[tokenId].prompt, \"---\", AIGC_tokens[tokenId].neg_prompt)));\n return prompts[aiModelId][string(data)];\n }\n\n function startOrStopMint() external onlyOwner {\n if (startMintTime == 0) {\n startMintTime = block.timestamp;\n } else {\n stopMintTime = block.timestamp;\n startMintTime = 0;\n }\n }\n\n /**\n * @dev See {IERC7007-addAigcData}.\n */\n function addAigcData(\n uint256 tokenId,\n bytes calldata prompt,\n bytes calldata aigcData,\n bytes calldata proof\n ) public virtual override {\n tokenIdToRequestId[tokenId] = IOpmlLib(opmlLib).initOpmlRequest(prompt);\n IOpmlLib(opmlLib).uploadResult(tokenIdToRequestId[tokenId], aigcData);\n emit AigcData(tokenId, prompt, aigcData, proof);\n }\n\n /**\n * @dev See {IERC7007-verify}.\n */\n function verify(\n bytes calldata prompt,\n bytes calldata aigcData,\n bytes calldata proof\n ) public view virtual override returns (bool success) {\n uint256 tokenId = promptSeedToTokenId[prompt];\n bytes memory output = IOpmlLib(opmlLib).getOutput(tokenIdToRequestId[tokenId]);\n\n return IOpmlLib(opmlLib).isFinalized(tokenIdToRequestId[tokenId]) && (keccak256(output) == keccak256(aigcData));\n }\n\n /**\n * @dev See {IERC7007Updatable-update}.\n */\n function update(\n bytes calldata prompt,\n bytes calldata aigcData\n ) public virtual override {\n require(verify(prompt, aigcData, prompt), \"ERC7007: invalid aigcData\"); // proof argument is not used in verify() function for opML, so we can pass prompt as proof\n uint256 tokenId = promptSeedToTokenId[prompt];\n emit Update(tokenId, prompt, aigcData);\n }\n\n function updateAIOracleCallbackGasLimit(uint64 _gasLimit) external onlyOwner {\n aiOracleCallbackGasLimit = _gasLimit;\n }\n\n // only the AI Oracle can call this function\n function aiOracleCallback(uint256 requestId, bytes calldata output, bytes calldata callbackData) external override onlyAIOracleCallback() {\n AIOracleRequest storage request = requests[requestId];\n require(request.sender != address(0), \"request not exists\");\n prompts[aiModelId][string(request.input)] = string(output);\n emit promptsUpdated(requestId, request.modelId, string(request.input), string(output), callbackData);\n }\n\n function calculateAIResult(string memory prompt, uint256 seed) internal {\n bytes memory input = abi.encodePacked(seed, prompt);\n // we do not need to set the callbackData in this example\n uint256 requestId = aiOracle.requestCallback{value: estimateTotalFee()* 11 / 10 - mintPrice}(\n aiModelId, input, address(this), aiOracleCallbackGasLimit, \"\"\n );\n AIOracleRequest storage request = requests[requestId];\n request.input = input;\n request.sender = msg.sender;\n request.modelId = aiModelId;\n emit promptRequest(requestId, msg.sender, aiModelId, prompt);\n }\n\n function setMaxTotalSupply(uint256 _maxTotalSupply) external onlyOwner {\n maxTotalSupply = _maxTotalSupply;\n }\n\n function estimateOAOFee() public view returns (uint256) {\n return aiOracle.estimateFee(aiModelId, aiOracleCallbackGasLimit);\n }\n function estimateTotalFee() public view returns (uint256) {\n return estimateOAOFee() + mintPrice;\n }\n \n /// NFT related\n function mint(address to, string calldata positive_prompt, string calldata neg_prompt, string calldata title, uint256 seed) external payable returns (uint256 tokenId) {\n // check time is after start time\n require(startMintTime != 0 && block.timestamp > startMintTime, \"Sale not started\");\n // check time is not after end time\n require(stopMintTime == 0 || block.timestamp < stopMintTime, \"Sale ended\");\n string memory prompt = string(abi.encodePacked(positive_prompt, \"---\", neg_prompt));\n require(promptSeedToTokenId[encode(prompt, seed)] == 0, \"prompt and seed has already minted\");\n // check fund\n require(msg.value >= estimateTotalFee(), \"Not enough fund to mint NFT\");\n // check totalsupply \n require(maxTotalSupply == 0 || totalSupply < maxTotalSupply, \"Max total supply reached\");\n \n // transfer 10% of mint price to base model owner\n if(royaltyReceiverModelOwner != address(0)) {\n Address.sendValue(payable(royaltyReceiverModelOwner), mintPrice / 10);\n }\n\n if(royaltyReceiverLora != address(0)) {\n // transfer remaining fee to the lora trainer\n Address.sendValue(payable(royaltyReceiverLora), mintPrice * 9 / 10);\n }\n\n // calculate AI result\n AIGC_tokens[totalSupply] = AIGC_Token(positive_prompt, neg_prompt, title, seed, to);\n calculateAIResult(prompt, seed);\n // mint\n super._safeMint(to, totalSupply);\n // increase minted count\n // _mintedCounts[to] ++;\n\n totalSupply ++;\n promptSeedToTokenId[encode(prompt, seed)] = totalSupply; // actual value is minus 1\n\n return totalSupply - 1;\n }\n\n function setRoyaltyReceiverLora(address _newLoraReceiver) external onlyOwner {\n royaltyReceiverLora = _newLoraReceiver;\n }\n\n function setRoyaltyReceiverModelOwner(address _newModelOwnerReceiver) external onlyOwner {\n royaltyReceiverModelOwner = _newModelOwnerReceiver;\n }\n\n /// @dev Withdraw. The contract owner can withdraw all ETH from the NFT sale\n function withdraw() external onlyOwner {\n Address.sendValue(payable(_msgSender()), address(this).balance);\n }\n\n function tokenURI(uint256 tokenId) override public view returns (string memory) {\n string memory json = Base64.encode(bytes(string(abi.encodePacked(\n '{\"name\":\"', AIGC_tokens[tokenId].title, '\", \"attributes\": [{\"trait_type\": \"positive_prompt\", \"value\": \"', AIGC_tokens[tokenId].prompt, '\"}, {\"trait_type\": \"negative_prompt\", \"value\": \"', AIGC_tokens[tokenId].neg_prompt, '\"}, {\"trait_type\": \"seed\", \"value\": \"', toString(AIGC_tokens[tokenId].seed), '\"}, {\"trait_type\": \"author\", \"value\": \"0x', toAsciiString(AIGC_tokens[tokenId].author), '\"}, {\"trait_type\": \"model\", \"value\": \"Stable Diffusion\"}], \"description\": \"Stable Diffusion is a latent text-to-image diffusion model capable of generating photo-realistic images given any text input.\", \"image\": \"https://gateway.pinata.cloud/ipfs/', getAIResultFromTokenId(tokenId), '\"}'))));\n string memory output = string(abi.encodePacked('data:application/json;base64,', json));\n\n return output;\n }\n\n function toString(uint256 value) internal pure returns (string memory) {\n // Inspired by OraclizeAPI's implementation - MIT license\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n}\n\nfunction toAsciiString(address x) pure returns (string memory) {\n bytes memory s = new bytes(40);\n for (uint i = 0; i < 20; i++) {\n bytes1 b = bytes1(uint8(uint(uint160(x)) / (2**(8*(19 - i)))));\n bytes1 hi = bytes1(uint8(b) / 16);\n bytes1 lo = bytes1(uint8(b) - 16 * uint8(hi));\n s[2*i] = char(hi);\n s[2*i+1] = char(lo); \n }\n return string(s);\n}\n\nfunction char(bytes1 b) pure returns (bytes1 c) {\n if (uint8(b) < 10) return bytes1(uint8(b) + 0x30);\n else return bytes1(uint8(b) + 0x57);\n}\n\n/// [MIT License]\n/// @title Base64\n/// @notice Provides a function for encoding some bytes in base64\n/// @author Brecht Devos <[email protected]>\nlibrary Base64 {\n bytes internal constant TABLE = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n /// @notice Encodes some bytes to the base64 representation\n function encode(bytes memory data) internal pure returns (string memory) {\n uint256 len = data.length;\n if (len == 0) return \"\";\n\n // multiply by 4/3 rounded up\n uint256 encodedLen = 4 * ((len + 2) / 3);\n\n // Add some extra buffer at the end\n bytes memory result = new bytes(encodedLen + 32);\n\n bytes memory table = TABLE;\n\n assembly {\n let tablePtr := add(table, 1)\n let resultPtr := add(result, 32)\n\n for {\n let i := 0\n } lt(i, len) {\n\n } {\n i := add(i, 3)\n let input := and(mload(add(data, i)), 0xffffff)\n\n let out := mload(add(tablePtr, and(shr(18, input), 0x3F)))\n out := shl(8, out)\n out := add(out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF))\n out := shl(8, out)\n out := add(out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF))\n out := shl(8, out)\n out := add(out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF))\n out := shl(224, out)\n\n mstore(resultPtr, out)\n\n resultPtr := add(resultPtr, 4)\n }\n\n switch mod(len, 3)\n case 1 {\n mstore(sub(resultPtr, 2), shl(240, 0x3d3d))\n }\n case 2 {\n mstore(sub(resultPtr, 1), shl(248, 0x3d))\n }\n\n mstore(result, encodedLen)\n }\n\n return string(result);\n }\n}" }, "@openzeppelin/contracts/utils/Address.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\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.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance < amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\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 or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\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 function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\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 function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance < value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\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 if (returndata.length == 0 && target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) 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 FailedInnerCall();\n }\n }\n}\n" }, "@openzeppelin/contracts/token/ERC721/ERC721.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"./IERC721.sol\";\nimport {IERC721Receiver} from \"./IERC721Receiver.sol\";\nimport {IERC721Metadata} from \"./extensions/IERC721Metadata.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Strings} from \"../../utils/Strings.sol\";\nimport {IERC165, ERC165} from \"../../utils/introspection/ERC165.sol\";\nimport {IERC721Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n mapping(uint256 tokenId => address) private _owners;\n\n mapping(address owner => uint256) private _balances;\n\n mapping(uint256 tokenId => address) private _tokenApprovals;\n\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual returns (uint256) {\n if (owner == address(0)) {\n revert ERC721InvalidOwner(address(0));\n }\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\n return _requireOwned(tokenId);\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\n _requireOwned(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual {\n _approve(to, tokenId, _msgSender());\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual returns (address) {\n _requireOwned(tokenId);\n\n return _getApproved(tokenId);\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n address previousOwner = _update(to, tokenId, _msgSender());\n if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\n transferFrom(from, to, tokenId);\n _checkOnERC721Received(from, to, tokenId, data);\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n *\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\n * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\n */\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\n * particular (ignoring whether it is owned by `owner`).\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\n return\n spender != address(0) &&\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\n * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets\n * the `spender` for the specific `tokenId`.\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\n if (!_isAuthorized(owner, spender, tokenId)) {\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else {\n revert ERC721InsufficientApproval(spender, tokenId);\n }\n }\n }\n\n /**\n * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n *\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\n *\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\n * remain consistent with one another.\n */\n function _increaseBalance(address account, uint128 value) internal virtual {\n unchecked {\n _balances[account] += value;\n }\n }\n\n /**\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\n *\n * Emits a {Transfer} event.\n *\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\n address from = _ownerOf(tokenId);\n\n // Perform (optional) operator check\n if (auth != address(0)) {\n _checkAuthorized(from, auth, tokenId);\n }\n\n // Execute the update\n if (from != address(0)) {\n // Clear approval. No need to re-authorize or emit the Approval event\n _approve(address(0), tokenId, address(0), false);\n\n unchecked {\n _balances[from] -= 1;\n }\n }\n\n if (to != address(0)) {\n unchecked {\n _balances[to] += 1;\n }\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n return from;\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner != address(0)) {\n revert ERC721InvalidSender(address(0));\n }\n }\n\n /**\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\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 _safeMint(address to, uint256 tokenId) internal {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\n _mint(to, tokenId);\n _checkOnERC721Received(address(0), to, tokenId, data);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal {\n address previousOwner = _update(address(0), tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(address from, address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\n * are aware of the ERC721 standard to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is like {safeTransferFrom} in the sense that it invokes\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `tokenId` token must exist and be owned by `from`.\n * - `to` cannot be the zero address.\n * - `from` cannot be the zero address.\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 _safeTransfer(address from, address to, uint256 tokenId) internal {\n _safeTransfer(from, to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\n _transfer(from, to, tokenId);\n _checkOnERC721Received(from, to, tokenId, data);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\n * either the owner of the token, or approved to operate on all tokens held by this owner.\n *\n * Emits an {Approval} event.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address to, uint256 tokenId, address auth) internal {\n _approve(to, tokenId, auth, true);\n }\n\n /**\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\n * emitted in the context of transfers.\n */\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\n // Avoid reading the owner unless necessary\n if (emitEvent || auth != address(0)) {\n address owner = _requireOwned(tokenId);\n\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\n revert ERC721InvalidApprover(auth);\n }\n\n if (emitEvent) {\n emit Approval(owner, to, tokenId);\n }\n }\n\n _tokenApprovals[tokenId] = to;\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Requirements:\n * - operator can't be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n if (operator == address(0)) {\n revert ERC721InvalidOperator(operator);\n }\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\n * Returns the owner.\n *\n * Overrides to ownership logic should be done to {_ownerOf}.\n */\n function _requireOwned(uint256 tokenId) internal view returns (address) {\n address owner = _ownerOf(tokenId);\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n return owner;\n }\n\n /**\n * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the\n * recipient doesn't accept the token transfer. The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param data bytes optional data to send along with the call\n */\n function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private {\n if (to.code.length > 0) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\n if (retval != IERC721Receiver.onERC721Received.selector) {\n revert ERC721InvalidReceiver(to);\n }\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert ERC721InvalidReceiver(to);\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n }\n}\n" }, "contracts/AIOracleCallbackReceiver.sol": { "content": "// SampleContract.sol\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\nimport \"./IAIOracle.sol\";\n\n/// @notice A base contract for writing a AIOracle app\nabstract contract AIOracleCallbackReceiver {\n\n // Address of the AIOracle contract\n IAIOracle public immutable aiOracle;\n\n // Invalid callback source error\n error UnauthorizedCallbackSource(IAIOracle expected, IAIOracle found);\n\n /// @notice Initialize the contract, binding it to a specified AIOracle contract\n constructor(IAIOracle _aiOracle) {\n aiOracle = _aiOracle;\n }\n\n /// @notice Verify this is a callback by the aiOracle contract \n modifier onlyAIOracleCallback() {\n IAIOracle foundRelayAddress = IAIOracle(msg.sender);\n if (foundRelayAddress != aiOracle) {\n revert UnauthorizedCallbackSource(aiOracle, foundRelayAddress);\n }\n _;\n }\n\n /**\n * @dev the callback function in OAO, should add the modifier onlyAIOracleCallback!\n * @param requestId Id for the request in OAO (unique per request)\n * @param output AI model's output\n * @param callbackData user-defined data (The same as when the user call aiOracle.requestCallback)\n */\n function aiOracleCallback(uint256 requestId, bytes calldata output, bytes calldata callbackData) external virtual;\n\n function isFinalized(uint256 requestId) external view returns (bool) {\n return aiOracle.isFinalized(requestId);\n }\n}" }, "contracts/IOpmlLib.sol": { "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.23;\n\ninterface IOpmlLib {\n function initOpmlRequest(bytes calldata input) external returns (uint256 requestId);\n\tfunction uploadResult(uint256 requestId, bytes calldata output) external;\n\tfunction startChallenge(uint256 requestId, bytes32 finalState) external returns (uint256 challengeId);\n\tfunction respondState(uint256 challengeId, bytes32 stateHash) external;\n\tfunction proposeState(uint256 challengeId, bytes32 stateHash) external;\n\tfunction assertStateTransition(uint256 challengeId) external;\n function isFinalized(uint256 requestId) external view returns (bool);\n\tfunction getOutput(uint256 requestId) external view returns (bytes memory output);\n}" }, "contracts/IAIOracle.sol": { "content": "// SampleContract.sol\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\ninterface IAIOracle {\n /// @notice Event emitted upon receiving a callback request through requestCallback.\n event AICallbackRequest(\n address indexed account,\n uint256 indexed requestId,\n uint256 modelId,\n bytes input,\n address callbackContract,\n uint64 gasLimit,\n bytes callbackData\n );\n\n /// @notice Event emitted when the result is uploaded or update.\n event AICallbackResult(\n address indexed account,\n uint256 indexed requestId,\n address invoker,\n bytes output\n );\n\n /**\n * initiate a request in OAO\n * @param modelId ID for AI model\n * @param input input for AI model\n * @param callbackContract address of callback contract\n * @param gasLimit gas limitation of calling the callback function\n * @param callbackData optional, user-defined data, will send back to the callback function\n * @return requestID\n */\n function requestCallback(\n uint256 modelId,\n bytes memory input,\n address callbackContract,\n uint64 gasLimit,\n bytes memory callbackData\n ) external payable returns (uint256);\n\n function estimateFee(uint256 modelId, uint256 gasLimit) external view returns (uint256);\n\n function isFinalized(uint256 requestId) external view returns (bool);\n}" }, "contracts/IERC7007Updatable.sol": { "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.23;\n\nimport \"./IERC7007.sol\";\n\n/**\n * @title ERC7007 Token Standard, optional updatable extension\n */\ninterface IERC7007Updatable is IERC7007 {\n /**\n * @dev Update the `aigcData` of `prompt`.\n */\n function update(\n bytes calldata prompt,\n bytes calldata aigcData\n ) external;\n\n /**\n * @dev Emitted when `tokenId` token is updated.\n */\n event Update(\n uint256 indexed tokenId,\n bytes indexed prompt,\n bytes indexed aigcData\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" }, "contracts/IERC7007.sol": { "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.23;\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\n\n/**\n * @dev Required interface of an ERC7007 compliant contract.\n */\ninterface IERC7007 is IERC165, IERC721 {\n /**\n * @dev Emitted when AI Generated Content (AIGC) data is added to token at `tokenId`.\n */\n event AigcData(\n uint256 indexed tokenId,\n bytes indexed prompt,\n bytes aigcData,\n bytes proof\n );\n\n /**\n * @dev Add AIGC data to token at `tokenId` given `prompt`, `aigcData` and `proof`.\n *\n * Optional:\n * - `proof` should not include `aigcData` to save gas.\n * - verify(`prompt`, `aigcData`, `proof`) should return true for zkML scenario.\n */\n function addAigcData(\n uint256 tokenId,\n bytes calldata prompt,\n bytes calldata aigcData,\n bytes calldata proof\n ) external;\n\n /**\n * @dev Verify the `prompt`, `aigcData` and `proof`.\n */\n function verify(\n bytes calldata prompt,\n bytes calldata aigcData,\n bytes calldata proof\n ) external view returns (bool success);\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/utils/introspection/ERC165.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./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 */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" }, "@openzeppelin/contracts/utils/Strings.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n uint8 private constant ADDRESS_LENGTH = 20;\n\n /**\n * @dev The `value` string doesn't fit in the specified `length`.\n */\n error StringsInsufficientHexLength(uint256 value, uint256 length);\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 = Math.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), HEX_DIGITS))\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 toStringSigned(int256 value) internal pure returns (string memory) {\n return string.concat(value < 0 ? \"-\" : \"\", toString(SignedMath.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, Math.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 uint256 localValue = value;\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] = HEX_DIGITS[localValue & 0xf];\n localValue >>= 4;\n }\n if (localValue != 0) {\n revert StringsInsufficientHexLength(value, length);\n }\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\n * 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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" }, "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" }, "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.20;\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\n * reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.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/ERC721/IERC721.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../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`.\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\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\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 have been allowed to move this token by either {approve} or\n * {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\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(address from, address to, uint256 tokenId) 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 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 address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) 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 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" }, "@openzeppelin/contracts/utils/introspection/IERC165.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\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/utils/math/SignedMath.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\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" }, "@openzeppelin/contracts/utils/math/Math.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n /**\n * @dev Muldiv operation overflow.\n */\n error MathOverflowedMulDiv();\n\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\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 subtraction of two unsigned integers, with an overflow flag.\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 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 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 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 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 towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n return a / b;\n }\n\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\n * denominator == 0.\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * 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 = x * y; // 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 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 if (denominator <= prod1) {\n revert MathOverflowedMulDiv();\n }\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.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\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\n // works 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 (unsignedRoundsUp(rounding) && 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\n * towards zero.\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 + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\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 + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\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 + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n" } }, "settings": { "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } } }}
1
20,291,089
a160cb10892b1c795d28f2954c69f1f138ddf1891c031742f274c80646035c1a
e64b23510d43cb62cb20f271b9c12d363b2b0ed194f942df12afcfc6d404c230
77a6be2dd110a230764744acb87bc4a05e5d3212
77a6be2dd110a230764744acb87bc4a05e5d3212
9176432c4990c1ef30021b10b678d13399babf12
60e06040523480156200001157600080fd5b5060405162005828380380620058288339818101604052810190620000379190620008c4565b60016000819055506000600160006101000a81548160ff0219169083151502179055508367ffffffffffffffff168567ffffffffffffffff1610620000b3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000aa9062000a23565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff160362000125576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200011c9062000a95565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff160362000197576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200018e9062000b07565b60405180910390fd5b81600a84620001a7919062000b58565b1115620001eb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001e29062000bf3565b60405180910390fd5b8873ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1681525050876003819055508673ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff1681525050856004819055508467ffffffffffffffff1660c08167ffffffffffffffff168152505083600a60006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555084600a60086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555082600b8190555081600c819055506200030f7f969e743677c83a4458df4afcef9c1049579c1137c04e48694290c3e5fe6ef476806200046d60201b60201c565b620003617fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec7f969e743677c83a4458df4afcef9c1049579c1137c04e48694290c3e5fe6ef4766200046d60201b60201c565b620003a27f969e743677c83a4458df4afcef9c1049579c1137c04e48694290c3e5fe6ef47662000396620004d160201b60201c565b620004d960201b60201c565b620003e37fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec620003d7620004d160201b60201c565b620004d960201b60201c565b60005b81518161ffff1610156200045d57620004477fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec838361ffff168151811062000433576200043262000c15565b5b6020026020010151620004d960201b60201c565b8080620004549062000c52565b915050620003e6565b5050505050505050505062000c81565b60006200048083620005cb60201b60201c565b90508160026000858152602001908152602001600020600101819055508181847fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff60405160405180910390a4505050565b600033905090565b620004eb8282620005eb60201b60201c565b620005c75760016002600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506200056c620004d160201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600060026000838152602001908152602001600020600101549050919050565b60006002600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000697826200066a565b9050919050565b620006a9816200068a565b8114620006b557600080fd5b50565b600081519050620006c9816200069e565b92915050565b6000819050919050565b620006e481620006cf565b8114620006f057600080fd5b50565b6000815190506200070481620006d9565b92915050565b600067ffffffffffffffff82169050919050565b62000729816200070a565b81146200073557600080fd5b50565b60008151905062000749816200071e565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200079f8262000754565b810181811067ffffffffffffffff82111715620007c157620007c062000765565b5b80604052505050565b6000620007d662000656565b9050620007e4828262000794565b919050565b600067ffffffffffffffff82111562000807576200080662000765565b5b602082029050602081019050919050565b600080fd5b6000620008346200082e84620007e9565b620007ca565b905080838252602082019050602084028301858111156200085a576200085962000818565b5b835b81811015620008875780620008728882620006b8565b8452602084019350506020810190506200085c565b5050509392505050565b600082601f830112620008a957620008a86200074f565b5b8151620008bb8482602086016200081d565b91505092915050565b60008060008060008060008060006101208a8c031215620008ea57620008e962000660565b5b6000620008fa8c828d01620006b8565b99505060206200090d8c828d01620006f3565b9850506040620009208c828d01620006b8565b9750506060620009338c828d01620006f3565b9650506080620009468c828d0162000738565b95505060a0620009598c828d0162000738565b94505060c06200096c8c828d01620006f3565b93505060e06200097f8c828d01620006f3565b9250506101008a015167ffffffffffffffff811115620009a457620009a362000665565b5b620009b28c828d0162000891565b9150509295985092959850929598565b600082825260208201905092915050565b7f496e76616c69642070726f6772616d2074696d656c696e650000000000000000600082015250565b600062000a0b601883620009c2565b915062000a1882620009d3565b602082019050919050565b6000602082019050818103600083015262000a3e81620009fc565b9050919050565b7f496e76616c6964207374616b696e6720746f6b656e0000000000000000000000600082015250565b600062000a7d601583620009c2565b915062000a8a8262000a45565b602082019050919050565b6000602082019050818103600083015262000ab08162000a6e565b9050919050565b7f496e76616c69642072657761726420746f6b656e000000000000000000000000600082015250565b600062000aef601483620009c2565b915062000afc8262000ab7565b602082019050919050565b6000602082019050818103600083015262000b228162000ae0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600062000b6582620006cf565b915062000b7283620006cf565b925082820262000b8281620006cf565b9150828204841483151762000b9c5762000b9b62000b29565b5b5092915050565b7f54617820726174696f2065786365656473203130252063617000000000000000600082015250565b600062000bdb601983620009c2565b915062000be88262000ba3565b602082019050919050565b6000602082019050818103600083015262000c0e8162000bcc565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061ffff82169050919050565b600062000c5f8262000c44565b915061ffff820362000c765762000c7562000b29565b5b600182019050919050565b60805160a05160c051614b2a62000cfe600039600081816112d1015281816114b9015261256201526000818161087a01528181610cd50152818161103d01528181611181015281816113d4015281816115720152611f8f015260008181610b9001528181610c47015281816124c1015261275f0152614b2a6000f3fe608060405234801561001057600080fd5b50600436106102695760003560e01c806381014fe411610151578063abe50f19116100c3578063cdf24c2f11610087578063cdf24c2f146106a7578063d37e51da146106c5578063d547741f146106e3578063f7c618c1146106ff578063f854a27f1461071d578063fb9604ce1461074e57610269565b8063abe50f1914610629578063b12ed45e14610645578063bd5c566414610663578063c4b8d27d14610681578063c9e721aa1461069d57610269565b8063a217fddf11610115578063a217fddf14610568578063a728517614610586578063a7c8a9e6146105a2578063a87430ba146105be578063a9170d81146105ef578063aa8172301461060d57610269565b806381014fe4146104d85780638456cb59146104f65780638980f11f1461050057806391d148541461051c57806392930b451461054c57610269565b806336568abe116101ea5780635c975abb116101ae5780635c975abb14610424578063643059161461044257806372f702f3146104605780637718d1e21461047e5780637f91d2351461049c5780638021e4a2146104ba57610269565b806336568abe146103ba578063372500ab146103d65780633f4ba83a146103e057806348928d57146103ea5780635992c85c1461040857610269565b8063230f289711610231578063230f289714610314578063248a9ca31461033257806325c065b1146103625780632876d7e4146103805780632f2ff15d1461039e57610269565b806301ffc9a71461026e57806306e0cf651461029e5780630f8cc3fd146102bc57806312d3b8c9146102da57806316992873146102f8575b600080fd5b61028860048036038101906102839190613199565b61076a565b60405161029591906131e1565b60405180910390f35b6102a66107e4565b6040516102b39190613215565b60405180910390f35b6102c46107ea565b6040516102d19190613215565b60405180910390f35b6102e26107f0565b6040516102ef9190613215565b60405180910390f35b610312600480360381019061030d919061325c565b6107f6565b005b61031c61094d565b6040516103299190613215565b60405180910390f35b61034c600480360381019061034791906132bf565b610953565b60405161035991906132fb565b60405180910390f35b61036a610973565b6040516103779190613215565b60405180910390f35b610388610979565b6040516103959190613215565b60405180910390f35b6103b860048036038101906103b39190613374565b61097f565b005b6103d460048036038101906103cf9190613374565b6109a0565b005b6103de610a23565b005b6103e8610a4f565b005b6103f2610a84565b6040516103ff9190613215565b60405180910390f35b610422600480360381019061041d91906133b4565b610a8a565b005b61042c610b53565b60405161043991906131e1565b60405180910390f35b61044a610b6a565b60405161045791906132fb565b60405180910390f35b610468610b8e565b6040516104759190613453565b60405180910390f35b610486610bb2565b6040516104939190613215565b60405180910390f35b6104a4610bb8565b6040516104b19190613215565b60405180910390f35b6104c2610bbe565b6040516104cf9190613491565b60405180910390f35b6104e0610bd8565b6040516104ed9190613215565b60405180910390f35b6104fe610bde565b005b61051a600480360381019061051591906134ea565b610c13565b005b61053660048036038101906105319190613374565b610eb0565b60405161054391906131e1565b60405180910390f35b61056660048036038101906105619190613556565b610f1b565b005b610570610f43565b60405161057d91906132fb565b60405180910390f35b6105a0600480360381019061059b919061325c565b610f4a565b005b6105bc60048036038101906105b7919061325c565b61108e565b005b6105d860048036038101906105d391906135a9565b6111d2565b6040516105e69291906135d6565b60405180910390f35b6105f76111f6565b6040516106049190613215565b60405180910390f35b610627600480360381019061062291906133b4565b61120b565b005b610643600480360381019061063e91906135ff565b611285565b005b61064d6112ab565b60405161065a91906132fb565b60405180910390f35b61066b6112cf565b6040516106789190613491565b60405180910390f35b61069b6004803603810190610696919061325c565b6112f3565b005b6106a561148d565b005b6106af61152f565b6040516106bc9190613215565b60405180910390f35b6106cd611535565b6040516106da9190613491565b60405180910390f35b6106fd60048036038101906106f89190613374565b61154f565b005b610707611570565b6040516107149190613453565b60405180910390f35b610737600480360381019061073291906135a9565b611594565b6040516107459291906135d6565b60405180910390f35b6107686004803603810190610763919061366b565b61177a565b005b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806107dd57506107dc82611886565b5b9050919050565b60055481565b60085481565b60045481565b6107fe6118f0565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec6108288161193f565b6000821161086b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108629061371b565b60405180910390fd5b6108bf610876611953565b30847f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1661195b909392919063ffffffff16565b81600660008282546108d1919061376a565b925050819055507fed3478da81eace932babc39c0291e9731a6cc6249b5199cc742ec19a720bcc57600654600a60089054906101000a900467ffffffffffffffff16600a60009054906101000a900467ffffffffffffffff166040516109399392919061379e565b60405180910390a15061094a6119e4565b50565b60065481565b600060026000838152602001908152602001600020600101549050919050565b60035481565b60075481565b61098882610953565b6109918161193f565b61099b83836119ee565b505050565b6109a8611953565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610a15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0c90613847565b60405180910390fd5b610a1f8282611acf565b5050565b610a2b6118f0565b610a33611bb1565b610a3b611bfb565b610a456000611dae565b610a4d6119e4565b565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec610a798161193f565b610a81612030565b50565b600d5481565b7f969e743677c83a4458df4afcef9c1049579c1137c04e48694290c3e5fe6ef476610ab48161193f565b81600a84610ac29190613867565b1115610b03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afa906138f5565b60405180910390fd5b82600b8190555081600c819055507f091392e521f32b928e7effd1b5ff766e8c6faf01f5aceb57f54dc32cd2f57583600b54600c54604051610b469291906135d6565b60405180910390a1505050565b6000600160009054906101000a900460ff16905090565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec81565b7f000000000000000000000000000000000000000000000000000000000000000081565b600c5481565b600e5481565b600a60089054906101000a900467ffffffffffffffff1681565b600b5481565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec610c088161193f565b610c10612093565b50565b610c1b6118f0565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec610c458161193f565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610cd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cca90613987565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d58906139f3565b60405180910390fd5b60008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610d9c9190613a22565b602060405180830381865afa158015610db9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddd9190613a52565b905082811015610e22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1990613acb565b60405180910390fd5b610e54610e2d611953565b848673ffffffffffffffffffffffffffffffffffffffff166120f59092919063ffffffff16565b8373ffffffffffffffffffffffffffffffffffffffff167f55350610fe57096d8c0ffa30beede987326bccfcb0b4415804164d0dd50ce8b184604051610e9a9190613215565b60405180910390a25050610eac6119e4565b5050565b60006002600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b610f236118f0565b610f2b611bb1565b610f3683838361217b565b610f3e6119e4565b505050565b6000801b81565b610f526118f0565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec610f7c8161193f565b60008211610fbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb690613b5d565b60405180910390fd5b6000600954600854610fd19190613b7d565b905080831115611016576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100d90613c23565b60405180910390fd5b8260096000828254611028919061376a565b9250508190555061108161103a611953565b847f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166120f59092919063ffffffff16565b505061108b6119e4565b50565b6110966118f0565b7f969e743677c83a4458df4afcef9c1049579c1137c04e48694290c3e5fe6ef4766110c08161193f565b60008211611103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fa90613cb5565b60405180910390fd5b6000600e54600d546111159190613b7d565b90508083111561115a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115190613d47565b60405180910390fd5b82600e600082825461116c919061376a565b925050819055506111c561117e611953565b847f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166120f59092919063ffffffff16565b50506111cf6119e4565b50565b600f6020528060005260406000206000915090508060000154908060010154905082565b701d6329f1c35ca4bfabb9f561000000000081565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec6112358161193f565b82600381905550816004819055507f14207e149af257f57a5573a804ff84d3f14a60673e606ec6c2acdd9f70c355226003546004546040516112789291906135d6565b60405180910390a1505050565b61128d6118f0565b611295611bb1565b61129f8282612560565b6112a76119e4565b5050565b7f969e743677c83a4458df4afcef9c1049579c1137c04e48694290c3e5fe6ef47681565b7f000000000000000000000000000000000000000000000000000000000000000081565b6112fb6118f0565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec6113258161193f565b60008211611368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135f90613dd9565b60405180910390fd5b6006548211156113ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a490613e6b565b60405180910390fd5b81600660008282546113bf9190613b7d565b925050819055506114186113d1611953565b837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166120f59092919063ffffffff16565b7fed3478da81eace932babc39c0291e9731a6cc6249b5199cc742ec19a720bcc57600654600a60089054906101000a900467ffffffffffffffff16600a60009054906101000a900467ffffffffffffffff166040516114799392919061379e565b60405180910390a15061148a6119e4565b50565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec6114b78161193f565b7f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff16421015611524576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151b90613ed7565b60405180910390fd5b61152c611bfb565b50565b60095481565b600a60009054906101000a900467ffffffffffffffff1681565b61155882610953565b6115618161193f565b61156b8383611acf565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008060006115c342600a60009054906101000a900467ffffffffffffffff1667ffffffffffffffff166128e5565b90506000600a60089054906101000a900467ffffffffffffffff16600a60009054906101000a900467ffffffffffffffff166115ff9190613ef7565b90506000600a60089054906101000a900467ffffffffffffffff16836116259190613ef7565b90506000808367ffffffffffffffff16111561165f5761165c6006548367ffffffffffffffff168567ffffffffffffffff166128fe565b90505b60006007549050600a60009054906101000a900467ffffffffffffffff1667ffffffffffffffff168567ffffffffffffffff16111580156116a257506000600554115b156116d3576116c582701d6329f1c35ca4bfabb9f56100000000006005546128fe565b816116d0919061376a565b90505b611768600f60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600f60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015483600b54600c546129d9565b80975081985050505050505050915091565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec6117a48161193f565b428267ffffffffffffffff16116117f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e790613fa5565b60405180910390fd5b81600a60006101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055507fed3478da81eace932babc39c0291e9731a6cc6249b5199cc742ec19a720bcc57600654600a60089054906101000a900467ffffffffffffffff16600a60009054906101000a900467ffffffffffffffff1660405161187a9392919061379e565b60405180910390a15050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600260005403611935576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192c90614011565b60405180910390fd5b6002600081905550565b6119508161194b611953565b612a33565b50565b600033905090565b6119de846323b872dd60e01b85858560405160240161197c93929190614031565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612ab8565b50505050565b6001600081905550565b6119f88282610eb0565b611acb5760016002600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611a70611953565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b611ad98282610eb0565b15611bad5760006002600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611b52611953565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b611bb9610b53565b15611bf9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bf0906140b4565b60405180910390fd5b565b6000611c2742600a60009054906101000a900467ffffffffffffffff1667ffffffffffffffff166128e5565b90506000600a60089054906101000a900467ffffffffffffffff16600a60009054906101000a900467ffffffffffffffff16611c639190613ef7565b905060008167ffffffffffffffff1603611c7e575050611dac565b6000600a60089054906101000a900467ffffffffffffffff1683611ca29190613ef7565b90506000611cc76006548367ffffffffffffffff168567ffffffffffffffff166128fe565b90506000806005541115611d1357611cf382701d6329f1c35ca4bfabb9f56100000000006005546128fe565b90508060076000828254611d07919061376a565b92505081905550611d64565b8160086000828254611d25919061376a565b925050819055507fa641ca195988b20fb3185bbfd64521b79089ad0913255a52c171bac83783bdda82604051611d5b9190613215565b60405180910390a15b8160066000828254611d769190613b7d565b9250508190555084600a60086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555050505050505b565b600080611e56600f6000611dc0611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600f6000611e0a611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600754600b54600c546129d9565b9150915060045482101580611e685750825b611ea7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9e90614120565b60405180910390fd5b600754600f6000611eb6611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055508215611f68578082611f09919061376a565b60086000828254611f1a919061376a565b925050819055507fa641ca195988b20fb3185bbfd64521b79089ad0913255a52c171bac83783bdda8183611f4e919061376a565b604051611f5b9190613215565b60405180910390a161202b565b80600d6000828254611f7a919061376a565b92505081905550611fd3611f8c611953565b837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166120f59092919063ffffffff16565b611fdb611953565b73ffffffffffffffffffffffffffffffffffffffff167fdacbdde355ba930696a362ea6738feb9f8bd52dfb3d81947558fd3217e23e32583836040516120229291906135d6565b60405180910390a25b505050565b612038612b7f565b6000600160006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61207c611953565b6040516120899190613a22565b60405180910390a1565b61209b611bb1565b60018060006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586120de611953565b6040516120eb9190613a22565b60405180910390a1565b6121768363a9059cbb60e01b8484604051602401612114929190614140565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612ab8565b505050565b6000600f6000612189611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015403612207576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121fe906141b5565b60405180910390fd5b82600f6000612214611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541015612293576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161228a90614247565b60405180910390fd5b600083116122d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122cd906142b3565b60405180910390fd5b82600f60006122e3611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541480612383575060035483600f6000612338611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546123809190613b7d565b10155b6123c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123b99061436b565b60405180910390fd5b6123ca611bfb565b600083600f60006123d9611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546124219190613b7d565b9050828061242f5750600081145b156124425761243d82611dae565b61244c565b61244b81612bc8565b5b80600f6000612459611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555083600560008282546124ac9190613b7d565b925050819055506125056124be611953565b857f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166120f59092919063ffffffff16565b61250d611953565b73ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5856040516125529190613215565b60405180910390a250505050565b7f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff164210156125cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125c490613ed7565b60405180910390fd5b600060065411612612576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612609906143fd565b60405180910390fd5b600a60009054906101000a900467ffffffffffffffff1667ffffffffffffffff164210612674576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161266b90614469565b60405180910390fd5b600082116126b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126ae906144d5565b60405180910390fd5b600354600f60006126c6611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001548361270f919061376a565b1015612750576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161274790614567565b60405180910390fd5b6127a461275b611953565b30847f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1661195b909392919063ffffffff16565b6127ac611bfb565b600082600f60006127bb611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154612803919061376a565b9050811561281a576128156000611dae565b612824565b61282381612bc8565b5b80600f6000612831611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055508260056000828254612884919061376a565b92505081905550612893611953565b73ffffffffffffffffffffffffffffffffffffffff167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d846040516128d89190613215565b60405180910390a2505050565b60008183106128f457816128f6565b825b905092915050565b60008060008019858709858702925082811083820303915050600081036129395783828161292f5761292e614587565b5b04925050506129d2565b80841161294557600080fd5b60008486880990508281118203915080830392506000600186190186169050808604955080840493506001818260000304019050808302841793506000600287600302189050808702600203810290508087026002038102905080870260020381029050808702600203810290508087026002038102905080870260020381029050808502955050505050505b9392505050565b600080600087866129ea9190613b7d565b90506000612a0a8289701d6329f1c35ca4bfabb9f56100000000006128fe565b9050612a178187876128fe565b92508281612a259190613b7d565b935050509550959350505050565b612a3d8282610eb0565b612ab457612a4a81612d06565b612a588360001c6020612d33565b604051602001612a699291906146bf565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aab9190614743565b60405180910390fd5b5050565b6000612b1a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612f6f9092919063ffffffff16565b9050600081511115612b7a5780806020019051810190612b3a919061477a565b612b79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b7090614819565b60405180910390fd5b5b505050565b612b87610b53565b612bc6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bbd90614885565b60405180910390fd5b565b600080612c70600f6000612bda611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600f6000612c24611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600754600b54600c546129d9565b9150915060008183612c82919061376a565b90506000612ca282701d6329f1c35ca4bfabb9f5610000000000876128fe565b905080600754612cb29190613b7d565b600f6000612cbe611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505050505050565b6060612d2c8273ffffffffffffffffffffffffffffffffffffffff16601460ff16612d33565b9050919050565b606060006002836002612d469190613867565b612d50919061376a565b67ffffffffffffffff811115612d6957612d686148a5565b5b6040519080825280601f01601f191660200182016040528015612d9b5781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612dd357612dd26148d4565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612e3757612e366148d4565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002612e779190613867565b612e81919061376a565b90505b6001811115612f21577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110612ec357612ec26148d4565b5b1a60f81b828281518110612eda57612ed96148d4565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080612f1a90614903565b9050612e84565b5060008414612f65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f5c90614978565b60405180910390fd5b8091505092915050565b6060612f7e8484600085612f87565b90509392505050565b606082471015612fcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fc390614a0a565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051612ff59190614a71565b60006040518083038185875af1925050503d8060008114613032576040519150601f19603f3d011682016040523d82523d6000602084013e613037565b606091505b509150915061304887838387613054565b92505050949350505050565b606083156130b65760008351036130ae5761306e856130c9565b6130ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130a490614ad4565b60405180910390fd5b5b8290506130c1565b6130c083836130ec565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000825111156130ff5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131339190614743565b60405180910390fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61317681613141565b811461318157600080fd5b50565b6000813590506131938161316d565b92915050565b6000602082840312156131af576131ae61313c565b5b60006131bd84828501613184565b91505092915050565b60008115159050919050565b6131db816131c6565b82525050565b60006020820190506131f660008301846131d2565b92915050565b6000819050919050565b61320f816131fc565b82525050565b600060208201905061322a6000830184613206565b92915050565b613239816131fc565b811461324457600080fd5b50565b60008135905061325681613230565b92915050565b6000602082840312156132725761327161313c565b5b600061328084828501613247565b91505092915050565b6000819050919050565b61329c81613289565b81146132a757600080fd5b50565b6000813590506132b981613293565b92915050565b6000602082840312156132d5576132d461313c565b5b60006132e3848285016132aa565b91505092915050565b6132f581613289565b82525050565b600060208201905061331060008301846132ec565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061334182613316565b9050919050565b61335181613336565b811461335c57600080fd5b50565b60008135905061336e81613348565b92915050565b6000806040838503121561338b5761338a61313c565b5b6000613399858286016132aa565b92505060206133aa8582860161335f565b9150509250929050565b600080604083850312156133cb576133ca61313c565b5b60006133d985828601613247565b92505060206133ea85828601613247565b9150509250929050565b6000819050919050565b600061341961341461340f84613316565b6133f4565b613316565b9050919050565b600061342b826133fe565b9050919050565b600061343d82613420565b9050919050565b61344d81613432565b82525050565b60006020820190506134686000830184613444565b92915050565b600067ffffffffffffffff82169050919050565b61348b8161346e565b82525050565b60006020820190506134a66000830184613482565b92915050565b60006134b782613336565b9050919050565b6134c7816134ac565b81146134d257600080fd5b50565b6000813590506134e4816134be565b92915050565b600080604083850312156135015761350061313c565b5b600061350f858286016134d5565b925050602061352085828601613247565b9150509250929050565b613533816131c6565b811461353e57600080fd5b50565b6000813590506135508161352a565b92915050565b60008060006060848603121561356f5761356e61313c565b5b600061357d86828701613247565b935050602061358e86828701613541565b925050604061359f86828701613541565b9150509250925092565b6000602082840312156135bf576135be61313c565b5b60006135cd8482850161335f565b91505092915050565b60006040820190506135eb6000830185613206565b6135f86020830184613206565b9392505050565b600080604083850312156136165761361561313c565b5b600061362485828601613247565b925050602061363585828601613541565b9150509250929050565b6136488161346e565b811461365357600080fd5b50565b6000813590506136658161363f565b92915050565b6000602082840312156136815761368061313c565b5b600061368f84828501613656565b91505092915050565b600082825260208201905092915050565b7f556e61626c6520746f206465706f73697420302072657761726420746f6b656e60008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000613705602183613698565b9150613710826136a9565b604082019050919050565b60006020820190508181036000830152613734816136f8565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613775826131fc565b9150613780836131fc565b92508282019050808211156137985761379761373b565b5b92915050565b60006060820190506137b36000830186613206565b6137c06020830185613482565b6137cd6040830184613482565b949350505050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000613831602f83613698565b915061383c826137d5565b604082019050919050565b6000602082019050818103600083015261386081613824565b9050919050565b6000613872826131fc565b915061387d836131fc565b925082820261388b816131fc565b915082820484148315176138a2576138a161373b565b5b5092915050565b7f54617820726174696f2065786365656473203130252063617000000000000000600082015250565b60006138df601983613698565b91506138ea826138a9565b602082019050919050565b6000602082019050818103600083015261390e816138d2565b9050919050565b7f43616e6e6f7420776974686472617720746865207374616b696e6720746f6b6560008201527f6e00000000000000000000000000000000000000000000000000000000000000602082015250565b6000613971602183613698565b915061397c82613915565b604082019050919050565b600060208201905081810360008301526139a081613964565b9050919050565b7f43616e6e6f74207769746864726177207468652072657761726420746f6b656e600082015250565b60006139dd602083613698565b91506139e8826139a7565b602082019050919050565b60006020820190508181036000830152613a0c816139d0565b9050919050565b613a1c81613336565b82525050565b6000602082019050613a376000830184613a13565b92915050565b600081519050613a4c81613230565b92915050565b600060208284031215613a6857613a6761313c565b5b6000613a7684828501613a3d565b91505092915050565b7f4e6f7420656e6f75676820746f6b656e7320746f207769746864726177000000600082015250565b6000613ab5601d83613698565b9150613ac082613a7f565b602082019050919050565b60006020820190508181036000830152613ae481613aa8565b9050919050565b7f556e61626c6520746f2077697468647261772030206c6f73742072657761726460008201527f7320746f6b656e73000000000000000000000000000000000000000000000000602082015250565b6000613b47602883613698565b9150613b5282613aeb565b604082019050919050565b60006020820190508181036000830152613b7681613b3a565b9050919050565b6000613b88826131fc565b9150613b93836131fc565b9250828203905081811115613bab57613baa61373b565b5b92915050565b7f416d6f756e742069732067726561746572207468616e20617661696c61626c6560008201527f206c6f7374207265776172647300000000000000000000000000000000000000602082015250565b6000613c0d602d83613698565b9150613c1882613bb1565b604082019050919050565b60006020820190508181036000830152613c3c81613c00565b9050919050565b7f556e61626c6520746f20776974686472617720302070726f6772616d2074617860008201527f6573000000000000000000000000000000000000000000000000000000000000602082015250565b6000613c9f602283613698565b9150613caa82613c43565b604082019050919050565b60006020820190508181036000830152613cce81613c92565b9050919050565b7f416d6f756e742069732067726561746572207468616e20617661696c61626c6560008201527f2074617865730000000000000000000000000000000000000000000000000000602082015250565b6000613d31602683613698565b9150613d3c82613cd5565b604082019050919050565b60006020820190508181036000830152613d6081613d24565b9050919050565b7f556e61626c6520746f20776974686472617720302072657761726420746f6b6560008201527f6e73000000000000000000000000000000000000000000000000000000000000602082015250565b6000613dc3602283613698565b9150613dce82613d67565b604082019050919050565b60006020820190508181036000830152613df281613db6565b9050919050565b7f556e61626c6520746f207769746864726177206d6f7265207468616e2074686560008201527f2070726f6772616d207265776172642072656d61696e696e6700000000000000602082015250565b6000613e55603983613698565b9150613e6082613df9565b604082019050919050565b60006020820190508181036000830152613e8481613e48565b9050919050565b7f5374616b696e672070726f6772616d206e6f74206f70656e2079657400000000600082015250565b6000613ec1601c83613698565b9150613ecc82613e8b565b602082019050919050565b60006020820190508181036000830152613ef081613eb4565b9050919050565b6000613f028261346e565b9150613f0d8361346e565b9250828203905067ffffffffffffffff811115613f2d57613f2c61373b565b5b92915050565b7f4e65772070726f6772616d206465706c6574696f6e2064617465206d7573742060008201527f62652067726561746572207468616e2063757272656e742074696d6500000000602082015250565b6000613f8f603c83613698565b9150613f9a82613f33565b604082019050919050565b60006020820190508181036000830152613fbe81613f82565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000613ffb601f83613698565b915061400682613fc5565b602082019050919050565b6000602082019050818103600083015261402a81613fee565b9050919050565b60006060820190506140466000830186613a13565b6140536020830185613a13565b6140606040830184613206565b949350505050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b600061409e601083613698565b91506140a982614068565b602082019050919050565b600060208201905081810360008301526140cd81614091565b9050919050565b7f4e6f7420656e6f756768207265776172647320746f20636c61696d0000000000600082015250565b600061410a601b83613698565b9150614115826140d4565b602082019050919050565b60006020820190508181036000830152614139816140fd565b9050919050565b60006040820190506141556000830185613a13565b6141626020830184613206565b9392505050565b7f4e6f20616d6f756e7420746f2077697468647261770000000000000000000000600082015250565b600061419f601583613698565b91506141aa82614169565b602082019050919050565b600060208201905081810360008301526141ce81614192565b9050919050565b7f416d6f756e7420746f207769746864726177206973206772656174657220746860008201527f616e207374616b65640000000000000000000000000000000000000000000000602082015250565b6000614231602983613698565b915061423c826141d5565b604082019050919050565b6000602082019050818103600083015261426081614224565b9050919050565b7f556e61626c6520746f207769746864726177203020746f6b656e730000000000600082015250565b600061429d601b83613698565b91506142a882614267565b602082019050919050565b600060208201905081810360008301526142cc81614290565b9050919050565b7f5468652066696e616c207374616b656420616d6f756e7420776f756c6420626560008201527f206c657373207468616e2072657175697265642062792074686520737065636960208201527f666965642070726f6772616d0000000000000000000000000000000000000000604082015250565b6000614355604c83613698565b9150614360826142d3565b606082019050919050565b6000602082019050818103600083015261438481614348565b9050919050565b7f546865726520617265206e6f2072657761726473206465706f7369746564207960008201527f6574000000000000000000000000000000000000000000000000000000000000602082015250565b60006143e7602283613698565b91506143f28261438b565b604082019050919050565b60006020820190508181036000830152614416816143da565b9050919050565b7f5374616b696e672070726f6772616d2068617320636c6f736564000000000000600082015250565b6000614453601a83613698565b915061445e8261441d565b602082019050919050565b6000602082019050818103600083015261448281614446565b9050919050565b7f556e61626c6520746f207374616b65203020746f6b656e730000000000000000600082015250565b60006144bf601883613698565b91506144ca82614489565b602082019050919050565b600060208201905081810360008301526144ee816144b2565b9050919050565b7f5374616b696e67206c657373207468616e20726571756972656420627920746860008201527f65207370656369666965642070726f6772616d00000000000000000000000000602082015250565b6000614551603383613698565b915061455c826144f5565b604082019050919050565b6000602082019050818103600083015261458081614544565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b60006145f76017836145b6565b9150614602826145c1565b601782019050919050565b600081519050919050565b60005b8381101561463657808201518184015260208101905061461b565b60008484015250505050565b600061464d8261460d565b61465781856145b6565b9350614667818560208601614618565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b60006146a96011836145b6565b91506146b482614673565b601182019050919050565b60006146ca826145ea565b91506146d68285614642565b91506146e18261469c565b91506146ed8284614642565b91508190509392505050565b6000601f19601f8301169050919050565b60006147158261460d565b61471f8185613698565b935061472f818560208601614618565b614738816146f9565b840191505092915050565b6000602082019050818103600083015261475d818461470a565b905092915050565b6000815190506147748161352a565b92915050565b6000602082840312156147905761478f61313c565b5b600061479e84828501614765565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000614803602a83613698565b915061480e826147a7565b604082019050919050565b60006020820190508181036000830152614832816147f6565b9050919050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b600061486f601483613698565b915061487a82614839565b602082019050919050565b6000602082019050818103600083015261489e81614862565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061490e826131fc565b9150600082036149215761492061373b565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000614962602083613698565b915061496d8261492c565b602082019050919050565b6000602082019050818103600083015261499181614955565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b60006149f4602683613698565b91506149ff82614998565b604082019050919050565b60006020820190508181036000830152614a23816149e7565b9050919050565b600081519050919050565b600081905092915050565b6000614a4b82614a2a565b614a558185614a35565b9350614a65818560208601614618565b80840191505092915050565b6000614a7d8284614a40565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000614abe601d83613698565b9150614ac982614a88565b602082019050919050565b60006020820190508181036000830152614aed81614ab1565b905091905056fea2646970667358221220bc9c2003d2e09db21d5df4bc722aa9ebcdd59632b8474e96b57bf93a82ad0f8a64736f6c634300081200330000000000000000000000004f883b5c0c01fe13cedd05c684f00266b0626e2300000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e3cfe45e3ee7c017277f22e35d2f29edc99d57000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000066918b400000000000000000000000000000000000000000000000000000000067841f40000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000100000000000000000000000077a6be2dd110a230764744acb87bc4a05e5d3212
608060405234801561001057600080fd5b50600436106102695760003560e01c806381014fe411610151578063abe50f19116100c3578063cdf24c2f11610087578063cdf24c2f146106a7578063d37e51da146106c5578063d547741f146106e3578063f7c618c1146106ff578063f854a27f1461071d578063fb9604ce1461074e57610269565b8063abe50f1914610629578063b12ed45e14610645578063bd5c566414610663578063c4b8d27d14610681578063c9e721aa1461069d57610269565b8063a217fddf11610115578063a217fddf14610568578063a728517614610586578063a7c8a9e6146105a2578063a87430ba146105be578063a9170d81146105ef578063aa8172301461060d57610269565b806381014fe4146104d85780638456cb59146104f65780638980f11f1461050057806391d148541461051c57806392930b451461054c57610269565b806336568abe116101ea5780635c975abb116101ae5780635c975abb14610424578063643059161461044257806372f702f3146104605780637718d1e21461047e5780637f91d2351461049c5780638021e4a2146104ba57610269565b806336568abe146103ba578063372500ab146103d65780633f4ba83a146103e057806348928d57146103ea5780635992c85c1461040857610269565b8063230f289711610231578063230f289714610314578063248a9ca31461033257806325c065b1146103625780632876d7e4146103805780632f2ff15d1461039e57610269565b806301ffc9a71461026e57806306e0cf651461029e5780630f8cc3fd146102bc57806312d3b8c9146102da57806316992873146102f8575b600080fd5b61028860048036038101906102839190613199565b61076a565b60405161029591906131e1565b60405180910390f35b6102a66107e4565b6040516102b39190613215565b60405180910390f35b6102c46107ea565b6040516102d19190613215565b60405180910390f35b6102e26107f0565b6040516102ef9190613215565b60405180910390f35b610312600480360381019061030d919061325c565b6107f6565b005b61031c61094d565b6040516103299190613215565b60405180910390f35b61034c600480360381019061034791906132bf565b610953565b60405161035991906132fb565b60405180910390f35b61036a610973565b6040516103779190613215565b60405180910390f35b610388610979565b6040516103959190613215565b60405180910390f35b6103b860048036038101906103b39190613374565b61097f565b005b6103d460048036038101906103cf9190613374565b6109a0565b005b6103de610a23565b005b6103e8610a4f565b005b6103f2610a84565b6040516103ff9190613215565b60405180910390f35b610422600480360381019061041d91906133b4565b610a8a565b005b61042c610b53565b60405161043991906131e1565b60405180910390f35b61044a610b6a565b60405161045791906132fb565b60405180910390f35b610468610b8e565b6040516104759190613453565b60405180910390f35b610486610bb2565b6040516104939190613215565b60405180910390f35b6104a4610bb8565b6040516104b19190613215565b60405180910390f35b6104c2610bbe565b6040516104cf9190613491565b60405180910390f35b6104e0610bd8565b6040516104ed9190613215565b60405180910390f35b6104fe610bde565b005b61051a600480360381019061051591906134ea565b610c13565b005b61053660048036038101906105319190613374565b610eb0565b60405161054391906131e1565b60405180910390f35b61056660048036038101906105619190613556565b610f1b565b005b610570610f43565b60405161057d91906132fb565b60405180910390f35b6105a0600480360381019061059b919061325c565b610f4a565b005b6105bc60048036038101906105b7919061325c565b61108e565b005b6105d860048036038101906105d391906135a9565b6111d2565b6040516105e69291906135d6565b60405180910390f35b6105f76111f6565b6040516106049190613215565b60405180910390f35b610627600480360381019061062291906133b4565b61120b565b005b610643600480360381019061063e91906135ff565b611285565b005b61064d6112ab565b60405161065a91906132fb565b60405180910390f35b61066b6112cf565b6040516106789190613491565b60405180910390f35b61069b6004803603810190610696919061325c565b6112f3565b005b6106a561148d565b005b6106af61152f565b6040516106bc9190613215565b60405180910390f35b6106cd611535565b6040516106da9190613491565b60405180910390f35b6106fd60048036038101906106f89190613374565b61154f565b005b610707611570565b6040516107149190613453565b60405180910390f35b610737600480360381019061073291906135a9565b611594565b6040516107459291906135d6565b60405180910390f35b6107686004803603810190610763919061366b565b61177a565b005b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806107dd57506107dc82611886565b5b9050919050565b60055481565b60085481565b60045481565b6107fe6118f0565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec6108288161193f565b6000821161086b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108629061371b565b60405180910390fd5b6108bf610876611953565b30847f0000000000000000000000002e3cfe45e3ee7c017277f22e35d2f29edc99d57073ffffffffffffffffffffffffffffffffffffffff1661195b909392919063ffffffff16565b81600660008282546108d1919061376a565b925050819055507fed3478da81eace932babc39c0291e9731a6cc6249b5199cc742ec19a720bcc57600654600a60089054906101000a900467ffffffffffffffff16600a60009054906101000a900467ffffffffffffffff166040516109399392919061379e565b60405180910390a15061094a6119e4565b50565b60065481565b600060026000838152602001908152602001600020600101549050919050565b60035481565b60075481565b61098882610953565b6109918161193f565b61099b83836119ee565b505050565b6109a8611953565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610a15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0c90613847565b60405180910390fd5b610a1f8282611acf565b5050565b610a2b6118f0565b610a33611bb1565b610a3b611bfb565b610a456000611dae565b610a4d6119e4565b565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec610a798161193f565b610a81612030565b50565b600d5481565b7f969e743677c83a4458df4afcef9c1049579c1137c04e48694290c3e5fe6ef476610ab48161193f565b81600a84610ac29190613867565b1115610b03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afa906138f5565b60405180910390fd5b82600b8190555081600c819055507f091392e521f32b928e7effd1b5ff766e8c6faf01f5aceb57f54dc32cd2f57583600b54600c54604051610b469291906135d6565b60405180910390a1505050565b6000600160009054906101000a900460ff16905090565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec81565b7f0000000000000000000000004f883b5c0c01fe13cedd05c684f00266b0626e2381565b600c5481565b600e5481565b600a60089054906101000a900467ffffffffffffffff1681565b600b5481565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec610c088161193f565b610c10612093565b50565b610c1b6118f0565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec610c458161193f565b7f0000000000000000000000004f883b5c0c01fe13cedd05c684f00266b0626e2373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610cd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cca90613987565b60405180910390fd5b7f0000000000000000000000002e3cfe45e3ee7c017277f22e35d2f29edc99d57073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d58906139f3565b60405180910390fd5b60008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610d9c9190613a22565b602060405180830381865afa158015610db9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddd9190613a52565b905082811015610e22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1990613acb565b60405180910390fd5b610e54610e2d611953565b848673ffffffffffffffffffffffffffffffffffffffff166120f59092919063ffffffff16565b8373ffffffffffffffffffffffffffffffffffffffff167f55350610fe57096d8c0ffa30beede987326bccfcb0b4415804164d0dd50ce8b184604051610e9a9190613215565b60405180910390a25050610eac6119e4565b5050565b60006002600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b610f236118f0565b610f2b611bb1565b610f3683838361217b565b610f3e6119e4565b505050565b6000801b81565b610f526118f0565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec610f7c8161193f565b60008211610fbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb690613b5d565b60405180910390fd5b6000600954600854610fd19190613b7d565b905080831115611016576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100d90613c23565b60405180910390fd5b8260096000828254611028919061376a565b9250508190555061108161103a611953565b847f0000000000000000000000002e3cfe45e3ee7c017277f22e35d2f29edc99d57073ffffffffffffffffffffffffffffffffffffffff166120f59092919063ffffffff16565b505061108b6119e4565b50565b6110966118f0565b7f969e743677c83a4458df4afcef9c1049579c1137c04e48694290c3e5fe6ef4766110c08161193f565b60008211611103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fa90613cb5565b60405180910390fd5b6000600e54600d546111159190613b7d565b90508083111561115a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115190613d47565b60405180910390fd5b82600e600082825461116c919061376a565b925050819055506111c561117e611953565b847f0000000000000000000000002e3cfe45e3ee7c017277f22e35d2f29edc99d57073ffffffffffffffffffffffffffffffffffffffff166120f59092919063ffffffff16565b50506111cf6119e4565b50565b600f6020528060005260406000206000915090508060000154908060010154905082565b701d6329f1c35ca4bfabb9f561000000000081565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec6112358161193f565b82600381905550816004819055507f14207e149af257f57a5573a804ff84d3f14a60673e606ec6c2acdd9f70c355226003546004546040516112789291906135d6565b60405180910390a1505050565b61128d6118f0565b611295611bb1565b61129f8282612560565b6112a76119e4565b5050565b7f969e743677c83a4458df4afcef9c1049579c1137c04e48694290c3e5fe6ef47681565b7f0000000000000000000000000000000000000000000000000000000066918b4081565b6112fb6118f0565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec6113258161193f565b60008211611368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135f90613dd9565b60405180910390fd5b6006548211156113ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a490613e6b565b60405180910390fd5b81600660008282546113bf9190613b7d565b925050819055506114186113d1611953565b837f0000000000000000000000002e3cfe45e3ee7c017277f22e35d2f29edc99d57073ffffffffffffffffffffffffffffffffffffffff166120f59092919063ffffffff16565b7fed3478da81eace932babc39c0291e9731a6cc6249b5199cc742ec19a720bcc57600654600a60089054906101000a900467ffffffffffffffff16600a60009054906101000a900467ffffffffffffffff166040516114799392919061379e565b60405180910390a15061148a6119e4565b50565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec6114b78161193f565b7f0000000000000000000000000000000000000000000000000000000066918b4067ffffffffffffffff16421015611524576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151b90613ed7565b60405180910390fd5b61152c611bfb565b50565b60095481565b600a60009054906101000a900467ffffffffffffffff1681565b61155882610953565b6115618161193f565b61156b8383611acf565b505050565b7f0000000000000000000000002e3cfe45e3ee7c017277f22e35d2f29edc99d57081565b60008060006115c342600a60009054906101000a900467ffffffffffffffff1667ffffffffffffffff166128e5565b90506000600a60089054906101000a900467ffffffffffffffff16600a60009054906101000a900467ffffffffffffffff166115ff9190613ef7565b90506000600a60089054906101000a900467ffffffffffffffff16836116259190613ef7565b90506000808367ffffffffffffffff16111561165f5761165c6006548367ffffffffffffffff168567ffffffffffffffff166128fe565b90505b60006007549050600a60009054906101000a900467ffffffffffffffff1667ffffffffffffffff168567ffffffffffffffff16111580156116a257506000600554115b156116d3576116c582701d6329f1c35ca4bfabb9f56100000000006005546128fe565b816116d0919061376a565b90505b611768600f60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600f60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015483600b54600c546129d9565b80975081985050505050505050915091565b7fbde745d383bd90948c6bf528cf5a56a9fe775bfee56a5d53b36fd785802b88ec6117a48161193f565b428267ffffffffffffffff16116117f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e790613fa5565b60405180910390fd5b81600a60006101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055507fed3478da81eace932babc39c0291e9731a6cc6249b5199cc742ec19a720bcc57600654600a60089054906101000a900467ffffffffffffffff16600a60009054906101000a900467ffffffffffffffff1660405161187a9392919061379e565b60405180910390a15050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600260005403611935576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192c90614011565b60405180910390fd5b6002600081905550565b6119508161194b611953565b612a33565b50565b600033905090565b6119de846323b872dd60e01b85858560405160240161197c93929190614031565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612ab8565b50505050565b6001600081905550565b6119f88282610eb0565b611acb5760016002600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611a70611953565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b611ad98282610eb0565b15611bad5760006002600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611b52611953565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b611bb9610b53565b15611bf9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bf0906140b4565b60405180910390fd5b565b6000611c2742600a60009054906101000a900467ffffffffffffffff1667ffffffffffffffff166128e5565b90506000600a60089054906101000a900467ffffffffffffffff16600a60009054906101000a900467ffffffffffffffff16611c639190613ef7565b905060008167ffffffffffffffff1603611c7e575050611dac565b6000600a60089054906101000a900467ffffffffffffffff1683611ca29190613ef7565b90506000611cc76006548367ffffffffffffffff168567ffffffffffffffff166128fe565b90506000806005541115611d1357611cf382701d6329f1c35ca4bfabb9f56100000000006005546128fe565b90508060076000828254611d07919061376a565b92505081905550611d64565b8160086000828254611d25919061376a565b925050819055507fa641ca195988b20fb3185bbfd64521b79089ad0913255a52c171bac83783bdda82604051611d5b9190613215565b60405180910390a15b8160066000828254611d769190613b7d565b9250508190555084600a60086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555050505050505b565b600080611e56600f6000611dc0611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600f6000611e0a611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600754600b54600c546129d9565b9150915060045482101580611e685750825b611ea7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9e90614120565b60405180910390fd5b600754600f6000611eb6611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055508215611f68578082611f09919061376a565b60086000828254611f1a919061376a565b925050819055507fa641ca195988b20fb3185bbfd64521b79089ad0913255a52c171bac83783bdda8183611f4e919061376a565b604051611f5b9190613215565b60405180910390a161202b565b80600d6000828254611f7a919061376a565b92505081905550611fd3611f8c611953565b837f0000000000000000000000002e3cfe45e3ee7c017277f22e35d2f29edc99d57073ffffffffffffffffffffffffffffffffffffffff166120f59092919063ffffffff16565b611fdb611953565b73ffffffffffffffffffffffffffffffffffffffff167fdacbdde355ba930696a362ea6738feb9f8bd52dfb3d81947558fd3217e23e32583836040516120229291906135d6565b60405180910390a25b505050565b612038612b7f565b6000600160006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61207c611953565b6040516120899190613a22565b60405180910390a1565b61209b611bb1565b60018060006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586120de611953565b6040516120eb9190613a22565b60405180910390a1565b6121768363a9059cbb60e01b8484604051602401612114929190614140565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612ab8565b505050565b6000600f6000612189611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015403612207576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121fe906141b5565b60405180910390fd5b82600f6000612214611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541015612293576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161228a90614247565b60405180910390fd5b600083116122d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122cd906142b3565b60405180910390fd5b82600f60006122e3611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541480612383575060035483600f6000612338611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546123809190613b7d565b10155b6123c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123b99061436b565b60405180910390fd5b6123ca611bfb565b600083600f60006123d9611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546124219190613b7d565b9050828061242f5750600081145b156124425761243d82611dae565b61244c565b61244b81612bc8565b5b80600f6000612459611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555083600560008282546124ac9190613b7d565b925050819055506125056124be611953565b857f0000000000000000000000004f883b5c0c01fe13cedd05c684f00266b0626e2373ffffffffffffffffffffffffffffffffffffffff166120f59092919063ffffffff16565b61250d611953565b73ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5856040516125529190613215565b60405180910390a250505050565b7f0000000000000000000000000000000000000000000000000000000066918b4067ffffffffffffffff164210156125cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125c490613ed7565b60405180910390fd5b600060065411612612576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612609906143fd565b60405180910390fd5b600a60009054906101000a900467ffffffffffffffff1667ffffffffffffffff164210612674576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161266b90614469565b60405180910390fd5b600082116126b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126ae906144d5565b60405180910390fd5b600354600f60006126c6611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001548361270f919061376a565b1015612750576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161274790614567565b60405180910390fd5b6127a461275b611953565b30847f0000000000000000000000004f883b5c0c01fe13cedd05c684f00266b0626e2373ffffffffffffffffffffffffffffffffffffffff1661195b909392919063ffffffff16565b6127ac611bfb565b600082600f60006127bb611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154612803919061376a565b9050811561281a576128156000611dae565b612824565b61282381612bc8565b5b80600f6000612831611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055508260056000828254612884919061376a565b92505081905550612893611953565b73ffffffffffffffffffffffffffffffffffffffff167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d846040516128d89190613215565b60405180910390a2505050565b60008183106128f457816128f6565b825b905092915050565b60008060008019858709858702925082811083820303915050600081036129395783828161292f5761292e614587565b5b04925050506129d2565b80841161294557600080fd5b60008486880990508281118203915080830392506000600186190186169050808604955080840493506001818260000304019050808302841793506000600287600302189050808702600203810290508087026002038102905080870260020381029050808702600203810290508087026002038102905080870260020381029050808502955050505050505b9392505050565b600080600087866129ea9190613b7d565b90506000612a0a8289701d6329f1c35ca4bfabb9f56100000000006128fe565b9050612a178187876128fe565b92508281612a259190613b7d565b935050509550959350505050565b612a3d8282610eb0565b612ab457612a4a81612d06565b612a588360001c6020612d33565b604051602001612a699291906146bf565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aab9190614743565b60405180910390fd5b5050565b6000612b1a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612f6f9092919063ffffffff16565b9050600081511115612b7a5780806020019051810190612b3a919061477a565b612b79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b7090614819565b60405180910390fd5b5b505050565b612b87610b53565b612bc6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bbd90614885565b60405180910390fd5b565b600080612c70600f6000612bda611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600f6000612c24611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600754600b54600c546129d9565b9150915060008183612c82919061376a565b90506000612ca282701d6329f1c35ca4bfabb9f5610000000000876128fe565b905080600754612cb29190613b7d565b600f6000612cbe611953565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505050505050565b6060612d2c8273ffffffffffffffffffffffffffffffffffffffff16601460ff16612d33565b9050919050565b606060006002836002612d469190613867565b612d50919061376a565b67ffffffffffffffff811115612d6957612d686148a5565b5b6040519080825280601f01601f191660200182016040528015612d9b5781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612dd357612dd26148d4565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612e3757612e366148d4565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002612e779190613867565b612e81919061376a565b90505b6001811115612f21577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110612ec357612ec26148d4565b5b1a60f81b828281518110612eda57612ed96148d4565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080612f1a90614903565b9050612e84565b5060008414612f65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f5c90614978565b60405180910390fd5b8091505092915050565b6060612f7e8484600085612f87565b90509392505050565b606082471015612fcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fc390614a0a565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051612ff59190614a71565b60006040518083038185875af1925050503d8060008114613032576040519150601f19603f3d011682016040523d82523d6000602084013e613037565b606091505b509150915061304887838387613054565b92505050949350505050565b606083156130b65760008351036130ae5761306e856130c9565b6130ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130a490614ad4565b60405180910390fd5b5b8290506130c1565b6130c083836130ec565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000825111156130ff5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131339190614743565b60405180910390fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61317681613141565b811461318157600080fd5b50565b6000813590506131938161316d565b92915050565b6000602082840312156131af576131ae61313c565b5b60006131bd84828501613184565b91505092915050565b60008115159050919050565b6131db816131c6565b82525050565b60006020820190506131f660008301846131d2565b92915050565b6000819050919050565b61320f816131fc565b82525050565b600060208201905061322a6000830184613206565b92915050565b613239816131fc565b811461324457600080fd5b50565b60008135905061325681613230565b92915050565b6000602082840312156132725761327161313c565b5b600061328084828501613247565b91505092915050565b6000819050919050565b61329c81613289565b81146132a757600080fd5b50565b6000813590506132b981613293565b92915050565b6000602082840312156132d5576132d461313c565b5b60006132e3848285016132aa565b91505092915050565b6132f581613289565b82525050565b600060208201905061331060008301846132ec565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061334182613316565b9050919050565b61335181613336565b811461335c57600080fd5b50565b60008135905061336e81613348565b92915050565b6000806040838503121561338b5761338a61313c565b5b6000613399858286016132aa565b92505060206133aa8582860161335f565b9150509250929050565b600080604083850312156133cb576133ca61313c565b5b60006133d985828601613247565b92505060206133ea85828601613247565b9150509250929050565b6000819050919050565b600061341961341461340f84613316565b6133f4565b613316565b9050919050565b600061342b826133fe565b9050919050565b600061343d82613420565b9050919050565b61344d81613432565b82525050565b60006020820190506134686000830184613444565b92915050565b600067ffffffffffffffff82169050919050565b61348b8161346e565b82525050565b60006020820190506134a66000830184613482565b92915050565b60006134b782613336565b9050919050565b6134c7816134ac565b81146134d257600080fd5b50565b6000813590506134e4816134be565b92915050565b600080604083850312156135015761350061313c565b5b600061350f858286016134d5565b925050602061352085828601613247565b9150509250929050565b613533816131c6565b811461353e57600080fd5b50565b6000813590506135508161352a565b92915050565b60008060006060848603121561356f5761356e61313c565b5b600061357d86828701613247565b935050602061358e86828701613541565b925050604061359f86828701613541565b9150509250925092565b6000602082840312156135bf576135be61313c565b5b60006135cd8482850161335f565b91505092915050565b60006040820190506135eb6000830185613206565b6135f86020830184613206565b9392505050565b600080604083850312156136165761361561313c565b5b600061362485828601613247565b925050602061363585828601613541565b9150509250929050565b6136488161346e565b811461365357600080fd5b50565b6000813590506136658161363f565b92915050565b6000602082840312156136815761368061313c565b5b600061368f84828501613656565b91505092915050565b600082825260208201905092915050565b7f556e61626c6520746f206465706f73697420302072657761726420746f6b656e60008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000613705602183613698565b9150613710826136a9565b604082019050919050565b60006020820190508181036000830152613734816136f8565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613775826131fc565b9150613780836131fc565b92508282019050808211156137985761379761373b565b5b92915050565b60006060820190506137b36000830186613206565b6137c06020830185613482565b6137cd6040830184613482565b949350505050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000613831602f83613698565b915061383c826137d5565b604082019050919050565b6000602082019050818103600083015261386081613824565b9050919050565b6000613872826131fc565b915061387d836131fc565b925082820261388b816131fc565b915082820484148315176138a2576138a161373b565b5b5092915050565b7f54617820726174696f2065786365656473203130252063617000000000000000600082015250565b60006138df601983613698565b91506138ea826138a9565b602082019050919050565b6000602082019050818103600083015261390e816138d2565b9050919050565b7f43616e6e6f7420776974686472617720746865207374616b696e6720746f6b6560008201527f6e00000000000000000000000000000000000000000000000000000000000000602082015250565b6000613971602183613698565b915061397c82613915565b604082019050919050565b600060208201905081810360008301526139a081613964565b9050919050565b7f43616e6e6f74207769746864726177207468652072657761726420746f6b656e600082015250565b60006139dd602083613698565b91506139e8826139a7565b602082019050919050565b60006020820190508181036000830152613a0c816139d0565b9050919050565b613a1c81613336565b82525050565b6000602082019050613a376000830184613a13565b92915050565b600081519050613a4c81613230565b92915050565b600060208284031215613a6857613a6761313c565b5b6000613a7684828501613a3d565b91505092915050565b7f4e6f7420656e6f75676820746f6b656e7320746f207769746864726177000000600082015250565b6000613ab5601d83613698565b9150613ac082613a7f565b602082019050919050565b60006020820190508181036000830152613ae481613aa8565b9050919050565b7f556e61626c6520746f2077697468647261772030206c6f73742072657761726460008201527f7320746f6b656e73000000000000000000000000000000000000000000000000602082015250565b6000613b47602883613698565b9150613b5282613aeb565b604082019050919050565b60006020820190508181036000830152613b7681613b3a565b9050919050565b6000613b88826131fc565b9150613b93836131fc565b9250828203905081811115613bab57613baa61373b565b5b92915050565b7f416d6f756e742069732067726561746572207468616e20617661696c61626c6560008201527f206c6f7374207265776172647300000000000000000000000000000000000000602082015250565b6000613c0d602d83613698565b9150613c1882613bb1565b604082019050919050565b60006020820190508181036000830152613c3c81613c00565b9050919050565b7f556e61626c6520746f20776974686472617720302070726f6772616d2074617860008201527f6573000000000000000000000000000000000000000000000000000000000000602082015250565b6000613c9f602283613698565b9150613caa82613c43565b604082019050919050565b60006020820190508181036000830152613cce81613c92565b9050919050565b7f416d6f756e742069732067726561746572207468616e20617661696c61626c6560008201527f2074617865730000000000000000000000000000000000000000000000000000602082015250565b6000613d31602683613698565b9150613d3c82613cd5565b604082019050919050565b60006020820190508181036000830152613d6081613d24565b9050919050565b7f556e61626c6520746f20776974686472617720302072657761726420746f6b6560008201527f6e73000000000000000000000000000000000000000000000000000000000000602082015250565b6000613dc3602283613698565b9150613dce82613d67565b604082019050919050565b60006020820190508181036000830152613df281613db6565b9050919050565b7f556e61626c6520746f207769746864726177206d6f7265207468616e2074686560008201527f2070726f6772616d207265776172642072656d61696e696e6700000000000000602082015250565b6000613e55603983613698565b9150613e6082613df9565b604082019050919050565b60006020820190508181036000830152613e8481613e48565b9050919050565b7f5374616b696e672070726f6772616d206e6f74206f70656e2079657400000000600082015250565b6000613ec1601c83613698565b9150613ecc82613e8b565b602082019050919050565b60006020820190508181036000830152613ef081613eb4565b9050919050565b6000613f028261346e565b9150613f0d8361346e565b9250828203905067ffffffffffffffff811115613f2d57613f2c61373b565b5b92915050565b7f4e65772070726f6772616d206465706c6574696f6e2064617465206d7573742060008201527f62652067726561746572207468616e2063757272656e742074696d6500000000602082015250565b6000613f8f603c83613698565b9150613f9a82613f33565b604082019050919050565b60006020820190508181036000830152613fbe81613f82565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000613ffb601f83613698565b915061400682613fc5565b602082019050919050565b6000602082019050818103600083015261402a81613fee565b9050919050565b60006060820190506140466000830186613a13565b6140536020830185613a13565b6140606040830184613206565b949350505050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b600061409e601083613698565b91506140a982614068565b602082019050919050565b600060208201905081810360008301526140cd81614091565b9050919050565b7f4e6f7420656e6f756768207265776172647320746f20636c61696d0000000000600082015250565b600061410a601b83613698565b9150614115826140d4565b602082019050919050565b60006020820190508181036000830152614139816140fd565b9050919050565b60006040820190506141556000830185613a13565b6141626020830184613206565b9392505050565b7f4e6f20616d6f756e7420746f2077697468647261770000000000000000000000600082015250565b600061419f601583613698565b91506141aa82614169565b602082019050919050565b600060208201905081810360008301526141ce81614192565b9050919050565b7f416d6f756e7420746f207769746864726177206973206772656174657220746860008201527f616e207374616b65640000000000000000000000000000000000000000000000602082015250565b6000614231602983613698565b915061423c826141d5565b604082019050919050565b6000602082019050818103600083015261426081614224565b9050919050565b7f556e61626c6520746f207769746864726177203020746f6b656e730000000000600082015250565b600061429d601b83613698565b91506142a882614267565b602082019050919050565b600060208201905081810360008301526142cc81614290565b9050919050565b7f5468652066696e616c207374616b656420616d6f756e7420776f756c6420626560008201527f206c657373207468616e2072657175697265642062792074686520737065636960208201527f666965642070726f6772616d0000000000000000000000000000000000000000604082015250565b6000614355604c83613698565b9150614360826142d3565b606082019050919050565b6000602082019050818103600083015261438481614348565b9050919050565b7f546865726520617265206e6f2072657761726473206465706f7369746564207960008201527f6574000000000000000000000000000000000000000000000000000000000000602082015250565b60006143e7602283613698565b91506143f28261438b565b604082019050919050565b60006020820190508181036000830152614416816143da565b9050919050565b7f5374616b696e672070726f6772616d2068617320636c6f736564000000000000600082015250565b6000614453601a83613698565b915061445e8261441d565b602082019050919050565b6000602082019050818103600083015261448281614446565b9050919050565b7f556e61626c6520746f207374616b65203020746f6b656e730000000000000000600082015250565b60006144bf601883613698565b91506144ca82614489565b602082019050919050565b600060208201905081810360008301526144ee816144b2565b9050919050565b7f5374616b696e67206c657373207468616e20726571756972656420627920746860008201527f65207370656369666965642070726f6772616d00000000000000000000000000602082015250565b6000614551603383613698565b915061455c826144f5565b604082019050919050565b6000602082019050818103600083015261458081614544565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b60006145f76017836145b6565b9150614602826145c1565b601782019050919050565b600081519050919050565b60005b8381101561463657808201518184015260208101905061461b565b60008484015250505050565b600061464d8261460d565b61465781856145b6565b9350614667818560208601614618565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b60006146a96011836145b6565b91506146b482614673565b601182019050919050565b60006146ca826145ea565b91506146d68285614642565b91506146e18261469c565b91506146ed8284614642565b91508190509392505050565b6000601f19601f8301169050919050565b60006147158261460d565b61471f8185613698565b935061472f818560208601614618565b614738816146f9565b840191505092915050565b6000602082019050818103600083015261475d818461470a565b905092915050565b6000815190506147748161352a565b92915050565b6000602082840312156147905761478f61313c565b5b600061479e84828501614765565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000614803602a83613698565b915061480e826147a7565b604082019050919050565b60006020820190508181036000830152614832816147f6565b9050919050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b600061486f601483613698565b915061487a82614839565b602082019050919050565b6000602082019050818103600083015261489e81614862565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061490e826131fc565b9150600082036149215761492061373b565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000614962602083613698565b915061496d8261492c565b602082019050919050565b6000602082019050818103600083015261499181614955565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b60006149f4602683613698565b91506149ff82614998565b604082019050919050565b60006020820190508181036000830152614a23816149e7565b9050919050565b600081519050919050565b600081905092915050565b6000614a4b82614a2a565b614a558185614a35565b9350614a65818560208601614618565b80840191505092915050565b6000614a7d8284614a40565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000614abe601d83613698565b9150614ac982614a88565b602082019050919050565b60006020820190508181036000830152614aed81614ab1565b905091905056fea2646970667358221220bc9c2003d2e09db21d5df4bc722aa9ebcdd59632b8474e96b57bf93a82ad0f8a64736f6c63430008120033
{{ "language": "Solidity", "sources": { "contracts/LatticeFixedRewardStaking.sol": { "content": "// SPDX-License-Identifier: MIT\n/**\n * @title Lattice Fixed Reward Staking Contract\n * @author Stardust Collective <[email protected]>\n *\n * Transformed idea from SushiSwap's https://github.com/sushiswap/StakingContract\n */\npragma solidity ^0.8.18;\n\nimport {SafeERC20} from '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';\nimport {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';\n\nimport {ReentrancyGuard} from '@openzeppelin/contracts/security/ReentrancyGuard.sol';\nimport {Pausable} from '@openzeppelin/contracts/security/Pausable.sol';\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\nimport {Math} from '@openzeppelin/contracts/utils/math/Math.sol';\n\ncontract LatticeFixedRewardStaking is ReentrancyGuard, Pausable, AccessControl {\n using SafeERC20 for IERC20;\n\n bytes32 public constant CONFIGURATION_ROLE =\n keccak256('CONFIGURATION_ROLE');\n bytes32 public constant STEWARD_ROLE = keccak256('STEWARD_ROLE');\n\n uint256 public constant MAGNITUDE_CONSTANT = 1e40;\n\n IERC20 public immutable stakingToken;\n uint256 public minStakingAmount;\n\n IERC20 public immutable rewardToken;\n uint256 public minRewardAmount;\n\n uint64 public immutable programStartsAt;\n uint256 public programStakedLiquidity;\n uint256 public programRewardRemaining;\n uint256 public programRewardPerLiquidity;\n uint256 public programRewardLost;\n uint256 public programRewardLostWithdrawn;\n uint64 public programRewardsDepletionAt;\n uint64 public programLastAccruedRewardsAt;\n\n uint256 public taxRatioNumerator;\n uint256 public taxRatioDenominator;\n uint256 public taxAccumulated;\n uint256 public taxAccumulatedWithdrawn;\n\n struct StakingUser {\n uint256 amountStaked;\n uint256 lastProgramRewardPerLiquidity;\n }\n\n mapping(address => StakingUser) public users;\n\n event Staked(address indexed user, uint256 amount);\n event Withdrawn(address indexed user, uint256 amount);\n event RewardsClaimed(\n address indexed user,\n uint256 rewardsTaxed,\n uint256 taxes\n );\n event StakingConditionChanged(\n uint256 remainingRewards,\n uint64 programLastAccruedRewardsAt,\n uint64 programRewardsDepletionAt\n );\n event StakingRestrictionChanged(\n uint256 minStakingAmount,\n uint256 minRewardAmount\n );\n event TaxConditionChanged(\n uint256 taxRatioNumerator,\n uint256 taxRatioDenominator\n );\n event RewardsLost(uint256 amount);\n event RecoveredERC20(address indexed token, uint256 amount);\n\n constructor(\n address _stakingToken,\n uint256 _minStakingAmount,\n address _rewardToken,\n uint256 _minRewardAmount,\n uint64 _programStartsAt,\n uint64 _programRewardsDepletionAt,\n uint256 _taxRatioNumerator,\n uint256 _taxRatioDenominator,\n address[] memory managers\n ) {\n require(\n _programStartsAt < _programRewardsDepletionAt,\n 'Invalid program timeline'\n );\n require(_stakingToken != address(0), 'Invalid staking token');\n require(_rewardToken != address(0), 'Invalid reward token');\n require(\n _taxRatioNumerator * 10 <= _taxRatioDenominator,\n 'Tax ratio exceeds 10% cap'\n );\n\n // Program Condition\n stakingToken = IERC20(_stakingToken);\n minStakingAmount = _minStakingAmount;\n rewardToken = IERC20(_rewardToken);\n minRewardAmount = _minRewardAmount;\n\n // Program Timeline\n programStartsAt = _programStartsAt;\n programRewardsDepletionAt = _programRewardsDepletionAt;\n programLastAccruedRewardsAt = _programStartsAt;\n\n // Program Taxes\n taxRatioNumerator = _taxRatioNumerator;\n taxRatioDenominator = _taxRatioDenominator;\n\n _setRoleAdmin(CONFIGURATION_ROLE, CONFIGURATION_ROLE);\n _setRoleAdmin(STEWARD_ROLE, CONFIGURATION_ROLE);\n _grantRole(CONFIGURATION_ROLE, _msgSender());\n _grantRole(STEWARD_ROLE, _msgSender());\n\n for (uint16 i = 0; i < managers.length; i++) {\n _grantRole(STEWARD_ROLE, managers[i]);\n }\n }\n\n /**\n * General Functions\n */\n\n function stake(\n uint256 _amount,\n bool _claimExistingRewards\n ) external nonReentrant whenNotPaused {\n _stake(_amount, _claimExistingRewards);\n }\n\n function withdraw(\n uint256 _amount,\n bool _claimExistingRewards,\n bool _waiveExistingRewards\n ) external nonReentrant whenNotPaused {\n _withdraw(_amount, _claimExistingRewards, _waiveExistingRewards);\n }\n\n function claimRewards() external nonReentrant whenNotPaused {\n // We generate a new rewards period to include immediately previous rewards for the user\n _accrueRewardsPeriod();\n _claimRewards(false);\n }\n\n /**\n * Calculate a new rewards period for the current time, and calculate rewards based\n * on the next program reward per liquidity.\n */\n function availableRewards(\n address user\n ) external view returns (uint256 _userRewardsTaxed, uint256 _userTaxes) {\n uint64 _programNextAccruedRewardsAt = uint64(\n Math.min(block.timestamp, programRewardsDepletionAt)\n );\n\n uint64 _rewardRemainingDuration = programRewardsDepletionAt -\n programLastAccruedRewardsAt;\n\n uint64 _rewardPeriodDuration = _programNextAccruedRewardsAt -\n programLastAccruedRewardsAt;\n\n uint256 _rewardAmountForPeriod = 0;\n\n if (_rewardRemainingDuration > 0) {\n _rewardAmountForPeriod = Math.mulDiv(\n programRewardRemaining,\n _rewardPeriodDuration,\n _rewardRemainingDuration\n );\n }\n\n uint256 _nextProgramRewardPerLiquidity = programRewardPerLiquidity;\n\n // Use actual RPL if the program has ended or staked liquidity == 0\n if (\n _programNextAccruedRewardsAt <= programRewardsDepletionAt &&\n programStakedLiquidity > 0\n ) {\n _nextProgramRewardPerLiquidity += Math.mulDiv(\n _rewardAmountForPeriod,\n MAGNITUDE_CONSTANT,\n programStakedLiquidity\n );\n }\n\n (_userRewardsTaxed, _userTaxes) = _calculateRewardsAndTaxes(\n users[user].lastProgramRewardPerLiquidity,\n users[user].amountStaked,\n _nextProgramRewardPerLiquidity,\n taxRatioNumerator,\n taxRatioDenominator\n );\n }\n\n /**\n * General Internal Functions\n */\n\n function _stake(uint256 _amount, bool _claimExistingRewards) internal {\n require(\n block.timestamp >= programStartsAt,\n 'Staking program not open yet'\n );\n require(\n programRewardRemaining > 0,\n 'There are no rewards deposited yet'\n );\n require(\n block.timestamp < programRewardsDepletionAt,\n 'Staking program has closed'\n );\n require(_amount > 0, 'Unable to stake 0 tokens');\n require(\n _amount + users[_msgSender()].amountStaked >= minStakingAmount,\n 'Staking less than required by the specified program'\n );\n\n stakingToken.safeTransferFrom(_msgSender(), address(this), _amount);\n\n // Generate a new rewards period => new program reward per liquidity\n _accrueRewardsPeriod();\n\n uint256 _userNextAmountStaked = users[_msgSender()].amountStaked +\n _amount;\n\n if (_claimExistingRewards) {\n _claimRewards(false);\n } else {\n _saveRewards(_userNextAmountStaked);\n }\n\n users[_msgSender()].amountStaked = _userNextAmountStaked;\n programStakedLiquidity += _amount;\n\n emit Staked(_msgSender(), _amount);\n }\n\n function _withdraw(\n uint256 _amount,\n bool _claimExistingRewards,\n bool _waiveExistingRewards\n ) internal {\n require(users[_msgSender()].amountStaked != 0, 'No amount to withdraw');\n require(\n users[_msgSender()].amountStaked >= _amount,\n 'Amount to withdraw is greater than staked'\n );\n require(_amount > 0, 'Unable to withdraw 0 tokens');\n require(\n users[_msgSender()].amountStaked == _amount ||\n users[_msgSender()].amountStaked - _amount >= minStakingAmount,\n 'The final staked amount would be less than required by the specified program'\n );\n\n // Generate a new rewards period => new program reward per liquidity\n _accrueRewardsPeriod();\n\n uint256 _userNextAmountStaked = users[_msgSender()].amountStaked -\n _amount;\n\n if (_claimExistingRewards || _userNextAmountStaked == 0) {\n _claimRewards(_waiveExistingRewards);\n } else {\n _saveRewards(_userNextAmountStaked);\n }\n\n users[_msgSender()].amountStaked = _userNextAmountStaked;\n programStakedLiquidity -= _amount;\n\n stakingToken.safeTransfer(_msgSender(), _amount);\n\n emit Withdrawn(_msgSender(), _amount);\n }\n\n function _claimRewards(bool _waiveExistingRewards) internal {\n (\n uint256 _userRewardsTaxed,\n uint256 _userTaxes\n ) = _calculateRewardsAndTaxes(\n users[_msgSender()].lastProgramRewardPerLiquidity,\n users[_msgSender()].amountStaked,\n programRewardPerLiquidity,\n taxRatioNumerator,\n taxRatioDenominator\n );\n\n require(\n _userRewardsTaxed >= minRewardAmount || _waiveExistingRewards,\n 'Not enough rewards to claim'\n );\n\n users[_msgSender()]\n .lastProgramRewardPerLiquidity = programRewardPerLiquidity;\n\n if (_waiveExistingRewards) {\n programRewardLost += _userRewardsTaxed + _userTaxes;\n emit RewardsLost(_userRewardsTaxed + _userTaxes);\n } else {\n taxAccumulated += _userTaxes;\n rewardToken.safeTransfer(_msgSender(), _userRewardsTaxed);\n emit RewardsClaimed(_msgSender(), _userRewardsTaxed, _userTaxes);\n }\n }\n\n /**\n * We derive a new [user].lastProgramRewardPerLiquidity based on the new amount\n * staked and considering previous rewards. The in the next call to _calculateRewardsAndTaxes()\n * user will receive both previous-non-claimed rewards and new rewards.\n */\n function _saveRewards(uint256 _nextAmountStaked) internal {\n (\n uint256 _userRewardsTaxed,\n uint256 _userTaxes\n ) = _calculateRewardsAndTaxes(\n users[_msgSender()].lastProgramRewardPerLiquidity,\n users[_msgSender()].amountStaked,\n programRewardPerLiquidity,\n taxRatioNumerator,\n taxRatioDenominator\n );\n\n uint256 _userRewards = _userRewardsTaxed + _userTaxes;\n\n uint256 _userProgramRewardPerLiquidityDelta = Math.mulDiv(\n _userRewards,\n MAGNITUDE_CONSTANT,\n _nextAmountStaked\n );\n\n users[_msgSender()].lastProgramRewardPerLiquidity =\n programRewardPerLiquidity -\n _userProgramRewardPerLiquidityDelta;\n }\n\n /**\n * Generate a new rewards period, discard unused/reserved reward amount for the generated period\n * add reward per liquidity for the generated period in order to claim/calculate rewards.\n */\n function _accrueRewardsPeriod() internal {\n uint64 _programNextAccruedRewardsAt = uint64(\n Math.min(block.timestamp, programRewardsDepletionAt)\n );\n\n uint64 _rewardRemainingDuration = programRewardsDepletionAt -\n programLastAccruedRewardsAt;\n\n // Don't accrue if the remaining duration is 0 (program has ended)\n if (_rewardRemainingDuration == 0) {\n return;\n }\n\n uint64 _rewardPeriodDuration = _programNextAccruedRewardsAt -\n programLastAccruedRewardsAt;\n\n uint256 _rewardAmountForPeriod = Math.mulDiv(\n programRewardRemaining,\n _rewardPeriodDuration,\n _rewardRemainingDuration\n );\n\n uint256 _programRewardPerLiquidityChange = 0;\n\n if (programStakedLiquidity > 0) {\n _programRewardPerLiquidityChange = Math.mulDiv(\n _rewardAmountForPeriod,\n MAGNITUDE_CONSTANT,\n programStakedLiquidity\n );\n programRewardPerLiquidity += _programRewardPerLiquidityChange;\n } else {\n programRewardLost += _rewardAmountForPeriod;\n emit RewardsLost(_rewardAmountForPeriod);\n }\n\n programRewardRemaining -= _rewardAmountForPeriod;\n\n programLastAccruedRewardsAt = _programNextAccruedRewardsAt;\n }\n\n function _calculateRewardsAndTaxes(\n uint256 _userLastProgramRewardPerLiquidity,\n uint256 _userAmountStaked,\n uint256 _programRewardPerLiquidity,\n uint256 _taxRatioNumerator,\n uint256 _taxRatioDenominator\n ) internal pure returns (uint256 _userRewardsTaxed, uint256 _userTaxes) {\n uint256 _userProgramRewardPerLiquidityDelta = _programRewardPerLiquidity -\n _userLastProgramRewardPerLiquidity;\n\n uint256 _userRewards = Math.mulDiv(\n _userProgramRewardPerLiquidityDelta,\n _userAmountStaked,\n MAGNITUDE_CONSTANT\n );\n\n _userTaxes = Math.mulDiv(\n _userRewards,\n _taxRatioNumerator,\n _taxRatioDenominator\n );\n\n _userRewardsTaxed = _userRewards - _userTaxes;\n }\n\n /**\n * Admin Functions\n */\n\n function accrueRewardsPeriod() external onlyRole(STEWARD_ROLE) {\n require(\n block.timestamp >= programStartsAt,\n 'Staking program not open yet'\n );\n _accrueRewardsPeriod();\n }\n\n function depositProgramRewards(\n uint256 _amount\n ) external nonReentrant onlyRole(STEWARD_ROLE) {\n require(_amount > 0, 'Unable to deposit 0 reward tokens');\n rewardToken.safeTransferFrom(_msgSender(), address(this), _amount);\n programRewardRemaining += _amount;\n emit StakingConditionChanged(\n programRewardRemaining,\n programLastAccruedRewardsAt,\n programRewardsDepletionAt\n );\n }\n\n function withdrawProgramRewards(\n uint256 _amount\n ) external nonReentrant onlyRole(STEWARD_ROLE) {\n require(_amount > 0, 'Unable to withdraw 0 reward tokens');\n require(\n _amount <= programRewardRemaining,\n 'Unable to withdraw more than the program reward remaining'\n );\n programRewardRemaining -= _amount;\n rewardToken.safeTransfer(_msgSender(), _amount);\n emit StakingConditionChanged(\n programRewardRemaining,\n programLastAccruedRewardsAt,\n programRewardsDepletionAt\n );\n }\n\n function withdrawProgramLostRewards(\n uint256 _amount\n ) external nonReentrant onlyRole(STEWARD_ROLE) {\n require(_amount > 0, 'Unable to withdraw 0 lost rewards tokens');\n uint256 _lostRewardsAvailable = programRewardLost -\n programRewardLostWithdrawn;\n require(\n _amount <= _lostRewardsAvailable,\n 'Amount is greater than available lost rewards'\n );\n programRewardLostWithdrawn += _amount;\n rewardToken.safeTransfer(_msgSender(), _amount);\n }\n\n function withdrawProgramTaxes(\n uint256 _amount\n ) external nonReentrant onlyRole(CONFIGURATION_ROLE) {\n require(_amount > 0, 'Unable to withdraw 0 program taxes');\n uint256 _taxesAvailable = taxAccumulated - taxAccumulatedWithdrawn;\n require(\n _amount <= _taxesAvailable,\n 'Amount is greater than available taxes'\n );\n taxAccumulatedWithdrawn += _amount;\n rewardToken.safeTransfer(_msgSender(), _amount);\n }\n\n function updateProgramDepletionDate(\n uint64 _programRewardsDepletionAt\n ) external onlyRole(STEWARD_ROLE) {\n require(\n _programRewardsDepletionAt > block.timestamp,\n 'New program depletion date must be greater than current time'\n );\n programRewardsDepletionAt = _programRewardsDepletionAt;\n emit StakingConditionChanged(\n programRewardRemaining,\n programLastAccruedRewardsAt,\n programRewardsDepletionAt\n );\n }\n\n function updateProgramRestriction(\n uint256 _minStakingAmount,\n uint256 _minRewardAmount\n ) external onlyRole(STEWARD_ROLE) {\n minStakingAmount = _minStakingAmount;\n minRewardAmount = _minRewardAmount;\n emit StakingRestrictionChanged(minStakingAmount, minRewardAmount);\n }\n\n function updateProgramTax(\n uint256 _taxRatioNumerator,\n uint256 _taxRatioDenominator\n ) external onlyRole(CONFIGURATION_ROLE) {\n require(\n _taxRatioNumerator * 10 <= _taxRatioDenominator,\n 'Tax ratio exceeds 10% cap'\n );\n taxRatioNumerator = _taxRatioNumerator;\n taxRatioDenominator = _taxRatioDenominator;\n emit TaxConditionChanged(taxRatioNumerator, taxRatioDenominator);\n }\n\n function recoverERC20(\n IERC20 token,\n uint256 amount\n ) external nonReentrant onlyRole(STEWARD_ROLE) {\n require(\n address(token) != address(stakingToken),\n 'Cannot withdraw the staking token'\n );\n require(\n address(token) != address(rewardToken),\n 'Cannot withdraw the reward token'\n );\n\n uint256 tokenBalance = token.balanceOf(address(this));\n require(tokenBalance >= amount, 'Not enough tokens to withdraw');\n\n token.safeTransfer(_msgSender(), amount);\n\n emit RecoveredERC20(address(token), amount);\n }\n\n function pause() external onlyRole(STEWARD_ROLE) {\n _pause();\n }\n\n function unpause() external onlyRole(STEWARD_ROLE) {\n _unpause();\n }\n}\n" }, "@openzeppelin/contracts/access/AccessControl.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.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 * ```\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 * ```\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.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\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(IAccessControl).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 Strings.toHexString(account),\n \" is missing role \",\n Strings.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" }, "@openzeppelin/contracts/access/IAccessControl.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 IAccessControl {\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" }, "@openzeppelin/contracts/security/Pausable.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (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 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 _requireNotPaused();\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 _requirePaused();\n _;\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 Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\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/security/ReentrancyGuard.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.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" }, "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-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 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 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.6.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(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" }, "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../extensions/draft-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 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 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 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 (last updated v4.8.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 *\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://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 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(\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 (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/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/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/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/utils/math/Math.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.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 Math {\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(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) 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 return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. 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 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(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) 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 10, 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 * 8) < value ? 1 : 0);\n }\n }\n}\n" }, "@openzeppelin/contracts/utils/Strings.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\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 = Math.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 `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.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" } }, "settings": { "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } } }}
1
20,291,089
a160cb10892b1c795d28f2954c69f1f138ddf1891c031742f274c80646035c1a
aa42ee11e3d5d32f19458214afe94113c1bcb5bd28ce7e748a81c5c19bd05070
266cb413a3b227b87ad146718d2c89c633a5dbb9
777777c338d93e2c7adf08d102d45ca7cc4ed021
afbb64cba4e0c951ecefcffe5afa7e7ecbad691f
60406080815234610222576103f290813803918261001c81610227565b938492833960209384918101031261022257516001600160a01b03811692838203610222578251916001600160401b03908284018281118582101761020c57808652600096878652823b156101b2577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b031916821790557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8880a28451158015906101ab575b6100dd575b855160d190816103218239f35b8551946060860186811085821117610197578752602786527f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c85870152660819985a5b195960ca1b86880152518791829190845af4913d15610186573d90811161017257610166959661015885601f19601f85011601610227565b91825281943d92013e61024c565b508038808080806100d0565b634e487b7160e01b87526041600452602487fd5b50915061016693945060609161024c565b634e487b7160e01b89526041600452602489fd5b50866100cb565b865162461bcd60e51b815260048101869052602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b6040519190601f01601f191682016001600160401b0381118382101761020c57604052565b919290156102ae5750815115610260575090565b3b156102695790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156102c15750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610307575050604492506000838284010152601f80199101168101030190fd5b84810182015186860160440152938101938593506102e456fe608060405236156054577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54600090819081906001600160a01b0316368280378136915af43d82803e156050573d90f35b3d90fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54600090819081906001600160a01b0316368280378136915af43d82803e156050573d90f3fea2646970667358221220d7ecf0f892b2bed76a5d05c6a34519f038f3782dbc124a10ad6a33c8a565e3a164736f6c634300081100330000000000000000000000007d42ee84d377d37cfc9ebf10c3aee56da326642d
608060405236156054577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54600090819081906001600160a01b0316368280378136915af43d82803e156050573d90f35b3d90fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54600090819081906001600160a01b0316368280378136915af43d82803e156050573d90f3fea2646970667358221220d7ecf0f892b2bed76a5d05c6a34519f038f3782dbc124a10ad6a33c8a565e3a164736f6c63430008110033
1
20,291,090
ee9d1ce5fb7c11e088be31d5e4e77889cf9dc42614e30004923149d017914a70
63fdfed914fc2012b8ede5d09b21a3e394eaedf85c25ef07d4e70e21ed6cc939
00bdb5699745f5b860228c8f939abf1b9ae374ed
ffa397285ce46fb78c588a9e993286aac68c37cd
52e4982e6d248d69df4bd634f1c1374a0cbea5c2
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,291,093
87ec74613c2262fe94f7a3a226cb7467a9bff17c0e8dc2ada71d2011e86caf58
115e8cfae0333e0f3ea7bf3516e95c5f63c73f66478a2816d8ba26ee2d070e5d
100a63e88ec200287346ae8b86ce53058fe88079
76f948e5f13b9a84a81e5681df8682bbf524805e
add6379e987a792853a719ae09e6be136aab8be7
3d602d80600a3d3981f3363d3d373d3d3d363d73e5c5a6a65bb1ad55315ca527de3ee2c04fc2421a5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d73e5c5a6a65bb1ad55315ca527de3ee2c04fc2421a5af43d82803e903d91602b57fd5bf3
{{ "language": "Solidity", "sources": { "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/external-deps/openzeppelin/finance/PaymentSplitterUpgradeable.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (finance/PaymentSplitter.sol)\n\npragma solidity ^0.8.11;\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\n/**\n * Changelog:\n * - Change state variable visibility to internal:\n * - `_totalReleased`, `_released`, `_erc20TotalReleased`, `_erc20Released`, `_pendingPayment`\n *\n * - Add `payeeCount`: returns the length of `_payees`\n * - Add `releasable` functions as per recent updates in OZ PaymentSplitterUpgradeable (v4.7.0)\n */\n\n/**\n * @title PaymentSplitter\n * @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware\n * that the Ether will be split in this way, since it is handled transparently by the contract.\n *\n * The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each\n * account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim\n * an amount proportional to the percentage of total shares they were assigned.\n *\n * `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the\n * accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release}\n * function.\n *\n * NOTE: This contract assumes that ERC20 tokens will behave similarly to native tokens (Ether). Rebasing tokens, and\n * tokens that apply fees during transfers, are likely to not be supported as expected. If in doubt, we encourage you\n * to run tests before sending real value to this contract.\n */\ncontract PaymentSplitterUpgradeable is Initializable, ContextUpgradeable {\n event PayeeAdded(address account, uint256 shares);\n event PaymentReleased(address to, uint256 amount);\n event ERC20PaymentReleased(IERC20Upgradeable indexed token, address to, uint256 amount);\n event PaymentReceived(address from, uint256 amount);\n\n uint256 private _totalShares;\n uint256 internal _totalReleased;\n\n mapping(address => uint256) internal _shares;\n mapping(address => uint256) internal _released;\n address[] private _payees;\n\n mapping(IERC20Upgradeable => uint256) internal _erc20TotalReleased;\n mapping(IERC20Upgradeable => mapping(address => uint256)) internal _erc20Released;\n\n /**\n * @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at\n * the matching position in the `shares` array.\n *\n * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no\n * duplicates in `payees`.\n */\n function __PaymentSplitter_init(address[] memory payees, uint256[] memory shares_) internal onlyInitializing {\n __Context_init_unchained();\n __PaymentSplitter_init_unchained(payees, shares_);\n }\n\n function __PaymentSplitter_init_unchained(\n address[] memory payees,\n uint256[] memory shares_\n ) internal onlyInitializing {\n require(payees.length == shares_.length, \"PaymentSplitter: payees and shares length mismatch\");\n require(payees.length > 0, \"PaymentSplitter: no payees\");\n\n for (uint256 i = 0; i < payees.length; i++) {\n _addPayee(payees[i], shares_[i]);\n }\n }\n\n /**\n * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully\n * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the\n * reliability of the events, and not the actual splitting of Ether.\n *\n * To learn more about this see the Solidity documentation for\n * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback\n * functions].\n */\n receive() external payable virtual {\n emit PaymentReceived(_msgSender(), msg.value);\n }\n\n /**\n * @dev Getter for the total shares held by payees.\n */\n function totalShares() public view returns (uint256) {\n return _totalShares;\n }\n\n /**\n * @dev Getter for the total amount of Ether already released.\n */\n function totalReleased() public view returns (uint256) {\n return _totalReleased;\n }\n\n /**\n * @dev Getter for the total amount of `token` already released. `token` should be the address of an IERC20\n * contract.\n */\n function totalReleased(IERC20Upgradeable token) public view returns (uint256) {\n return _erc20TotalReleased[token];\n }\n\n /**\n * @dev Getter for the amount of shares held by an account.\n */\n function shares(address account) public view returns (uint256) {\n return _shares[account];\n }\n\n /**\n * @dev Getter for the amount of Ether already released to a payee.\n */\n function released(address account) public view returns (uint256) {\n return _released[account];\n }\n\n /**\n * @dev Getter for the amount of `token` tokens already released to a payee. `token` should be the address of an\n * IERC20 contract.\n */\n function released(IERC20Upgradeable token, address account) public view returns (uint256) {\n return _erc20Released[token][account];\n }\n\n /**\n * @dev Getter for the address of the payee number `index`.\n */\n function payee(uint256 index) public view returns (address) {\n return _payees[index];\n }\n\n /**\n * @dev Get the number of payees\n */\n function payeeCount() public view returns (uint256) {\n return _payees.length;\n }\n\n /**\n * @dev Getter for the amount of payee's releasable Ether.\n */\n function releasable(address account) public view returns (uint256) {\n uint256 totalReceived = address(this).balance + totalReleased();\n return _pendingPayment(account, totalReceived, released(account));\n }\n\n /**\n * @dev Getter for the amount of payee's releasable `token` tokens. `token` should be the address of an\n * IERC20 contract.\n */\n function releasable(IERC20Upgradeable token, address account) public view returns (uint256) {\n uint256 totalReceived = token.balanceOf(address(this)) + totalReleased(token);\n return _pendingPayment(account, totalReceived, released(token, account));\n }\n\n /**\n * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the\n * total shares and their previous withdrawals.\n */\n function release(address payable account) public virtual {\n require(_shares[account] > 0, \"PaymentSplitter: account has no shares\");\n\n uint256 payment = releasable(account);\n\n require(payment != 0, \"PaymentSplitter: account is not due payment\");\n\n _released[account] += payment;\n _totalReleased += payment;\n\n AddressUpgradeable.sendValue(account, payment);\n emit PaymentReleased(account, payment);\n }\n\n /**\n * @dev Triggers a transfer to `account` of the amount of `token` tokens they are owed, according to their\n * percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20\n * contract.\n */\n function release(IERC20Upgradeable token, address account) public virtual {\n require(_shares[account] > 0, \"PaymentSplitter: account has no shares\");\n\n uint256 payment = releasable(token, account);\n\n require(payment != 0, \"PaymentSplitter: account is not due payment\");\n\n _erc20Released[token][account] += payment;\n _erc20TotalReleased[token] += payment;\n\n SafeERC20Upgradeable.safeTransfer(token, account, payment);\n emit ERC20PaymentReleased(token, account, payment);\n }\n\n /**\n * @dev internal logic for computing the pending payment of an `account` given the token historical balances and\n * already released amounts.\n */\n function _pendingPayment(\n address account,\n uint256 totalReceived,\n uint256 alreadyReleased\n ) internal view returns (uint256) {\n return (totalReceived * _shares[account]) / _totalShares - alreadyReleased;\n }\n\n /**\n * @dev Add a new payee to the contract.\n * @param account The address of the payee to add.\n * @param shares_ The number of shares owned by the payee.\n */\n function _addPayee(address account, uint256 shares_) private {\n require(account != address(0), \"PaymentSplitter: account is the zero address\");\n require(shares_ > 0, \"PaymentSplitter: shares are 0\");\n require(_shares[account] == 0, \"PaymentSplitter: account already has shares\");\n\n _payees.push(account);\n _shares[account] = shares_;\n _totalShares = _totalShares + shares_;\n emit PayeeAdded(account, shares_);\n }\n\n uint256[43] private __gap;\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/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/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/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/split/Split.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// Base\nimport \"../../external-deps/openzeppelin/finance/PaymentSplitterUpgradeable.sol\";\nimport \"../../infra/interface/IThirdwebContract.sol\";\n\n// Meta-tx\nimport \"../../external-deps/openzeppelin/metatx/ERC2771ContextUpgradeable.sol\";\n\n// Access\nimport \"@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol\";\n\n// Utils\nimport \"../../extension/Multicall.sol\";\nimport \"../../lib/FeeType.sol\";\n\ncontract Split is\n IThirdwebContract,\n Initializable,\n Multicall,\n ERC2771ContextUpgradeable,\n AccessControlEnumerableUpgradeable,\n PaymentSplitterUpgradeable\n{\n bytes32 private constant MODULE_TYPE = bytes32(\"Split\");\n uint128 private constant VERSION = 1;\n\n /// @dev Max bps in the thirdweb system\n uint128 private constant MAX_BPS = 10_000;\n\n /// @dev Contract level metadata.\n string public contractURI;\n\n constructor() initializer {}\n\n /// @dev Performs the job of the constructor.\n /// @dev shares_ are scaled by 10,000 to prevent precision loss when including fees\n function initialize(\n address _defaultAdmin,\n string memory _contractURI,\n address[] memory _trustedForwarders,\n address[] memory _payees,\n uint256[] memory _shares\n ) external initializer {\n // Initialize inherited contracts: most base -> most derived\n __ERC2771Context_init(_trustedForwarders);\n __PaymentSplitter_init(_payees, _shares);\n\n contractURI = _contractURI;\n _setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin);\n }\n\n /// @dev Returns the module type of the contract.\n function contractType() external pure returns (bytes32) {\n return MODULE_TYPE;\n }\n\n /// @dev Returns the version of the contract.\n function contractVersion() external pure returns (uint8) {\n return uint8(VERSION);\n }\n\n /**\n * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the\n * total shares and their previous withdrawals.\n */\n function release(address payable account) public virtual override {\n uint256 payment = _release(account);\n require(payment != 0, \"PaymentSplitter: account is not due payment\");\n }\n\n /**\n * @dev Triggers a transfer to `account` of the amount of `token` tokens they are owed, according to their\n * percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20\n * contract.\n */\n function release(IERC20Upgradeable token, address account) public virtual override {\n uint256 payment = _release(token, account);\n require(payment != 0, \"PaymentSplitter: account is not due payment\");\n }\n\n /// @dev Returns the amount of Ether that `account` is owed, according to their percentage of the total shares and returns the payment\n function _release(address payable account) internal returns (uint256) {\n require(shares(account) > 0, \"PaymentSplitter: account has no shares\");\n\n uint256 totalReceived = address(this).balance + totalReleased();\n uint256 payment = _pendingPayment(account, totalReceived, released(account));\n\n if (payment == 0) {\n return 0;\n }\n\n _released[account] += payment;\n _totalReleased += payment;\n\n AddressUpgradeable.sendValue(account, payment);\n emit PaymentReleased(account, payment);\n\n return payment;\n }\n\n /// @dev Returns the amount of `token` that `account` is owed, according to their percentage of the total shares and returns the payment\n function _release(IERC20Upgradeable token, address account) internal returns (uint256) {\n require(shares(account) > 0, \"PaymentSplitter: account has no shares\");\n\n uint256 totalReceived = token.balanceOf(address(this)) + totalReleased(token);\n uint256 payment = _pendingPayment(account, totalReceived, released(token, account));\n\n if (payment == 0) {\n return 0;\n }\n\n _erc20Released[token][account] += payment;\n _erc20TotalReleased[token] += payment;\n\n SafeERC20Upgradeable.safeTransfer(token, account, payment);\n emit ERC20PaymentReleased(token, account, payment);\n\n return payment;\n }\n\n /**\n * @dev Release the owed amount of token to all of the payees.\n */\n function distribute() public virtual {\n uint256 count = payeeCount();\n for (uint256 i = 0; i < count; i++) {\n _release(payable(payee(i)));\n }\n }\n\n /**\n * @dev Release owed amount of the `token` to all of the payees.\n */\n function distribute(IERC20Upgradeable token) public virtual {\n uint256 count = payeeCount();\n for (uint256 i = 0; i < count; i++) {\n _release(token, payee(i));\n }\n }\n\n /// @dev See ERC2771\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 /// @dev See ERC2771\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 /// @dev Sets contract URI for the contract-level metadata of the contract.\n function setContractURI(string calldata _uri) external onlyRole(DEFAULT_ADMIN_ROLE) {\n contractURI = _uri;\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/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/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/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/token/ERC20/utils/SafeERC20Upgradeable.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 \"../IERC20Upgradeable.sol\";\nimport \"../extensions/IERC20PermitUpgradeable.sol\";\nimport \"../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {\n using AddressUpgradeable 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(IERC20Upgradeable 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(IERC20Upgradeable 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(IERC20Upgradeable 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(IERC20Upgradeable 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(IERC20Upgradeable 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(IERC20Upgradeable 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 IERC20PermitUpgradeable 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(IERC20Upgradeable 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(IERC20Upgradeable 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))) && AddressUpgradeable.isContract(address(token));\n }\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/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/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/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" } }, "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,291,096
8f1316efb6bdc757ef0b64479350352fd46220f27f96354a30529645324b8560
ea7950076d58fab5b76721fd22d9ffdc7123aa08c90ffc12e326820ba0bbb184
4e565f63257d90f988e5ec9d065bab00f94d2dfd
9fa5c5733b53814692de4fb31fd592070de5f5f0
b9aca30980efe878739184d03a3a4515a8328859
608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe
1
20,291,097
8e1242a22239341afea85a0019308cd1ff4bb1d92fefedc65747a520dacd2a01
fdc6f8715a95cb4bb2c5fe80d3da055206ba2cb5ed91743efdb06a389b43ce26
9980fedf494f722887dd5d7eaee55efe354789c6
9980fedf494f722887dd5d7eaee55efe354789c6
befe5fa80b6e2daaaefc82e930b18fb3245a634b
60a06040523060805234801561001457600080fd5b506080516140ba61004c60003960008181610b9d01528181610bdd015281816111b0015281816111f0015261142c01526140ba6000f3fe6080604052600436106102185760003560e01c806301ffc9a71461021d578063081812fc14610252578063083118d51461027f57806312064c34146102a157806314d140b0146102dc57806318160ddd146102fd5780631b13ee8a14610312578063248a9ca3146103325780632f2ff15d14610352578063318cd6731461037457806336568abe146103875780633659cfe6146103a757806338d322ef146103c75780633eb76b9c146103e7578063410a1db11461040757806349dcc204146104275780634f1ef286146104625780635142d5e31461047557806352d1902d1461049557806352e62a43146104aa578063544ffc9c146104ca5780635bbb21771461053f5780635c975abb1461056c5780636352211e146105845780636927850a146105a4578063696c81bb146105ba5780636d1daa28146105da5780636dc0ae22146105fa57806370a082311461061a57806375b238fc1461063a5780637a26db171461065c5780637f66dea11461069257806382d837a1146106b35780638462151c146106d357806391d1485414610700578063926d7d7f1461072057806399a2557a14610742578063a217fddf14610762578063b09de27814610777578063b6699d0e1461078a578063c23dc68f146107aa578063c4ae3168146107d7578063c8506277146107ec578063c87b56dd1461084f578063d547741f1461086f578063db7817f91461088f578063e985e9c5146108af575b600080fd5b34801561022957600080fd5b5061023d61023836600461325f565b6108cf565b60405190151581526020015b60405180910390f35b34801561025e57600080fd5b5061027261026d366004613289565b610906565b60405161024991906132a2565b34801561028b57600080fd5b50610294610976565b6040516102499190613306565b3480156102ad57600080fd5b506102ce6102bc36600461332e565b60066020526000908152604090205481565b604051908152602001610249565b3480156102e857600080fd5b5061013654610272906001600160a01b031681565b34801561030957600080fd5b506102ce610a05565b34801561031e57600080fd5b506102ce61032d36600461334b565b610a79565b34801561033e57600080fd5b506102ce61034d366004613289565b610aa2565b34801561035e57600080fd5b5061037261036d366004613377565b610ab7565b005b6103726103823660046133b9565b610ad8565b34801561039357600080fd5b506103726103a2366004613377565b610b10565b3480156103b357600080fd5b506103726103c236600461332e565b610b93565b3480156103d357600080fd5b506103726103e236600461334b565b610c5b565b3480156103f357600080fd5b50610372610402366004613289565b610d28565b34801561041357600080fd5b5061037261042236600461332e565b611089565b34801561043357600080fd5b506104476104423660046133e5565b611120565b60408051825181526020928301519281019290925201610249565b61037261047036600461349c565b6111a6565b34801561048157600080fd5b5061037261049036600461352e565b61125b565b3480156104a157600080fd5b506102ce61141f565b3480156104b657600080fd5b506103726104c536600461358a565b6114cd565b3480156104d657600080fd5b506105156104e5366004613289565b600260205260009081526040902080546001909101546001600160801b0380831692600160801b90048116911683565b604080516001600160801b0394851681529284166020840152921691810191909152606001610249565b34801561054b57600080fd5b5061055f61055a3660046135d8565b61174a565b60405161024991906136a4565b34801561057857600080fd5b50603a5460ff1661023d565b34801561059057600080fd5b5061027261059f366004613289565b6117c1565b3480156105b057600080fd5b506102ce60075481565b3480156105c657600080fd5b506103726105d53660046136f2565b6117f4565b3480156105e657600080fd5b506103726105f536600461370d565b61185d565b34801561060657600080fd5b50600354610272906001600160a01b031681565b34801561062657600080fd5b506102ce61063536600461332e565b6118b9565b34801561064657600080fd5b506102ce60008051602061406583398151915281565b34801561066857600080fd5b506101365461067f90600160a01b900461ffff1681565b60405161ffff9091168152602001610249565b34801561069e57600080fd5b5061013454610272906001600160a01b031681565b3480156106bf57600080fd5b506102ce6106ce366004613289565b61192c565b3480156106df57600080fd5b506106f36106ee36600461332e565b61195f565b6040516102499190613729565b34801561070c57600080fd5b5061023d61071b366004613377565b6119d6565b34801561072c57600080fd5b506102ce600080516020613fb283398151915281565b34801561074e57600080fd5b506106f361075d366004613761565b611a01565b34801561076e57600080fd5b506102ce600081565b610372610785366004613796565b611a8b565b34801561079657600080fd5b506102ce6107a5366004613289565b611bcb565b3480156107b657600080fd5b506107ca6107c5366004613289565b611bfe565b6040516102499190613819565b3480156107e357600080fd5b50610372611c8c565b3480156107f857600080fd5b5061080c610807366004613289565b611cbf565b604051610249919081516001600160801b039081168252602080840151821690830152604080840151821690830152606092830151169181019190915260800190565b34801561085b57600080fd5b5061029461086a366004613289565b611db2565b34801561087b57600080fd5b5061037261088a366004613377565b611e25565b34801561089b57600080fd5b506102ce6108aa366004613289565b611e41565b3480156108bb57600080fd5b5061023d6108ca366004613827565b611e4e565b60006001600160e01b03198216637965db0b60e01b148061090057506301ffc9a760e01b6001600160e01b03198316145b92915050565b6101355460405163020604bf60e21b8152600481018390526000916001600160a01b03169063081812fc906024015b602060405180830381865afa158015610952573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109009190613855565b610137805461098490613872565b80601f01602080910402602001604051908101604052809291908181526020018280546109b090613872565b80156109fd5780601f106109d2576101008083540402835291602001916109fd565b820191906000526020600020905b8154815290600101906020018083116109e057829003601f168201915b505050505081565b61013554604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015610a50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7491906138a6565b905090565b6001600160a01b0382166000908152600460205260408120610a9b9083611ec6565b9392505050565b6000908152609e602052604090206001015490565b610ac082610aa2565b610ac981611fe1565b610ad38383611feb565b505050565b610ae0612071565b6000610aeb836120b9565b9050600080610af98561217b565b91509150610b0983838387612339565b5050505050565b6001600160a01b0381163314610b855760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610b8f828261264c565b5050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610bdb5760405162461bcd60e51b8152600401610b7c906138bf565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610c0d6126b3565b6001600160a01b031614610c335760405162461bcd60e51b8152600401610b7c906138f9565b610c3c816126cf565b60408051600080825260208201909252610c58918391906126e7565b50565b600080516020614065833981519152610c7381611fe1565b6101345460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb90610ca69086908690600401613933565b6020604051808303816000875af1158015610cc5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce9919061395c565b507f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d58383604051610d1b929190613933565b60405180910390a1505050565b6000818152600260205260408120600181015481549192916001600160801b0391821691610d629180821691600160801b9091041661398d565b610d6c919061398d565b6001600160801b031611610db75760405162461bcd60e51b81526020600482015260126024820152711b9bc81d9bdd195cc8195e1c1c995cdcd95960721b6044820152606401610b7c565b600354604051632d63f69360e01b8152600481018490526000916001600160a01b031690632d63f69390602401602060405180830381865afa158015610e01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2591906138a6565b90506000610e3282611e41565b90506000600360009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610e8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eaf9190613855565b6001600160a01b0316633a46b1a830856040518363ffffffff1660e01b8152600401610edc929190613933565b602060405180830381865afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d91906138a6565b8454909150600090610f54908490610f4590600160801b90046001600160801b0316856139b4565b610f4f91906139e1565b612852565b8554909150600090610f75908590610f45906001600160801b0316866139b4565b6001870154909150600090610f99908690610f45906001600160801b0316876139b4565b600089815260026020818152604080842084815560010180546001600160801b03199081169091558151608089811b83169482019490945289841b821660308201529286901b16908201529293509160500160408051601f198184030181529190526003549091506001600160a01b0316635f398a148b846110196128bf565b856040518563ffffffff1660e01b81526004016110399493929190613a03565b6020604051808303816000875af1158015611058573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107c91906138a6565b5050505050505050505050565b6000805160206140658339815191526110a181611fe1565b6001600160a01b0382166110c85760405163d92e233d60e01b815260040160405180910390fd5b61013680546001600160a01b0319166001600160a01b0384161790556040517f1defc7e59eeac6c8cb243873ba35cd0ac8c57fe81e330b6ab84c23c63c1f007d906111149084906132a2565b60405180910390a15050565b60408051808201825260008082526020820152610135549151631277308160e21b8152600481018590526024810184905290916001600160a01b0316906349dcc204906044016040805180830381865afa158015611182573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b9190613a37565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036111ee5760405162461bcd60e51b8152600401610b7c906138bf565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166112206126b3565b6001600160a01b0316146112465760405162461bcd60e51b8152600401610b7c906138f9565b61124f826126cf565b610b8f828260016126e7565b600054610100900460ff161580801561127b5750600054600160ff909116105b8061129c575061128a306128df565b15801561129c575060005460ff166001145b6112ff5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610b7c565b6000805460ff191660011790558015611322576000805461ff0019166101001790555b61133f7312163980a1ec6f5c955a19793914192d01c872686128ee565b61013580546001600160a01b0319166001600160a01b0387161790556113696001621e8480612926565b610136805461ffff60a01b191660af60a01b179055611389600085611feb565b6113a160008051602061406583398151915285611feb565b61013680546001600160a01b038086166001600160a01b0319928316179092556101348054928516929091169190911790558015610b09576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114ba5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608401610b7c565b50600080516020613ff283398151915290565b600354604051632d63f69360e01b8152600481018490526000916115419133916001600160a01b031690632d63f69390602401602060405180830381865afa15801561151d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032d91906138a6565b90506000811161157f5760405162461bcd60e51b81526020600482015260096024820152681b9bc81dd95a59da1d60ba1b6044820152606401610b7c565b600083815260016020908152604080832033845290915290205460ff16156115d95760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e481d9bdd1959609a1b6044820152606401610b7c565b6000838152600160208181526040808420338552909152909120805460ff1916909117905560ff821661165f5761160f81612852565b600084815260026020526040812080549091906116369084906001600160801b031661398d565b92506101000a8154816001600160801b0302191690836001600160801b03160217905550505050565b60001960ff8316016116a25761167481612852565b60008481526002602052604090208054601090611636908490600160801b90046001600160801b031661398d565b60011960ff8316016116e1576116b781612852565b600084815260026020526040812060010180549091906116369084906001600160801b031661398d565b60405162461bcd60e51b815260206004820152603860248201527f696e76616c696420737570706f72742076616c75652c206d75737420626520696044820152776e636c7564656420696e20566f74655479706520656e756d60401b6064820152608401610b7c565b61013554604051635bbb217760e01b81526060916001600160a01b031690635bbb21779061177c908590600401613729565b600060405180830381865afa158015611799573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109009190810190613aff565b610135546040516331a9108f60e11b8152600481018390526000916001600160a01b031690636352211e90602401610935565b60008051602061406583398151915261180c81611fe1565b610136805461ffff60a01b1916600160a01b61ffff8516908102919091179091556040519081527f4638b9d191c13f7c818328022e9a587f4050f58d4714724cc187da6307c8f51a90602001611114565b60008051602061406583398151915261187581611fe1565b61187f8383612926565b6040805161ffff85168152602081018490527f2350f7c37c954a84e89df0b239e6b79e60b0b0466691f95df03c1a7a6469de089101610d1b565b610135546040516370a0823160e01b81526000916001600160a01b0316906370a08231906118eb9085906004016132a2565b602060405180830381865afa158015611908573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090091906138a6565b610135546040516382d837a160e01b8152600481018390526000916001600160a01b0316906382d837a1906024016118eb565b61013554604051632118854760e21b81526060916001600160a01b031690638462151c906119919085906004016132a2565b600060405180830381865afa1580156119ae573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109009190810190613b8f565b6000918252609e602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61013554604051634cd12abd60e11b81526001600160a01b038581166004830152602482018590526044820184905260609216906399a2557a90606401600060405180830381865afa158015611a5b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611a839190810190613b8f565b949350505050565b611a93612071565b610135546000906001600160a01b0316636352211e85858481611ab857611ab8613c14565b905060200201356040518263ffffffff1660e01b8152600401611add91815260200190565b602060405180830381865afa158015611afa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1e9190613855565b905060008060005b85811015611bb657836001600160a01b0316611b59888884818110611b4d57611b4d613c14565b905060200201356120b9565b6001600160a01b031614611b805760405163ea65cfc760e01b815260040160405180910390fd5b600080611ba4898985818110611b9857611b98613c14565b9050602002013561217b565b95019493909301925050600101611b26565b50611bc383838387612339565b505050505050565b61013554604051635b34ce8760e11b8152600481018390526000916001600160a01b03169063b6699d0e906024016118eb565b60408051608081018252600080825260208201819052818301819052606082015261013554915163c23dc68f60e01b81526004810184905290916001600160a01b03169063c23dc68f90602401608060405180830381865afa158015611c68573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109009190613c2a565b600080516020614065833981519152611ca481611fe1565b603a5460ff1615611cb757610c58612965565b610c586129b1565b604080516080810182526000808252602082018190529181018290526060810191909152600082815261013860209081526040808320815160808101835281546001600160801b03808216808452600160801b92839004821696840196909652600190930154808416948301949094529092041660608201529103610900576101355460405163c850627760e01b8152600481018590526001600160a01b039091169063c850627790602401608060405180830381865afa158015611d88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b9190613c5d565b50919050565b6101355460405163c87b56dd60e01b8152600481018390526060916001600160a01b03169063c87b56dd90602401600060405180830381865afa158015611dfd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109009190810190613cbc565b611e2e82610aa2565b611e3781611fe1565b610ad3838361264c565b6000610900600583611ec6565b6101355460405163e985e9c560e01b81526001600160a01b0384811660048301528381166024830152600092169063e985e9c590604401602060405180830381865afa158015611ea2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b919061395c565b6000438210611f175760405162461bcd60e51b815260206004820181905260248201527f436865636b706f696e74733a20626c6f636b206e6f7420796574206d696e65646044820152606401610b7c565b6000611f22836129ee565b84549091506000816005811115611f80576000611f3e84612a53565b611f489085613d32565b60008981526020902090915081015463ffffffff9081169086161015611f7057809150611f7e565b611f7b816001613d45565b92505b505b6000611f8e88868585612b3b565b90508015611fc957611fb388611fa5600184613d32565b600091825260209091200190565b54600160201b90046001600160e01b0316611fcc565b60005b6001600160e01b031698975050505050505050565b610c588133612b99565b611ff582826119d6565b610b8f576000828152609e602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561202d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b603a5460ff16156120b75760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b7c565b565b610135546040516331a9108f60e11b8152600481018390526000916001600160a01b031690636352211e90602401602060405180830381865afa158015612104573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121289190613855565b90506001600160a01b03811633148015906121585750612156600080516020613fb2833981519152336119d6565b155b15612176576040516348f5c3ed60e01b815260040160405180910390fd5b919050565b60008181526101396020526040812054819060ff16156121ae57604051634bc54ec360e11b815260040160405180910390fd5b60006121b984612bf2565b805461013554604051635b34ce8760e11b815260048101889052929350600160801b9091046001600160801b0316916001600160a01b039091169063b6699d0e90602401602060405180830381865afa15801561221a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223e91906138a6565b6122489190613d32565b81546001600160801b03908116600160801b810280821785559295506122719286921617613d32565b61013654604051626fc27160e51b815260048101879052602481018390529193506001600160a01b031690630df84e2090604401600060405180830381600087803b1580156122bf57600080fd5b505af11580156122d3573d6000803e3d6000fd5b50505060008581526101396020908152604091829020805460ff1916600117905581518781529081018690529081018490527f5bd8c92d7587f9cf8e315fbc1bc708d32bb8c94c4d9dad1f6f6307ece02a1853915060600160405180910390a150915091565b61013454610135546040516370a0823160e01b81526000926001600160a01b03908116926370a082319261237392909116906004016132a2565b602060405180830381865afa158015612390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b491906138a6565b9050801561242257610135546040516338d322ef60e01b81526001600160a01b03909116906338d322ef906123ef9030908590600401613933565b600060405180830381600087803b15801561240957600080fd5b505af115801561241d573d6000803e3d6000fd5b505050505b6101365461ffff600160a01b9091048116908316036124b7576101345460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061246e9088908890600401613933565b6020604051808303816000875af115801561248d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124b1919061395c565b506125d1565b610134546001600160a01b039081169063695ef6bf903490309086908a16604080516060810182523381526000602082015261013780548d93830191906124fd90613872565b80601f016020809104026020016040519081016040528092919081815260200182805461252990613872565b80156125765780601f1061254b57610100808354040283529160200191612576565b820191906000526020600020905b81548152906001019060200180831161255957829003601f168201915b50505050508152506040518763ffffffff1660e01b815260040161259e959493929190613d58565b6000604051808303818588803b1580156125b757600080fd5b505af11580156125cb573d6000803e3d6000fd5b50505050505b610134546101365460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb92612609929116908790600401613933565b6020604051808303816000875af1158015612628573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bc3919061395c565b61265682826119d6565b15610b8f576000828152609e602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600080516020613ff2833981519152546001600160a01b031690565b600080516020614065833981519152610b8f81611fe1565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561271a57610ad383612c50565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612774575060408051601f3d908101601f19168201909252612771918101906138a6565b60015b6127d75760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610b7c565b600080516020613ff283398151915281146128465760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610b7c565b50610ad3838383612cea565b60006001600160801b038211156128bb5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610b7c565b5090565b60606040518060600160405280602c8152602001614012602c9139905090565b6001600160a01b03163b151590565b600054610100900460ff166129155760405162461bcd60e51b8152600401610b7c90613dbf565b61291e81612d15565b610c58612d5e565b6040516001600160f01b031960f084901b166020820152602281018290526042016040516020818303038152906040526101379081610ad39190613e50565b61296d612e30565b603a805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516129a791906132a2565b60405180910390a1565b6129b9612071565b603a805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861299a3390565b600063ffffffff8211156128bb5760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608401610b7c565b600081600003612a6557506000919050565b60006001612a7284612e79565b901c6001901b90506001818481612a8b57612a8b6139cb565b048201901c90506001818481612aa357612aa36139cb565b048201901c90506001818481612abb57612abb6139cb565b048201901c90506001818481612ad357612ad36139cb565b048201901c90506001818481612aeb57612aeb6139cb565b048201901c90506001818481612b0357612b036139cb565b048201901c90506001818481612b1b57612b1b6139cb565b048201901c9050610a9b81828581612b3557612b356139cb565b04612f0d565b60005b81831015612b91576000612b528484612f23565b60008781526020902090915063ffffffff86169082015463ffffffff161115612b7d57809250612b8b565b612b88816001613d45565b93505b50612b3e565b509392505050565b612ba382826119d6565b610b8f57612bb081612f3e565b612bbb836020612f50565b604051602001612bcc929190613f0f565b60408051601f198184030181529082905262461bcd60e51b8252610b7c91600401613306565b600080612bfe83611cbf565b600093845261013860209081526040948590208251918301516001600160801b03928316600160801b918416820217825595830151606090930151928216929091169094021760018401555090919050565b612c59816128df565b612cbb5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610b7c565b600080516020613ff283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612cf3836130eb565b600082511180612d005750805b15610ad357612d0f838361312b565b50505050565b600054610100900460ff16612d3c5760405162461bcd60e51b8152600401610b7c90613dbf565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600360009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015612db3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dd79190613855565b6001600160a01b0316635c19a95c306040518263ffffffff1660e01b8152600401612e0291906132a2565b600060405180830381600087803b158015612e1c57600080fd5b505af1158015612d0f573d6000803e3d6000fd5b603a5460ff166120b75760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b7c565b600080608083901c15612e8e57608092831c92015b604083901c15612ea057604092831c92015b602083901c15612eb257602092831c92015b601083901c15612ec457601092831c92015b600883901c15612ed657600892831c92015b600483901c15612ee857600492831c92015b600283901c15612efa57600292831c92015b600183901c156109005760010192915050565b6000818310612f1c5781610a9b565b5090919050565b6000612f3260028484186139e1565b610a9b90848416613d45565b60606109006001600160a01b03831660145b60606000612f5f8360026139b4565b612f6a906002613d45565b6001600160401b03811115612f8157612f81613407565b6040519080825280601f01601f191660200182016040528015612fab576020820181803683370190505b509050600360fc1b81600081518110612fc657612fc6613c14565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612ff557612ff5613c14565b60200101906001600160f81b031916908160001a90535060006130198460026139b4565b613024906001613d45565b90505b600181111561309c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061305857613058613c14565b1a60f81b82828151811061306e5761306e613c14565b60200101906001600160f81b031916908160001a90535060049490941c9361309581613f7e565b9050613027565b508315610a9b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b7c565b6130f481612c50565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610a9b838360405180606001604052806027815260200161403e602791396060600080856001600160a01b0316856040516131689190613f95565b600060405180830381855af49150503d80600081146131a3576040519150601f19603f3d011682016040523d82523d6000602084013e6131a8565b606091505b50915091506131b9868383876131c3565b9695505050505050565b60608315613230578251600003613229576131dd856128df565b6132295760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b7c565b5081611a83565b611a8383838151156132455781518083602001fd5b8060405162461bcd60e51b8152600401610b7c9190613306565b60006020828403121561327157600080fd5b81356001600160e01b031981168114610a9b57600080fd5b60006020828403121561329b57600080fd5b5035919050565b6001600160a01b0391909116815260200190565b60005b838110156132d15781810151838201526020016132b9565b50506000910152565b600081518084526132f28160208601602086016132b6565b601f01601f19169290920160200192915050565b602081526000610a9b60208301846132da565b6001600160a01b0381168114610c5857600080fd5b60006020828403121561334057600080fd5b8135610a9b81613319565b6000806040838503121561335e57600080fd5b823561336981613319565b946020939093013593505050565b6000806040838503121561338a57600080fd5b82359150602083013561339c81613319565b809150509250929050565b803561ffff8116811461217657600080fd5b600080604083850312156133cc57600080fd5b823591506133dc602084016133a7565b90509250929050565b600080604083850312156133f857600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b038111828210171561343f5761343f613407565b60405290565b604051601f8201601f191681016001600160401b038111828210171561346d5761346d613407565b604052919050565b60006001600160401b0382111561348e5761348e613407565b50601f01601f191660200190565b600080604083850312156134af57600080fd5b82356134ba81613319565b915060208301356001600160401b038111156134d557600080fd5b8301601f810185136134e657600080fd5b80356134f96134f482613475565b613445565b81815286602083850101111561350e57600080fd5b816020840160208301376000602083830101528093505050509250929050565b6000806000806080858703121561354457600080fd5b843561354f81613319565b9350602085013561355f81613319565b9250604085013561356f81613319565b9150606085013561357f81613319565b939692955090935050565b6000806040838503121561359d57600080fd5b82359150602083013560ff8116811461339c57600080fd5b60006001600160401b038211156135ce576135ce613407565b5060051b60200190565b600060208083850312156135eb57600080fd5b82356001600160401b0381111561360157600080fd5b8301601f8101851361361257600080fd5b80356136206134f4826135b5565b81815260059190911b8201830190838101908783111561363f57600080fd5b928401925b8284101561365d57833582529284019290840190613644565b979650505050505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b818110156136e6576136d3838551613668565b92840192608092909201916001016136c0565b50909695505050505050565b60006020828403121561370457600080fd5b610a9b826133a7565b6000806040838503121561372057600080fd5b613369836133a7565b6020808252825182820181905260009190848201906040850190845b818110156136e657835183529284019291840191600101613745565b60008060006060848603121561377657600080fd5b833561378181613319565b95602085013595506040909401359392505050565b6000806000604084860312156137ab57600080fd5b83356001600160401b03808211156137c257600080fd5b818601915086601f8301126137d657600080fd5b8135818111156137e557600080fd5b8760208260051b85010111156137fa57600080fd5b60209283019550935061381091860190506133a7565b90509250925092565b608081016109008284613668565b6000806040838503121561383a57600080fd5b823561384581613319565b9150602083013561339c81613319565b60006020828403121561386757600080fd5b8151610a9b81613319565b600181811c9082168061388657607f821691505b602082108103611dac57634e487b7160e01b600052602260045260246000fd5b6000602082840312156138b857600080fd5b5051919050565b6020808252602c90820152600080516020613fd283398151915260408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c90820152600080516020613fd283398151915260408201526b6163746976652070726f787960a01b606082015260800190565b6001600160a01b03929092168252602082015260400190565b8051801515811461217657600080fd5b60006020828403121561396e57600080fd5b610a9b8261394c565b634e487b7160e01b600052601160045260246000fd5b6001600160801b038181168382160190808211156139ad576139ad613977565b5092915050565b808202811582820484141761090057610900613977565b634e487b7160e01b600052601260045260246000fd5b6000826139fe57634e487b7160e01b600052601260045260246000fd5b500490565b84815260ff84166020820152608060408201526000613a2560808301856132da565b828103606084015261365d81856132da565b600060408284031215613a4957600080fd5b604080519081016001600160401b0381118282101715613a6b57613a6b613407565b604052825181526020928301519281019290925250919050565b600060808284031215613a9757600080fd5b613a9f61341d565b90508151613aac81613319565b815260208201516001600160401b0381168114613ac857600080fd5b6020820152613ad96040830161394c565b6040820152606082015162ffffff81168114613af457600080fd5b606082015292915050565b60006020808385031215613b1257600080fd5b82516001600160401b03811115613b2857600080fd5b8301601f81018513613b3957600080fd5b8051613b476134f4826135b5565b81815260079190911b82018301908381019087831115613b6657600080fd5b928401925b8284101561365d57613b7d8885613a85565b82528482019150608084019350613b6b565b60006020808385031215613ba257600080fd5b82516001600160401b03811115613bb857600080fd5b8301601f81018513613bc957600080fd5b8051613bd76134f4826135b5565b81815260059190911b82018301908381019087831115613bf657600080fd5b928401925b8284101561365d57835182529284019290840190613bfb565b634e487b7160e01b600052603260045260246000fd5b600060808284031215613c3c57600080fd5b610a9b8383613a85565b80516001600160801b038116811461217657600080fd5b600060808284031215613c6f57600080fd5b613c7761341d565b613c8083613c46565b8152613c8e60208401613c46565b6020820152613c9f60408401613c46565b6040820152613cb060608401613c46565b60608201529392505050565b600060208284031215613cce57600080fd5b81516001600160401b03811115613ce457600080fd5b8201601f81018413613cf557600080fd5b8051613d036134f482613475565b818152856020838501011115613d1857600080fd5b613d298260208301602086016132b6565b95945050505050565b8181038181111561090057610900613977565b8082018082111561090057610900613977565b600060018060a01b03808816835261ffff8716602084015285604084015284606084015260a060808401528084511660a08401528060208501511660c0840152506040830151606060e0840152613db36101008401826132da565b98975050505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b601f821115610ad357600081815260208120601f850160051c81016020861015613e315750805b601f850160051c820191505b81811015611bc357828155600101613e3d565b81516001600160401b03811115613e6957613e69613407565b613e7d81613e778454613872565b84613e0a565b602080601f831160018114613eb25760008415613e9a5750858301515b600019600386901b1c1916600185901b178555611bc3565b600085815260208120601f198616915b82811015613ee157888601518255948401946001909101908401613ec2565b5085821015613eff5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351613f418160178501602088016132b6565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613f728160288401602088016132b6565b01602801949350505050565b600081613f8d57613f8d613977565b506000190190565b60008251613fa78184602087016132b6565b919091019291505056fee2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc446756e6374696f6e206d7573742062652063616c6c6564207468726f75676820360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc726f6c6c65642d757020766f74652066726f6d20676f7665726e616e636520746f6b656e20686f6c64657273416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a26469706673582212205e9708da92b87328f508ab50aec04b57ebe9e7499bd6f24964f0a481c97dc91564736f6c63430008130033
6080604052600436106102185760003560e01c806301ffc9a71461021d578063081812fc14610252578063083118d51461027f57806312064c34146102a157806314d140b0146102dc57806318160ddd146102fd5780631b13ee8a14610312578063248a9ca3146103325780632f2ff15d14610352578063318cd6731461037457806336568abe146103875780633659cfe6146103a757806338d322ef146103c75780633eb76b9c146103e7578063410a1db11461040757806349dcc204146104275780634f1ef286146104625780635142d5e31461047557806352d1902d1461049557806352e62a43146104aa578063544ffc9c146104ca5780635bbb21771461053f5780635c975abb1461056c5780636352211e146105845780636927850a146105a4578063696c81bb146105ba5780636d1daa28146105da5780636dc0ae22146105fa57806370a082311461061a57806375b238fc1461063a5780637a26db171461065c5780637f66dea11461069257806382d837a1146106b35780638462151c146106d357806391d1485414610700578063926d7d7f1461072057806399a2557a14610742578063a217fddf14610762578063b09de27814610777578063b6699d0e1461078a578063c23dc68f146107aa578063c4ae3168146107d7578063c8506277146107ec578063c87b56dd1461084f578063d547741f1461086f578063db7817f91461088f578063e985e9c5146108af575b600080fd5b34801561022957600080fd5b5061023d61023836600461325f565b6108cf565b60405190151581526020015b60405180910390f35b34801561025e57600080fd5b5061027261026d366004613289565b610906565b60405161024991906132a2565b34801561028b57600080fd5b50610294610976565b6040516102499190613306565b3480156102ad57600080fd5b506102ce6102bc36600461332e565b60066020526000908152604090205481565b604051908152602001610249565b3480156102e857600080fd5b5061013654610272906001600160a01b031681565b34801561030957600080fd5b506102ce610a05565b34801561031e57600080fd5b506102ce61032d36600461334b565b610a79565b34801561033e57600080fd5b506102ce61034d366004613289565b610aa2565b34801561035e57600080fd5b5061037261036d366004613377565b610ab7565b005b6103726103823660046133b9565b610ad8565b34801561039357600080fd5b506103726103a2366004613377565b610b10565b3480156103b357600080fd5b506103726103c236600461332e565b610b93565b3480156103d357600080fd5b506103726103e236600461334b565b610c5b565b3480156103f357600080fd5b50610372610402366004613289565b610d28565b34801561041357600080fd5b5061037261042236600461332e565b611089565b34801561043357600080fd5b506104476104423660046133e5565b611120565b60408051825181526020928301519281019290925201610249565b61037261047036600461349c565b6111a6565b34801561048157600080fd5b5061037261049036600461352e565b61125b565b3480156104a157600080fd5b506102ce61141f565b3480156104b657600080fd5b506103726104c536600461358a565b6114cd565b3480156104d657600080fd5b506105156104e5366004613289565b600260205260009081526040902080546001909101546001600160801b0380831692600160801b90048116911683565b604080516001600160801b0394851681529284166020840152921691810191909152606001610249565b34801561054b57600080fd5b5061055f61055a3660046135d8565b61174a565b60405161024991906136a4565b34801561057857600080fd5b50603a5460ff1661023d565b34801561059057600080fd5b5061027261059f366004613289565b6117c1565b3480156105b057600080fd5b506102ce60075481565b3480156105c657600080fd5b506103726105d53660046136f2565b6117f4565b3480156105e657600080fd5b506103726105f536600461370d565b61185d565b34801561060657600080fd5b50600354610272906001600160a01b031681565b34801561062657600080fd5b506102ce61063536600461332e565b6118b9565b34801561064657600080fd5b506102ce60008051602061406583398151915281565b34801561066857600080fd5b506101365461067f90600160a01b900461ffff1681565b60405161ffff9091168152602001610249565b34801561069e57600080fd5b5061013454610272906001600160a01b031681565b3480156106bf57600080fd5b506102ce6106ce366004613289565b61192c565b3480156106df57600080fd5b506106f36106ee36600461332e565b61195f565b6040516102499190613729565b34801561070c57600080fd5b5061023d61071b366004613377565b6119d6565b34801561072c57600080fd5b506102ce600080516020613fb283398151915281565b34801561074e57600080fd5b506106f361075d366004613761565b611a01565b34801561076e57600080fd5b506102ce600081565b610372610785366004613796565b611a8b565b34801561079657600080fd5b506102ce6107a5366004613289565b611bcb565b3480156107b657600080fd5b506107ca6107c5366004613289565b611bfe565b6040516102499190613819565b3480156107e357600080fd5b50610372611c8c565b3480156107f857600080fd5b5061080c610807366004613289565b611cbf565b604051610249919081516001600160801b039081168252602080840151821690830152604080840151821690830152606092830151169181019190915260800190565b34801561085b57600080fd5b5061029461086a366004613289565b611db2565b34801561087b57600080fd5b5061037261088a366004613377565b611e25565b34801561089b57600080fd5b506102ce6108aa366004613289565b611e41565b3480156108bb57600080fd5b5061023d6108ca366004613827565b611e4e565b60006001600160e01b03198216637965db0b60e01b148061090057506301ffc9a760e01b6001600160e01b03198316145b92915050565b6101355460405163020604bf60e21b8152600481018390526000916001600160a01b03169063081812fc906024015b602060405180830381865afa158015610952573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109009190613855565b610137805461098490613872565b80601f01602080910402602001604051908101604052809291908181526020018280546109b090613872565b80156109fd5780601f106109d2576101008083540402835291602001916109fd565b820191906000526020600020905b8154815290600101906020018083116109e057829003601f168201915b505050505081565b61013554604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015610a50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7491906138a6565b905090565b6001600160a01b0382166000908152600460205260408120610a9b9083611ec6565b9392505050565b6000908152609e602052604090206001015490565b610ac082610aa2565b610ac981611fe1565b610ad38383611feb565b505050565b610ae0612071565b6000610aeb836120b9565b9050600080610af98561217b565b91509150610b0983838387612339565b5050505050565b6001600160a01b0381163314610b855760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610b8f828261264c565b5050565b6001600160a01b037f000000000000000000000000befe5fa80b6e2daaaefc82e930b18fb3245a634b163003610bdb5760405162461bcd60e51b8152600401610b7c906138bf565b7f000000000000000000000000befe5fa80b6e2daaaefc82e930b18fb3245a634b6001600160a01b0316610c0d6126b3565b6001600160a01b031614610c335760405162461bcd60e51b8152600401610b7c906138f9565b610c3c816126cf565b60408051600080825260208201909252610c58918391906126e7565b50565b600080516020614065833981519152610c7381611fe1565b6101345460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb90610ca69086908690600401613933565b6020604051808303816000875af1158015610cc5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce9919061395c565b507f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d58383604051610d1b929190613933565b60405180910390a1505050565b6000818152600260205260408120600181015481549192916001600160801b0391821691610d629180821691600160801b9091041661398d565b610d6c919061398d565b6001600160801b031611610db75760405162461bcd60e51b81526020600482015260126024820152711b9bc81d9bdd195cc8195e1c1c995cdcd95960721b6044820152606401610b7c565b600354604051632d63f69360e01b8152600481018490526000916001600160a01b031690632d63f69390602401602060405180830381865afa158015610e01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2591906138a6565b90506000610e3282611e41565b90506000600360009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610e8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eaf9190613855565b6001600160a01b0316633a46b1a830856040518363ffffffff1660e01b8152600401610edc929190613933565b602060405180830381865afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d91906138a6565b8454909150600090610f54908490610f4590600160801b90046001600160801b0316856139b4565b610f4f91906139e1565b612852565b8554909150600090610f75908590610f45906001600160801b0316866139b4565b6001870154909150600090610f99908690610f45906001600160801b0316876139b4565b600089815260026020818152604080842084815560010180546001600160801b03199081169091558151608089811b83169482019490945289841b821660308201529286901b16908201529293509160500160408051601f198184030181529190526003549091506001600160a01b0316635f398a148b846110196128bf565b856040518563ffffffff1660e01b81526004016110399493929190613a03565b6020604051808303816000875af1158015611058573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107c91906138a6565b5050505050505050505050565b6000805160206140658339815191526110a181611fe1565b6001600160a01b0382166110c85760405163d92e233d60e01b815260040160405180910390fd5b61013680546001600160a01b0319166001600160a01b0384161790556040517f1defc7e59eeac6c8cb243873ba35cd0ac8c57fe81e330b6ab84c23c63c1f007d906111149084906132a2565b60405180910390a15050565b60408051808201825260008082526020820152610135549151631277308160e21b8152600481018590526024810184905290916001600160a01b0316906349dcc204906044016040805180830381865afa158015611182573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b9190613a37565b6001600160a01b037f000000000000000000000000befe5fa80b6e2daaaefc82e930b18fb3245a634b1630036111ee5760405162461bcd60e51b8152600401610b7c906138bf565b7f000000000000000000000000befe5fa80b6e2daaaefc82e930b18fb3245a634b6001600160a01b03166112206126b3565b6001600160a01b0316146112465760405162461bcd60e51b8152600401610b7c906138f9565b61124f826126cf565b610b8f828260016126e7565b600054610100900460ff161580801561127b5750600054600160ff909116105b8061129c575061128a306128df565b15801561129c575060005460ff166001145b6112ff5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610b7c565b6000805460ff191660011790558015611322576000805461ff0019166101001790555b61133f7312163980a1ec6f5c955a19793914192d01c872686128ee565b61013580546001600160a01b0319166001600160a01b0387161790556113696001621e8480612926565b610136805461ffff60a01b191660af60a01b179055611389600085611feb565b6113a160008051602061406583398151915285611feb565b61013680546001600160a01b038086166001600160a01b0319928316179092556101348054928516929091169190911790558015610b09576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b6000306001600160a01b037f000000000000000000000000befe5fa80b6e2daaaefc82e930b18fb3245a634b16146114ba5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608401610b7c565b50600080516020613ff283398151915290565b600354604051632d63f69360e01b8152600481018490526000916115419133916001600160a01b031690632d63f69390602401602060405180830381865afa15801561151d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032d91906138a6565b90506000811161157f5760405162461bcd60e51b81526020600482015260096024820152681b9bc81dd95a59da1d60ba1b6044820152606401610b7c565b600083815260016020908152604080832033845290915290205460ff16156115d95760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e481d9bdd1959609a1b6044820152606401610b7c565b6000838152600160208181526040808420338552909152909120805460ff1916909117905560ff821661165f5761160f81612852565b600084815260026020526040812080549091906116369084906001600160801b031661398d565b92506101000a8154816001600160801b0302191690836001600160801b03160217905550505050565b60001960ff8316016116a25761167481612852565b60008481526002602052604090208054601090611636908490600160801b90046001600160801b031661398d565b60011960ff8316016116e1576116b781612852565b600084815260026020526040812060010180549091906116369084906001600160801b031661398d565b60405162461bcd60e51b815260206004820152603860248201527f696e76616c696420737570706f72742076616c75652c206d75737420626520696044820152776e636c7564656420696e20566f74655479706520656e756d60401b6064820152608401610b7c565b61013554604051635bbb217760e01b81526060916001600160a01b031690635bbb21779061177c908590600401613729565b600060405180830381865afa158015611799573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109009190810190613aff565b610135546040516331a9108f60e11b8152600481018390526000916001600160a01b031690636352211e90602401610935565b60008051602061406583398151915261180c81611fe1565b610136805461ffff60a01b1916600160a01b61ffff8516908102919091179091556040519081527f4638b9d191c13f7c818328022e9a587f4050f58d4714724cc187da6307c8f51a90602001611114565b60008051602061406583398151915261187581611fe1565b61187f8383612926565b6040805161ffff85168152602081018490527f2350f7c37c954a84e89df0b239e6b79e60b0b0466691f95df03c1a7a6469de089101610d1b565b610135546040516370a0823160e01b81526000916001600160a01b0316906370a08231906118eb9085906004016132a2565b602060405180830381865afa158015611908573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090091906138a6565b610135546040516382d837a160e01b8152600481018390526000916001600160a01b0316906382d837a1906024016118eb565b61013554604051632118854760e21b81526060916001600160a01b031690638462151c906119919085906004016132a2565b600060405180830381865afa1580156119ae573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109009190810190613b8f565b6000918252609e602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61013554604051634cd12abd60e11b81526001600160a01b038581166004830152602482018590526044820184905260609216906399a2557a90606401600060405180830381865afa158015611a5b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611a839190810190613b8f565b949350505050565b611a93612071565b610135546000906001600160a01b0316636352211e85858481611ab857611ab8613c14565b905060200201356040518263ffffffff1660e01b8152600401611add91815260200190565b602060405180830381865afa158015611afa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1e9190613855565b905060008060005b85811015611bb657836001600160a01b0316611b59888884818110611b4d57611b4d613c14565b905060200201356120b9565b6001600160a01b031614611b805760405163ea65cfc760e01b815260040160405180910390fd5b600080611ba4898985818110611b9857611b98613c14565b9050602002013561217b565b95019493909301925050600101611b26565b50611bc383838387612339565b505050505050565b61013554604051635b34ce8760e11b8152600481018390526000916001600160a01b03169063b6699d0e906024016118eb565b60408051608081018252600080825260208201819052818301819052606082015261013554915163c23dc68f60e01b81526004810184905290916001600160a01b03169063c23dc68f90602401608060405180830381865afa158015611c68573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109009190613c2a565b600080516020614065833981519152611ca481611fe1565b603a5460ff1615611cb757610c58612965565b610c586129b1565b604080516080810182526000808252602082018190529181018290526060810191909152600082815261013860209081526040808320815160808101835281546001600160801b03808216808452600160801b92839004821696840196909652600190930154808416948301949094529092041660608201529103610900576101355460405163c850627760e01b8152600481018590526001600160a01b039091169063c850627790602401608060405180830381865afa158015611d88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b9190613c5d565b50919050565b6101355460405163c87b56dd60e01b8152600481018390526060916001600160a01b03169063c87b56dd90602401600060405180830381865afa158015611dfd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109009190810190613cbc565b611e2e82610aa2565b611e3781611fe1565b610ad3838361264c565b6000610900600583611ec6565b6101355460405163e985e9c560e01b81526001600160a01b0384811660048301528381166024830152600092169063e985e9c590604401602060405180830381865afa158015611ea2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b919061395c565b6000438210611f175760405162461bcd60e51b815260206004820181905260248201527f436865636b706f696e74733a20626c6f636b206e6f7420796574206d696e65646044820152606401610b7c565b6000611f22836129ee565b84549091506000816005811115611f80576000611f3e84612a53565b611f489085613d32565b60008981526020902090915081015463ffffffff9081169086161015611f7057809150611f7e565b611f7b816001613d45565b92505b505b6000611f8e88868585612b3b565b90508015611fc957611fb388611fa5600184613d32565b600091825260209091200190565b54600160201b90046001600160e01b0316611fcc565b60005b6001600160e01b031698975050505050505050565b610c588133612b99565b611ff582826119d6565b610b8f576000828152609e602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561202d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b603a5460ff16156120b75760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b7c565b565b610135546040516331a9108f60e11b8152600481018390526000916001600160a01b031690636352211e90602401602060405180830381865afa158015612104573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121289190613855565b90506001600160a01b03811633148015906121585750612156600080516020613fb2833981519152336119d6565b155b15612176576040516348f5c3ed60e01b815260040160405180910390fd5b919050565b60008181526101396020526040812054819060ff16156121ae57604051634bc54ec360e11b815260040160405180910390fd5b60006121b984612bf2565b805461013554604051635b34ce8760e11b815260048101889052929350600160801b9091046001600160801b0316916001600160a01b039091169063b6699d0e90602401602060405180830381865afa15801561221a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223e91906138a6565b6122489190613d32565b81546001600160801b03908116600160801b810280821785559295506122719286921617613d32565b61013654604051626fc27160e51b815260048101879052602481018390529193506001600160a01b031690630df84e2090604401600060405180830381600087803b1580156122bf57600080fd5b505af11580156122d3573d6000803e3d6000fd5b50505060008581526101396020908152604091829020805460ff1916600117905581518781529081018690529081018490527f5bd8c92d7587f9cf8e315fbc1bc708d32bb8c94c4d9dad1f6f6307ece02a1853915060600160405180910390a150915091565b61013454610135546040516370a0823160e01b81526000926001600160a01b03908116926370a082319261237392909116906004016132a2565b602060405180830381865afa158015612390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b491906138a6565b9050801561242257610135546040516338d322ef60e01b81526001600160a01b03909116906338d322ef906123ef9030908590600401613933565b600060405180830381600087803b15801561240957600080fd5b505af115801561241d573d6000803e3d6000fd5b505050505b6101365461ffff600160a01b9091048116908316036124b7576101345460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061246e9088908890600401613933565b6020604051808303816000875af115801561248d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124b1919061395c565b506125d1565b610134546001600160a01b039081169063695ef6bf903490309086908a16604080516060810182523381526000602082015261013780548d93830191906124fd90613872565b80601f016020809104026020016040519081016040528092919081815260200182805461252990613872565b80156125765780601f1061254b57610100808354040283529160200191612576565b820191906000526020600020905b81548152906001019060200180831161255957829003601f168201915b50505050508152506040518763ffffffff1660e01b815260040161259e959493929190613d58565b6000604051808303818588803b1580156125b757600080fd5b505af11580156125cb573d6000803e3d6000fd5b50505050505b610134546101365460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb92612609929116908790600401613933565b6020604051808303816000875af1158015612628573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bc3919061395c565b61265682826119d6565b15610b8f576000828152609e602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600080516020613ff2833981519152546001600160a01b031690565b600080516020614065833981519152610b8f81611fe1565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561271a57610ad383612c50565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612774575060408051601f3d908101601f19168201909252612771918101906138a6565b60015b6127d75760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610b7c565b600080516020613ff283398151915281146128465760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610b7c565b50610ad3838383612cea565b60006001600160801b038211156128bb5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610b7c565b5090565b60606040518060600160405280602c8152602001614012602c9139905090565b6001600160a01b03163b151590565b600054610100900460ff166129155760405162461bcd60e51b8152600401610b7c90613dbf565b61291e81612d15565b610c58612d5e565b6040516001600160f01b031960f084901b166020820152602281018290526042016040516020818303038152906040526101379081610ad39190613e50565b61296d612e30565b603a805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516129a791906132a2565b60405180910390a1565b6129b9612071565b603a805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861299a3390565b600063ffffffff8211156128bb5760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608401610b7c565b600081600003612a6557506000919050565b60006001612a7284612e79565b901c6001901b90506001818481612a8b57612a8b6139cb565b048201901c90506001818481612aa357612aa36139cb565b048201901c90506001818481612abb57612abb6139cb565b048201901c90506001818481612ad357612ad36139cb565b048201901c90506001818481612aeb57612aeb6139cb565b048201901c90506001818481612b0357612b036139cb565b048201901c90506001818481612b1b57612b1b6139cb565b048201901c9050610a9b81828581612b3557612b356139cb565b04612f0d565b60005b81831015612b91576000612b528484612f23565b60008781526020902090915063ffffffff86169082015463ffffffff161115612b7d57809250612b8b565b612b88816001613d45565b93505b50612b3e565b509392505050565b612ba382826119d6565b610b8f57612bb081612f3e565b612bbb836020612f50565b604051602001612bcc929190613f0f565b60408051601f198184030181529082905262461bcd60e51b8252610b7c91600401613306565b600080612bfe83611cbf565b600093845261013860209081526040948590208251918301516001600160801b03928316600160801b918416820217825595830151606090930151928216929091169094021760018401555090919050565b612c59816128df565b612cbb5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610b7c565b600080516020613ff283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612cf3836130eb565b600082511180612d005750805b15610ad357612d0f838361312b565b50505050565b600054610100900460ff16612d3c5760405162461bcd60e51b8152600401610b7c90613dbf565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600360009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015612db3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dd79190613855565b6001600160a01b0316635c19a95c306040518263ffffffff1660e01b8152600401612e0291906132a2565b600060405180830381600087803b158015612e1c57600080fd5b505af1158015612d0f573d6000803e3d6000fd5b603a5460ff166120b75760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b7c565b600080608083901c15612e8e57608092831c92015b604083901c15612ea057604092831c92015b602083901c15612eb257602092831c92015b601083901c15612ec457601092831c92015b600883901c15612ed657600892831c92015b600483901c15612ee857600492831c92015b600283901c15612efa57600292831c92015b600183901c156109005760010192915050565b6000818310612f1c5781610a9b565b5090919050565b6000612f3260028484186139e1565b610a9b90848416613d45565b60606109006001600160a01b03831660145b60606000612f5f8360026139b4565b612f6a906002613d45565b6001600160401b03811115612f8157612f81613407565b6040519080825280601f01601f191660200182016040528015612fab576020820181803683370190505b509050600360fc1b81600081518110612fc657612fc6613c14565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612ff557612ff5613c14565b60200101906001600160f81b031916908160001a90535060006130198460026139b4565b613024906001613d45565b90505b600181111561309c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061305857613058613c14565b1a60f81b82828151811061306e5761306e613c14565b60200101906001600160f81b031916908160001a90535060049490941c9361309581613f7e565b9050613027565b508315610a9b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b7c565b6130f481612c50565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610a9b838360405180606001604052806027815260200161403e602791396060600080856001600160a01b0316856040516131689190613f95565b600060405180830381855af49150503d80600081146131a3576040519150601f19603f3d011682016040523d82523d6000602084013e6131a8565b606091505b50915091506131b9868383876131c3565b9695505050505050565b60608315613230578251600003613229576131dd856128df565b6132295760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b7c565b5081611a83565b611a8383838151156132455781518083602001fd5b8060405162461bcd60e51b8152600401610b7c9190613306565b60006020828403121561327157600080fd5b81356001600160e01b031981168114610a9b57600080fd5b60006020828403121561329b57600080fd5b5035919050565b6001600160a01b0391909116815260200190565b60005b838110156132d15781810151838201526020016132b9565b50506000910152565b600081518084526132f28160208601602086016132b6565b601f01601f19169290920160200192915050565b602081526000610a9b60208301846132da565b6001600160a01b0381168114610c5857600080fd5b60006020828403121561334057600080fd5b8135610a9b81613319565b6000806040838503121561335e57600080fd5b823561336981613319565b946020939093013593505050565b6000806040838503121561338a57600080fd5b82359150602083013561339c81613319565b809150509250929050565b803561ffff8116811461217657600080fd5b600080604083850312156133cc57600080fd5b823591506133dc602084016133a7565b90509250929050565b600080604083850312156133f857600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b038111828210171561343f5761343f613407565b60405290565b604051601f8201601f191681016001600160401b038111828210171561346d5761346d613407565b604052919050565b60006001600160401b0382111561348e5761348e613407565b50601f01601f191660200190565b600080604083850312156134af57600080fd5b82356134ba81613319565b915060208301356001600160401b038111156134d557600080fd5b8301601f810185136134e657600080fd5b80356134f96134f482613475565b613445565b81815286602083850101111561350e57600080fd5b816020840160208301376000602083830101528093505050509250929050565b6000806000806080858703121561354457600080fd5b843561354f81613319565b9350602085013561355f81613319565b9250604085013561356f81613319565b9150606085013561357f81613319565b939692955090935050565b6000806040838503121561359d57600080fd5b82359150602083013560ff8116811461339c57600080fd5b60006001600160401b038211156135ce576135ce613407565b5060051b60200190565b600060208083850312156135eb57600080fd5b82356001600160401b0381111561360157600080fd5b8301601f8101851361361257600080fd5b80356136206134f4826135b5565b81815260059190911b8201830190838101908783111561363f57600080fd5b928401925b8284101561365d57833582529284019290840190613644565b979650505050505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b818110156136e6576136d3838551613668565b92840192608092909201916001016136c0565b50909695505050505050565b60006020828403121561370457600080fd5b610a9b826133a7565b6000806040838503121561372057600080fd5b613369836133a7565b6020808252825182820181905260009190848201906040850190845b818110156136e657835183529284019291840191600101613745565b60008060006060848603121561377657600080fd5b833561378181613319565b95602085013595506040909401359392505050565b6000806000604084860312156137ab57600080fd5b83356001600160401b03808211156137c257600080fd5b818601915086601f8301126137d657600080fd5b8135818111156137e557600080fd5b8760208260051b85010111156137fa57600080fd5b60209283019550935061381091860190506133a7565b90509250925092565b608081016109008284613668565b6000806040838503121561383a57600080fd5b823561384581613319565b9150602083013561339c81613319565b60006020828403121561386757600080fd5b8151610a9b81613319565b600181811c9082168061388657607f821691505b602082108103611dac57634e487b7160e01b600052602260045260246000fd5b6000602082840312156138b857600080fd5b5051919050565b6020808252602c90820152600080516020613fd283398151915260408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c90820152600080516020613fd283398151915260408201526b6163746976652070726f787960a01b606082015260800190565b6001600160a01b03929092168252602082015260400190565b8051801515811461217657600080fd5b60006020828403121561396e57600080fd5b610a9b8261394c565b634e487b7160e01b600052601160045260246000fd5b6001600160801b038181168382160190808211156139ad576139ad613977565b5092915050565b808202811582820484141761090057610900613977565b634e487b7160e01b600052601260045260246000fd5b6000826139fe57634e487b7160e01b600052601260045260246000fd5b500490565b84815260ff84166020820152608060408201526000613a2560808301856132da565b828103606084015261365d81856132da565b600060408284031215613a4957600080fd5b604080519081016001600160401b0381118282101715613a6b57613a6b613407565b604052825181526020928301519281019290925250919050565b600060808284031215613a9757600080fd5b613a9f61341d565b90508151613aac81613319565b815260208201516001600160401b0381168114613ac857600080fd5b6020820152613ad96040830161394c565b6040820152606082015162ffffff81168114613af457600080fd5b606082015292915050565b60006020808385031215613b1257600080fd5b82516001600160401b03811115613b2857600080fd5b8301601f81018513613b3957600080fd5b8051613b476134f4826135b5565b81815260079190911b82018301908381019087831115613b6657600080fd5b928401925b8284101561365d57613b7d8885613a85565b82528482019150608084019350613b6b565b60006020808385031215613ba257600080fd5b82516001600160401b03811115613bb857600080fd5b8301601f81018513613bc957600080fd5b8051613bd76134f4826135b5565b81815260059190911b82018301908381019087831115613bf657600080fd5b928401925b8284101561365d57835182529284019290840190613bfb565b634e487b7160e01b600052603260045260246000fd5b600060808284031215613c3c57600080fd5b610a9b8383613a85565b80516001600160801b038116811461217657600080fd5b600060808284031215613c6f57600080fd5b613c7761341d565b613c8083613c46565b8152613c8e60208401613c46565b6020820152613c9f60408401613c46565b6040820152613cb060608401613c46565b60608201529392505050565b600060208284031215613cce57600080fd5b81516001600160401b03811115613ce457600080fd5b8201601f81018413613cf557600080fd5b8051613d036134f482613475565b818152856020838501011115613d1857600080fd5b613d298260208301602086016132b6565b95945050505050565b8181038181111561090057610900613977565b8082018082111561090057610900613977565b600060018060a01b03808816835261ffff8716602084015285604084015284606084015260a060808401528084511660a08401528060208501511660c0840152506040830151606060e0840152613db36101008401826132da565b98975050505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b601f821115610ad357600081815260208120601f850160051c81016020861015613e315750805b601f850160051c820191505b81811015611bc357828155600101613e3d565b81516001600160401b03811115613e6957613e69613407565b613e7d81613e778454613872565b84613e0a565b602080601f831160018114613eb25760008415613e9a5750858301515b600019600386901b1c1916600185901b178555611bc3565b600085815260208120601f198616915b82811015613ee157888601518255948401946001909101908401613ec2565b5085821015613eff5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351613f418160178501602088016132b6565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613f728160288401602088016132b6565b01602801949350505050565b600081613f8d57613f8d613977565b506000190190565b60008251613fa78184602087016132b6565b919091019291505056fee2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc446756e6374696f6e206d7573742062652063616c6c6564207468726f75676820360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc726f6c6c65642d757020766f74652066726f6d20676f7665726e616e636520746f6b656e20686f6c64657273416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a26469706673582212205e9708da92b87328f508ab50aec04b57ebe9e7499bd6f24964f0a481c97dc91564736f6c63430008130033
1
20,291,097
8e1242a22239341afea85a0019308cd1ff4bb1d92fefedc65747a520dacd2a01
591c5136a611fbe2bf7cb5f6b68903a9e20f2bb76ad3cdbf9d162d27212058c0
b974c3566eeb320c98c84bd34e3911ae50056042
b974c3566eeb320c98c84bd34e3911ae50056042
e2575dfebc97260e854d61cbecf3db901ffe3973
6080604052600f60065560146007555f6008555f6009556014600a556014600b556014600c555f600d555f600e556009600a6200003d919062000602565b6401f4add4006200004f919062000652565b600f556009600a62000062919062000602565b6401f4add40062000074919062000652565b6010556009600a62000087919062000602565b63fa56ea0062000098919062000652565b6011556009600a620000ab919062000602565b63fa56ea00620000bc919062000652565b6012555f601460156101000a81548160ff0219169083151502179055505f601460166101000a81548160ff0219169083151502179055505f6015555f60165534801562000107575f80fd5b505f620001196200044260201b60201c565b9050805f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff165f73ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350620001c56200044260201b60201c565b60055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506009600a62000214919062000602565b6461f313f88062000226919062000652565b60015f620002396200044260201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550600160035f6200028b6200044960201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550600160035f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550600160035f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550620003b56200044260201b60201c565b73ffffffffffffffffffffffffffffffffffffffff165f73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6009600a62000413919062000602565b6461f313f88062000425919062000652565b604051620004349190620006ad565b60405180910390a3620006c8565b5f33905090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b6001851115620004fa57808604811115620004d257620004d162000470565b5b6001851615620004e25780820291505b8081029050620004f2856200049d565b9450620004b2565b94509492505050565b5f82620005145760019050620005e6565b8162000523575f9050620005e6565b81600181146200053c576002811462000547576200057d565b6001915050620005e6565b60ff8411156200055c576200055b62000470565b5b8360020a91508482111562000576576200057562000470565b5b50620005e6565b5060208310610133831016604e8410600b8410161715620005b75782820a905083811115620005b157620005b062000470565b5b620005e6565b620005c68484846001620004a9565b92509050818404811115620005e057620005df62000470565b5b81810290505b9392505050565b5f819050919050565b5f60ff82169050919050565b5f6200060e82620005ed565b91506200061b83620005f6565b92506200064a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848462000503565b905092915050565b5f6200065e82620005ed565b91506200066b83620005ed565b92508282026200067b81620005ed565b9150828204841483151762000695576200069462000470565b5b5092915050565b620006a781620005ed565b82525050565b5f602082019050620006c25f8301846200069c565b92915050565b61355380620006d65f395ff3fe608060405260043610610143575f3560e01c8063715018a6116100b5578063a9059cbb1161006e578063a9059cbb1461040e578063bf474bed1461044a578063c9567bf914610474578063d34628cc1461048a578063dd62ed3e146104b2578063ec1f3f63146104ee5761014a565b8063715018a61461033a578063751039fc146103505780637d1db4a5146103665780638da5cb5b146103905780638f9a55c0146103ba57806395d89b41146103e45761014a565b806323b872dd1161010757806323b872dd1461021e578063313ce5671461025a57806331c2d847146102845780633bbac579146102ac57806351bc3c85146102e857806370a08231146102fe5761014a565b806306fdde031461014e578063095ea7b3146101785780630faee56f146101b4578063109daa99146101de57806318160ddd146101f45761014a565b3661014a57005b5f80fd5b348015610159575f80fd5b50610162610516565b60405161016f91906124e6565b60405180910390f35b348015610183575f80fd5b5061019e600480360381019061019991906125a4565b610553565b6040516101ab91906125fc565b60405180910390f35b3480156101bf575f80fd5b506101c8610570565b6040516101d59190612624565b60405180910390f35b3480156101e9575f80fd5b506101f2610576565b005b3480156101ff575f80fd5b5061020861064a565b6040516102159190612624565b60405180910390f35b348015610229575f80fd5b50610244600480360381019061023f919061263d565b61066e565b60405161025191906125fc565b60405180910390f35b348015610265575f80fd5b5061026e610742565b60405161027b91906126a8565b60405180910390f35b34801561028f575f80fd5b506102aa60048036038101906102a59190612801565b61074a565b005b3480156102b7575f80fd5b506102d260048036038101906102cd9190612848565b610868565b6040516102df91906125fc565b60405180910390f35b3480156102f3575f80fd5b506102fc6108ba565b005b348015610309575f80fd5b50610324600480360381019061031f9190612848565b610951565b6040516103319190612624565b60405180910390f35b348015610345575f80fd5b5061034e610997565b005b34801561035b575f80fd5b50610364610ae5565b005b348015610371575f80fd5b5061037a610c17565b6040516103879190612624565b60405180910390f35b34801561039b575f80fd5b506103a4610c1d565b6040516103b19190612882565b60405180910390f35b3480156103c5575f80fd5b506103ce610c44565b6040516103db9190612624565b60405180910390f35b3480156103ef575f80fd5b506103f8610c4a565b60405161040591906124e6565b60405180910390f35b348015610419575f80fd5b50610434600480360381019061042f91906125a4565b610c87565b60405161044191906125fc565b60405180910390f35b348015610455575f80fd5b5061045e610ca4565b60405161046b9190612624565b60405180910390f35b34801561047f575f80fd5b50610488610caa565b005b348015610495575f80fd5b506104b060048036038101906104ab9190612801565b6111ca565b005b3480156104bd575f80fd5b506104d860048036038101906104d3919061289b565b6112e9565b6040516104e59190612624565b60405180910390f35b3480156104f9575f80fd5b50610514600480360381019061050f91906128d9565b61136b565b005b60606040518060400160405280600d81526020017f5475626279205261696e626f7700000000000000000000000000000000000000815250905090565b5f61056661055f6113f7565b84846113fe565b6001905092915050565b60125481565b61057e6113f7565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461060a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106019061294e565b60405180910390fd5b5f600d819055507fe9b79e1a6c2dc43b4c0c6ff01ce9e3332d810e482270f464c0a21ad6c5fc6de35f60405161064091906129ae565b60405180910390a1565b5f6009600a6106599190612b23565b6461f313f8806106699190612b6d565b905090565b5f61067a8484846115c1565b610737846106866113f7565b610732856040518060600160405280602881526020016134f66028913960025f8b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6106e96113f7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054611f489092919063ffffffff16565b6113fe565b600190509392505050565b5f6009905090565b6107526113f7565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d59061294e565b60405180910390fd5b5f5b8151811015610864575f60045f848481518110610800576107ff612bae565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506107e0565b5050565b5f60045f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff169050919050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fa6113f7565b73ffffffffffffffffffffffffffffffffffffffff1614610919575f80fd5b5f61092330610951565b90505f8111156109375761093681611faa565b5b5f4790505f81111561094d5761094c81612215565b5b5050565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b61099f6113f7565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a229061294e565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35f805f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610aed6113f7565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b709061294e565b60405180910390fd5b6009600a610b879190612b23565b6461f313f880610b979190612b6d565b600f819055506009600a610bab9190612b23565b6461f313f880610bbb9190612b6d565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6009600a610bf09190612b23565b6461f313f880610c009190612b6d565b604051610c0d9190612624565b60405180910390a1565b600f5481565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60105481565b60606040518060400160405280600581526020017f5455424259000000000000000000000000000000000000000000000000000000815250905090565b5f610c9a610c936113f7565b84846115c1565b6001905092915050565b60115481565b610cb26113f7565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d359061294e565b60405180910390fd5b60148054906101000a900460ff1615610d8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8390612c25565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d60135f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e293060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166009600a610e149190612b23565b6461f313f880610e249190612b6d565b6113fe565b60135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e93573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610eb79190612c57565b73ffffffffffffffffffffffffffffffffffffffff1663c9c653963060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f3d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f619190612c57565b6040518363ffffffff1660e01b8152600401610f7e929190612c82565b6020604051808303815f875af1158015610f9a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fbe9190612c57565b60145f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061104530610951565b5f8061104f610c1d565b426040518863ffffffff1660e01b815260040161107196959493929190612ca9565b60606040518083038185885af115801561108d573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906110b29190612d1c565b50505060145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611152929190612d6c565b6020604051808303815f875af115801561116e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111929190612dbd565b506001601460166101000a81548160ff02191690831515021790555060016014806101000a81548160ff021916908315150217905550565b6111d26113f7565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461125e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112559061294e565b60405180910390fd5b5f5b81518110156112e557600160045f84848151811061128157611280612bae565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080600101915050611260565b5050565b5f60025f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113ab6113f7565b73ffffffffffffffffffffffffffffffffffffffff16146113ca575f80fd5b60085481111580156113de57506009548111155b6113e6575f80fd5b806008819055508060098190555050565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361146c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146390612e58565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036114da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d190612ee6565b60405180910390fd5b8060025f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115b49190612624565b60405180910390a3505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361162f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162690612f74565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361169d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169490613002565b60405180910390fd5b5f81116116df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116d690613090565b60405180910390fd5b5f6116e8610c1d565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156117565750611726610c1d565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611c985760045f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff161580156117f9575060045f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b611801575f80fd5b5f600e5403611849576118466064611838600a54600e541161182557600654611829565b6008545b8561227d90919063ffffffff16565b6122f490919063ffffffff16565b90505b5f600e54111561187e5761187b606461186d600d548561227d90919063ffffffff16565b6122f490919063ffffffff16565b90505b60145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611927575060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561197a575060035f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b15611a7257600f548211156119c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119bb906130f8565b60405180910390fd5b601054826119d185610951565b6119db9190613116565b1115611a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1390613193565b60405180910390fd5b611a586064611a4a600a54600e5411611a3757600654611a3b565b6008545b8561227d90919063ffffffff16565b6122f490919063ffffffff16565b9050600e5f815480929190611a6c906131b1565b91905055505b60145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611afa57503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611b3e57611b3b6064611b2d600b54600e5411611b1a57600754611b1e565b6009545b8561227d90919063ffffffff16565b6122f490919063ffffffff16565b90505b5f611b4830610951565b9050601460159054906101000a900460ff16158015611bb3575060145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b8015611bcb5750601460169054906101000a900460ff165b8015611bd8575060115481115b8015611be75750600c54600e54115b15611c9657601654431115611bfe575f6015819055505b600360155410611c43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3a90613242565b60405180910390fd5b611c60611c5b84611c568460125461233d565b61233d565b611faa565b5f4790505f811115611c7657611c7547612215565b5b60155f815480929190611c88906131b1565b919050555043601681905550505b505b5f811115611d9757611cf08160015f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205461235590919063ffffffff16565b60015f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611d8e9190612624565b60405180910390a35b611de78260015f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20546123b290919063ffffffff16565b60015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550611e8a611e3e82846123b290919063ffffffff16565b60015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205461235590919063ffffffff16565b60015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef611f2d84866123b290919063ffffffff16565b604051611f3a9190612624565b60405180910390a350505050565b5f838311158290611f8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f8691906124e6565b60405180910390fd5b505f8385611f9d9190613260565b9050809150509392505050565b6001601460156101000a81548160ff0219169083151502179055505f600267ffffffffffffffff811115611fe157611fe06126c5565b5b60405190808252806020026020018201604052801561200f5781602001602082028036833780820191505090505b50905030815f8151811061202657612025612bae565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156120ca573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906120ee9190612c57565b8160018151811061210257612101612bae565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506121683060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113fe565b60135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947835f8430426040518663ffffffff1660e01b81526004016121ca95949392919061334a565b5f604051808303815f87803b1580156121e1575f80fd5b505af11580156121f3573d5f803e3d5ffd5b50505050505f601460156101000a81548160ff02191690831515021790555050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f19350505050158015612279573d5f803e3d5ffd5b5050565b5f80830361228d575f90506122ee565b5f828461229a9190612b6d565b90508284826122a991906133cf565b146122e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122e09061346f565b60405180910390fd5b809150505b92915050565b5f61233583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506123fb565b905092915050565b5f81831161234b578261234d565b815b905092915050565b5f8082846123639190613116565b9050838110156123a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239f906134d7565b60405180910390fd5b8091505092915050565b5f6123f383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f48565b905092915050565b5f8083118290612441576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161243891906124e6565b60405180910390fd5b505f838561244f91906133cf565b9050809150509392505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b83811015612493578082015181840152602081019050612478565b5f8484015250505050565b5f601f19601f8301169050919050565b5f6124b88261245c565b6124c28185612466565b93506124d2818560208601612476565b6124db8161249e565b840191505092915050565b5f6020820190508181035f8301526124fe81846124ae565b905092915050565b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61254082612517565b9050919050565b61255081612536565b811461255a575f80fd5b50565b5f8135905061256b81612547565b92915050565b5f819050919050565b61258381612571565b811461258d575f80fd5b50565b5f8135905061259e8161257a565b92915050565b5f80604083850312156125ba576125b961250f565b5b5f6125c78582860161255d565b92505060206125d885828601612590565b9150509250929050565b5f8115159050919050565b6125f6816125e2565b82525050565b5f60208201905061260f5f8301846125ed565b92915050565b61261e81612571565b82525050565b5f6020820190506126375f830184612615565b92915050565b5f805f606084860312156126545761265361250f565b5b5f6126618682870161255d565b93505060206126728682870161255d565b925050604061268386828701612590565b9150509250925092565b5f60ff82169050919050565b6126a28161268d565b82525050565b5f6020820190506126bb5f830184612699565b92915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6126fb8261249e565b810181811067ffffffffffffffff8211171561271a576127196126c5565b5b80604052505050565b5f61272c612506565b905061273882826126f2565b919050565b5f67ffffffffffffffff821115612757576127566126c5565b5b602082029050602081019050919050565b5f80fd5b5f61277e6127798461273d565b612723565b905080838252602082019050602084028301858111156127a1576127a0612768565b5b835b818110156127ca57806127b6888261255d565b8452602084019350506020810190506127a3565b5050509392505050565b5f82601f8301126127e8576127e76126c1565b5b81356127f884826020860161276c565b91505092915050565b5f602082840312156128165761281561250f565b5b5f82013567ffffffffffffffff81111561283357612832612513565b5b61283f848285016127d4565b91505092915050565b5f6020828403121561285d5761285c61250f565b5b5f61286a8482850161255d565b91505092915050565b61287c81612536565b82525050565b5f6020820190506128955f830184612873565b92915050565b5f80604083850312156128b1576128b061250f565b5b5f6128be8582860161255d565b92505060206128cf8582860161255d565b9150509250929050565b5f602082840312156128ee576128ed61250f565b5b5f6128fb84828501612590565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f612938602083612466565b915061294382612904565b602082019050919050565b5f6020820190508181035f8301526129658161292c565b9050919050565b5f819050919050565b5f819050919050565b5f61299861299361298e8461296c565b612975565b612571565b9050919050565b6129a88161297e565b82525050565b5f6020820190506129c15f83018461299f565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b6001851115612a4957808604811115612a2557612a246129c7565b5b6001851615612a345780820291505b8081029050612a42856129f4565b9450612a09565b94509492505050565b5f82612a615760019050612b1c565b81612a6e575f9050612b1c565b8160018114612a845760028114612a8e57612abd565b6001915050612b1c565b60ff841115612aa057612a9f6129c7565b5b8360020a915084821115612ab757612ab66129c7565b5b50612b1c565b5060208310610133831016604e8410600b8410161715612af25782820a905083811115612aed57612aec6129c7565b5b612b1c565b612aff8484846001612a00565b92509050818404811115612b1657612b156129c7565b5b81810290505b9392505050565b5f612b2d82612571565b9150612b388361268d565b9250612b657fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484612a52565b905092915050565b5f612b7782612571565b9150612b8283612571565b9250828202612b9081612571565b91508282048414831517612ba757612ba66129c7565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f74726164696e6720697320616c7265616479206f70656e0000000000000000005f82015250565b5f612c0f601783612466565b9150612c1a82612bdb565b602082019050919050565b5f6020820190508181035f830152612c3c81612c03565b9050919050565b5f81519050612c5181612547565b92915050565b5f60208284031215612c6c57612c6b61250f565b5b5f612c7984828501612c43565b91505092915050565b5f604082019050612c955f830185612873565b612ca26020830184612873565b9392505050565b5f60c082019050612cbc5f830189612873565b612cc96020830188612615565b612cd6604083018761299f565b612ce3606083018661299f565b612cf06080830185612873565b612cfd60a0830184612615565b979650505050505050565b5f81519050612d168161257a565b92915050565b5f805f60608486031215612d3357612d3261250f565b5b5f612d4086828701612d08565b9350506020612d5186828701612d08565b9250506040612d6286828701612d08565b9150509250925092565b5f604082019050612d7f5f830185612873565b612d8c6020830184612615565b9392505050565b612d9c816125e2565b8114612da6575f80fd5b50565b5f81519050612db781612d93565b92915050565b5f60208284031215612dd257612dd161250f565b5b5f612ddf84828501612da9565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f612e42602483612466565b9150612e4d82612de8565b604082019050919050565b5f6020820190508181035f830152612e6f81612e36565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f612ed0602283612466565b9150612edb82612e76565b604082019050919050565b5f6020820190508181035f830152612efd81612ec4565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f612f5e602583612466565b9150612f6982612f04565b604082019050919050565b5f6020820190508181035f830152612f8b81612f52565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f612fec602383612466565b9150612ff782612f92565b604082019050919050565b5f6020820190508181035f83015261301981612fe0565b9050919050565b7f5472616e7366657220616d6f756e74206d7573742062652067726561746572205f8201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b5f61307a602983612466565b915061308582613020565b604082019050919050565b5f6020820190508181035f8301526130a78161306e565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e000000000000005f82015250565b5f6130e2601983612466565b91506130ed826130ae565b602082019050919050565b5f6020820190508181035f83015261310f816130d6565b9050919050565b5f61312082612571565b915061312b83612571565b9250828201905080821115613143576131426129c7565b5b92915050565b7f4578636565647320746865206d617857616c6c657453697a652e0000000000005f82015250565b5f61317d601a83612466565b915061318882613149565b602082019050919050565b5f6020820190508181035f8301526131aa81613171565b9050919050565b5f6131bb82612571565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036131ed576131ec6129c7565b5b600182019050919050565b7f4f6e6c7920332073656c6c732070657220626c6f636b210000000000000000005f82015250565b5f61322c601783612466565b9150613237826131f8565b602082019050919050565b5f6020820190508181035f83015261325981613220565b9050919050565b5f61326a82612571565b915061327583612571565b925082820390508181111561328d5761328c6129c7565b5b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b6132c581612536565b82525050565b5f6132d683836132bc565b60208301905092915050565b5f602082019050919050565b5f6132f882613293565b613302818561329d565b935061330d836132ad565b805f5b8381101561333d57815161332488826132cb565b975061332f836132e2565b925050600181019050613310565b5085935050505092915050565b5f60a08201905061335d5f830188612615565b61336a602083018761299f565b818103604083015261337c81866132ee565b905061338b6060830185612873565b6133986080830184612615565b9695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6133d982612571565b91506133e483612571565b9250826133f4576133f36133a2565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f5f8201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b5f613459602183612466565b9150613464826133ff565b604082019050919050565b5f6020820190508181035f8301526134868161344d565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f7700000000005f82015250565b5f6134c1601b83612466565b91506134cc8261348d565b602082019050919050565b5f6020820190508181035f8301526134ee816134b5565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e7b87bd5dc51122c817aa64c202a8789e1dad4991905fefb42a8f0d67652036b64736f6c63430008170033
608060405260043610610143575f3560e01c8063715018a6116100b5578063a9059cbb1161006e578063a9059cbb1461040e578063bf474bed1461044a578063c9567bf914610474578063d34628cc1461048a578063dd62ed3e146104b2578063ec1f3f63146104ee5761014a565b8063715018a61461033a578063751039fc146103505780637d1db4a5146103665780638da5cb5b146103905780638f9a55c0146103ba57806395d89b41146103e45761014a565b806323b872dd1161010757806323b872dd1461021e578063313ce5671461025a57806331c2d847146102845780633bbac579146102ac57806351bc3c85146102e857806370a08231146102fe5761014a565b806306fdde031461014e578063095ea7b3146101785780630faee56f146101b4578063109daa99146101de57806318160ddd146101f45761014a565b3661014a57005b5f80fd5b348015610159575f80fd5b50610162610516565b60405161016f91906124e6565b60405180910390f35b348015610183575f80fd5b5061019e600480360381019061019991906125a4565b610553565b6040516101ab91906125fc565b60405180910390f35b3480156101bf575f80fd5b506101c8610570565b6040516101d59190612624565b60405180910390f35b3480156101e9575f80fd5b506101f2610576565b005b3480156101ff575f80fd5b5061020861064a565b6040516102159190612624565b60405180910390f35b348015610229575f80fd5b50610244600480360381019061023f919061263d565b61066e565b60405161025191906125fc565b60405180910390f35b348015610265575f80fd5b5061026e610742565b60405161027b91906126a8565b60405180910390f35b34801561028f575f80fd5b506102aa60048036038101906102a59190612801565b61074a565b005b3480156102b7575f80fd5b506102d260048036038101906102cd9190612848565b610868565b6040516102df91906125fc565b60405180910390f35b3480156102f3575f80fd5b506102fc6108ba565b005b348015610309575f80fd5b50610324600480360381019061031f9190612848565b610951565b6040516103319190612624565b60405180910390f35b348015610345575f80fd5b5061034e610997565b005b34801561035b575f80fd5b50610364610ae5565b005b348015610371575f80fd5b5061037a610c17565b6040516103879190612624565b60405180910390f35b34801561039b575f80fd5b506103a4610c1d565b6040516103b19190612882565b60405180910390f35b3480156103c5575f80fd5b506103ce610c44565b6040516103db9190612624565b60405180910390f35b3480156103ef575f80fd5b506103f8610c4a565b60405161040591906124e6565b60405180910390f35b348015610419575f80fd5b50610434600480360381019061042f91906125a4565b610c87565b60405161044191906125fc565b60405180910390f35b348015610455575f80fd5b5061045e610ca4565b60405161046b9190612624565b60405180910390f35b34801561047f575f80fd5b50610488610caa565b005b348015610495575f80fd5b506104b060048036038101906104ab9190612801565b6111ca565b005b3480156104bd575f80fd5b506104d860048036038101906104d3919061289b565b6112e9565b6040516104e59190612624565b60405180910390f35b3480156104f9575f80fd5b50610514600480360381019061050f91906128d9565b61136b565b005b60606040518060400160405280600d81526020017f5475626279205261696e626f7700000000000000000000000000000000000000815250905090565b5f61056661055f6113f7565b84846113fe565b6001905092915050565b60125481565b61057e6113f7565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461060a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106019061294e565b60405180910390fd5b5f600d819055507fe9b79e1a6c2dc43b4c0c6ff01ce9e3332d810e482270f464c0a21ad6c5fc6de35f60405161064091906129ae565b60405180910390a1565b5f6009600a6106599190612b23565b6461f313f8806106699190612b6d565b905090565b5f61067a8484846115c1565b610737846106866113f7565b610732856040518060600160405280602881526020016134f66028913960025f8b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6106e96113f7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054611f489092919063ffffffff16565b6113fe565b600190509392505050565b5f6009905090565b6107526113f7565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d59061294e565b60405180910390fd5b5f5b8151811015610864575f60045f848481518110610800576107ff612bae565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506107e0565b5050565b5f60045f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff169050919050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fa6113f7565b73ffffffffffffffffffffffffffffffffffffffff1614610919575f80fd5b5f61092330610951565b90505f8111156109375761093681611faa565b5b5f4790505f81111561094d5761094c81612215565b5b5050565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b61099f6113f7565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a229061294e565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35f805f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610aed6113f7565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b709061294e565b60405180910390fd5b6009600a610b879190612b23565b6461f313f880610b979190612b6d565b600f819055506009600a610bab9190612b23565b6461f313f880610bbb9190612b6d565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6009600a610bf09190612b23565b6461f313f880610c009190612b6d565b604051610c0d9190612624565b60405180910390a1565b600f5481565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60105481565b60606040518060400160405280600581526020017f5455424259000000000000000000000000000000000000000000000000000000815250905090565b5f610c9a610c936113f7565b84846115c1565b6001905092915050565b60115481565b610cb26113f7565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d359061294e565b60405180910390fd5b60148054906101000a900460ff1615610d8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8390612c25565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d60135f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e293060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166009600a610e149190612b23565b6461f313f880610e249190612b6d565b6113fe565b60135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e93573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610eb79190612c57565b73ffffffffffffffffffffffffffffffffffffffff1663c9c653963060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f3d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f619190612c57565b6040518363ffffffff1660e01b8152600401610f7e929190612c82565b6020604051808303815f875af1158015610f9a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fbe9190612c57565b60145f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061104530610951565b5f8061104f610c1d565b426040518863ffffffff1660e01b815260040161107196959493929190612ca9565b60606040518083038185885af115801561108d573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906110b29190612d1c565b50505060145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611152929190612d6c565b6020604051808303815f875af115801561116e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111929190612dbd565b506001601460166101000a81548160ff02191690831515021790555060016014806101000a81548160ff021916908315150217905550565b6111d26113f7565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461125e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112559061294e565b60405180910390fd5b5f5b81518110156112e557600160045f84848151811061128157611280612bae565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080600101915050611260565b5050565b5f60025f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113ab6113f7565b73ffffffffffffffffffffffffffffffffffffffff16146113ca575f80fd5b60085481111580156113de57506009548111155b6113e6575f80fd5b806008819055508060098190555050565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361146c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146390612e58565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036114da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d190612ee6565b60405180910390fd5b8060025f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115b49190612624565b60405180910390a3505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361162f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162690612f74565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361169d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169490613002565b60405180910390fd5b5f81116116df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116d690613090565b60405180910390fd5b5f6116e8610c1d565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156117565750611726610c1d565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611c985760045f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff161580156117f9575060045f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b611801575f80fd5b5f600e5403611849576118466064611838600a54600e541161182557600654611829565b6008545b8561227d90919063ffffffff16565b6122f490919063ffffffff16565b90505b5f600e54111561187e5761187b606461186d600d548561227d90919063ffffffff16565b6122f490919063ffffffff16565b90505b60145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611927575060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561197a575060035f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b15611a7257600f548211156119c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119bb906130f8565b60405180910390fd5b601054826119d185610951565b6119db9190613116565b1115611a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1390613193565b60405180910390fd5b611a586064611a4a600a54600e5411611a3757600654611a3b565b6008545b8561227d90919063ffffffff16565b6122f490919063ffffffff16565b9050600e5f815480929190611a6c906131b1565b91905055505b60145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611afa57503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611b3e57611b3b6064611b2d600b54600e5411611b1a57600754611b1e565b6009545b8561227d90919063ffffffff16565b6122f490919063ffffffff16565b90505b5f611b4830610951565b9050601460159054906101000a900460ff16158015611bb3575060145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b8015611bcb5750601460169054906101000a900460ff165b8015611bd8575060115481115b8015611be75750600c54600e54115b15611c9657601654431115611bfe575f6015819055505b600360155410611c43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3a90613242565b60405180910390fd5b611c60611c5b84611c568460125461233d565b61233d565b611faa565b5f4790505f811115611c7657611c7547612215565b5b60155f815480929190611c88906131b1565b919050555043601681905550505b505b5f811115611d9757611cf08160015f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205461235590919063ffffffff16565b60015f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611d8e9190612624565b60405180910390a35b611de78260015f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20546123b290919063ffffffff16565b60015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550611e8a611e3e82846123b290919063ffffffff16565b60015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205461235590919063ffffffff16565b60015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef611f2d84866123b290919063ffffffff16565b604051611f3a9190612624565b60405180910390a350505050565b5f838311158290611f8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f8691906124e6565b60405180910390fd5b505f8385611f9d9190613260565b9050809150509392505050565b6001601460156101000a81548160ff0219169083151502179055505f600267ffffffffffffffff811115611fe157611fe06126c5565b5b60405190808252806020026020018201604052801561200f5781602001602082028036833780820191505090505b50905030815f8151811061202657612025612bae565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156120ca573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906120ee9190612c57565b8160018151811061210257612101612bae565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506121683060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113fe565b60135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947835f8430426040518663ffffffff1660e01b81526004016121ca95949392919061334a565b5f604051808303815f87803b1580156121e1575f80fd5b505af11580156121f3573d5f803e3d5ffd5b50505050505f601460156101000a81548160ff02191690831515021790555050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f19350505050158015612279573d5f803e3d5ffd5b5050565b5f80830361228d575f90506122ee565b5f828461229a9190612b6d565b90508284826122a991906133cf565b146122e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122e09061346f565b60405180910390fd5b809150505b92915050565b5f61233583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506123fb565b905092915050565b5f81831161234b578261234d565b815b905092915050565b5f8082846123639190613116565b9050838110156123a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239f906134d7565b60405180910390fd5b8091505092915050565b5f6123f383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f48565b905092915050565b5f8083118290612441576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161243891906124e6565b60405180910390fd5b505f838561244f91906133cf565b9050809150509392505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b83811015612493578082015181840152602081019050612478565b5f8484015250505050565b5f601f19601f8301169050919050565b5f6124b88261245c565b6124c28185612466565b93506124d2818560208601612476565b6124db8161249e565b840191505092915050565b5f6020820190508181035f8301526124fe81846124ae565b905092915050565b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61254082612517565b9050919050565b61255081612536565b811461255a575f80fd5b50565b5f8135905061256b81612547565b92915050565b5f819050919050565b61258381612571565b811461258d575f80fd5b50565b5f8135905061259e8161257a565b92915050565b5f80604083850312156125ba576125b961250f565b5b5f6125c78582860161255d565b92505060206125d885828601612590565b9150509250929050565b5f8115159050919050565b6125f6816125e2565b82525050565b5f60208201905061260f5f8301846125ed565b92915050565b61261e81612571565b82525050565b5f6020820190506126375f830184612615565b92915050565b5f805f606084860312156126545761265361250f565b5b5f6126618682870161255d565b93505060206126728682870161255d565b925050604061268386828701612590565b9150509250925092565b5f60ff82169050919050565b6126a28161268d565b82525050565b5f6020820190506126bb5f830184612699565b92915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6126fb8261249e565b810181811067ffffffffffffffff8211171561271a576127196126c5565b5b80604052505050565b5f61272c612506565b905061273882826126f2565b919050565b5f67ffffffffffffffff821115612757576127566126c5565b5b602082029050602081019050919050565b5f80fd5b5f61277e6127798461273d565b612723565b905080838252602082019050602084028301858111156127a1576127a0612768565b5b835b818110156127ca57806127b6888261255d565b8452602084019350506020810190506127a3565b5050509392505050565b5f82601f8301126127e8576127e76126c1565b5b81356127f884826020860161276c565b91505092915050565b5f602082840312156128165761281561250f565b5b5f82013567ffffffffffffffff81111561283357612832612513565b5b61283f848285016127d4565b91505092915050565b5f6020828403121561285d5761285c61250f565b5b5f61286a8482850161255d565b91505092915050565b61287c81612536565b82525050565b5f6020820190506128955f830184612873565b92915050565b5f80604083850312156128b1576128b061250f565b5b5f6128be8582860161255d565b92505060206128cf8582860161255d565b9150509250929050565b5f602082840312156128ee576128ed61250f565b5b5f6128fb84828501612590565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f612938602083612466565b915061294382612904565b602082019050919050565b5f6020820190508181035f8301526129658161292c565b9050919050565b5f819050919050565b5f819050919050565b5f61299861299361298e8461296c565b612975565b612571565b9050919050565b6129a88161297e565b82525050565b5f6020820190506129c15f83018461299f565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b6001851115612a4957808604811115612a2557612a246129c7565b5b6001851615612a345780820291505b8081029050612a42856129f4565b9450612a09565b94509492505050565b5f82612a615760019050612b1c565b81612a6e575f9050612b1c565b8160018114612a845760028114612a8e57612abd565b6001915050612b1c565b60ff841115612aa057612a9f6129c7565b5b8360020a915084821115612ab757612ab66129c7565b5b50612b1c565b5060208310610133831016604e8410600b8410161715612af25782820a905083811115612aed57612aec6129c7565b5b612b1c565b612aff8484846001612a00565b92509050818404811115612b1657612b156129c7565b5b81810290505b9392505050565b5f612b2d82612571565b9150612b388361268d565b9250612b657fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484612a52565b905092915050565b5f612b7782612571565b9150612b8283612571565b9250828202612b9081612571565b91508282048414831517612ba757612ba66129c7565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f74726164696e6720697320616c7265616479206f70656e0000000000000000005f82015250565b5f612c0f601783612466565b9150612c1a82612bdb565b602082019050919050565b5f6020820190508181035f830152612c3c81612c03565b9050919050565b5f81519050612c5181612547565b92915050565b5f60208284031215612c6c57612c6b61250f565b5b5f612c7984828501612c43565b91505092915050565b5f604082019050612c955f830185612873565b612ca26020830184612873565b9392505050565b5f60c082019050612cbc5f830189612873565b612cc96020830188612615565b612cd6604083018761299f565b612ce3606083018661299f565b612cf06080830185612873565b612cfd60a0830184612615565b979650505050505050565b5f81519050612d168161257a565b92915050565b5f805f60608486031215612d3357612d3261250f565b5b5f612d4086828701612d08565b9350506020612d5186828701612d08565b9250506040612d6286828701612d08565b9150509250925092565b5f604082019050612d7f5f830185612873565b612d8c6020830184612615565b9392505050565b612d9c816125e2565b8114612da6575f80fd5b50565b5f81519050612db781612d93565b92915050565b5f60208284031215612dd257612dd161250f565b5b5f612ddf84828501612da9565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f612e42602483612466565b9150612e4d82612de8565b604082019050919050565b5f6020820190508181035f830152612e6f81612e36565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f612ed0602283612466565b9150612edb82612e76565b604082019050919050565b5f6020820190508181035f830152612efd81612ec4565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f612f5e602583612466565b9150612f6982612f04565b604082019050919050565b5f6020820190508181035f830152612f8b81612f52565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f612fec602383612466565b9150612ff782612f92565b604082019050919050565b5f6020820190508181035f83015261301981612fe0565b9050919050565b7f5472616e7366657220616d6f756e74206d7573742062652067726561746572205f8201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b5f61307a602983612466565b915061308582613020565b604082019050919050565b5f6020820190508181035f8301526130a78161306e565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e000000000000005f82015250565b5f6130e2601983612466565b91506130ed826130ae565b602082019050919050565b5f6020820190508181035f83015261310f816130d6565b9050919050565b5f61312082612571565b915061312b83612571565b9250828201905080821115613143576131426129c7565b5b92915050565b7f4578636565647320746865206d617857616c6c657453697a652e0000000000005f82015250565b5f61317d601a83612466565b915061318882613149565b602082019050919050565b5f6020820190508181035f8301526131aa81613171565b9050919050565b5f6131bb82612571565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036131ed576131ec6129c7565b5b600182019050919050565b7f4f6e6c7920332073656c6c732070657220626c6f636b210000000000000000005f82015250565b5f61322c601783612466565b9150613237826131f8565b602082019050919050565b5f6020820190508181035f83015261325981613220565b9050919050565b5f61326a82612571565b915061327583612571565b925082820390508181111561328d5761328c6129c7565b5b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b6132c581612536565b82525050565b5f6132d683836132bc565b60208301905092915050565b5f602082019050919050565b5f6132f882613293565b613302818561329d565b935061330d836132ad565b805f5b8381101561333d57815161332488826132cb565b975061332f836132e2565b925050600181019050613310565b5085935050505092915050565b5f60a08201905061335d5f830188612615565b61336a602083018761299f565b818103604083015261337c81866132ee565b905061338b6060830185612873565b6133986080830184612615565b9695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6133d982612571565b91506133e483612571565b9250826133f4576133f36133a2565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f5f8201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b5f613459602183612466565b9150613464826133ff565b604082019050919050565b5f6020820190508181035f8301526134868161344d565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f7700000000005f82015250565b5f6134c1601b83612466565b91506134cc8261348d565b602082019050919050565b5f6020820190508181035f8301526134ee816134b5565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e7b87bd5dc51122c817aa64c202a8789e1dad4991905fefb42a8f0d67652036b64736f6c63430008170033
// SPDX-License-Identifier: UNLICENSE /* TUBBY RAINBOW from Matt Furie https://x.com/tubbyrainbowsoc https://t.me/TubbyRainbowPortal https://tubbyrainboweth.vip/ */ pragma solidity 0.8.23; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, 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 sender, address recipient, 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); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; 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); } contract TUBBY is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; address payable private _taxWallet; uint256 private _initialBuyTax=15; uint256 private _initialSellTax=20; uint256 private _finalBuyTax=0; uint256 private _finalSellTax=0; uint256 private _reduceBuyTaxAt=20; uint256 private _reduceSellTaxAt=20; uint256 private _preventSwapBefore=20; uint256 private _transferTax=0; uint256 private _buyCount=0; uint8 private constant _decimals = 9; uint256 private constant _tTotal = 420690000000 * 10**_decimals; string private constant _name = unicode"Tubby Rainbow"; string private constant _symbol = unicode"TUBBY"; uint256 public _maxTxAmount = 8400000000 * 10**_decimals; uint256 public _maxWalletSize = 8400000000 * 10**_decimals; uint256 public _taxSwapThreshold= 4200000000 * 10**_decimals; uint256 public _maxTaxSwap= 4200000000 * 10**_decimals; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private sellCount = 0; uint256 private lastSellBlock = 0; event MaxTxAmountUpdated(uint _maxTxAmount); event TransferTaxUpdated(uint _tax); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _balances[_msgSender()] = _tTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _approve(address owner, address spender, uint256 amount) private { 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 _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); uint256 taxAmount=0; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if(_buyCount==0){ taxAmount = amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100); } if(_buyCount>0){ taxAmount = amount.mul(_transferTax).div(100); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] ) { require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); taxAmount = amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100); _buyCount++; } if(to == uniswapV2Pair && from!= address(this) ){ taxAmount = amount.mul((_buyCount>_reduceSellTaxAt)?_finalSellTax:_initialSellTax).div(100); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && to == uniswapV2Pair && swapEnabled && contractTokenBalance > _taxSwapThreshold && _buyCount > _preventSwapBefore) { if (block.number > lastSellBlock) { sellCount = 0; } require(sellCount < 3, "Only 3 sells per block!"); swapTokensForEth(min(amount, min(contractTokenBalance, _maxTaxSwap))); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } sellCount++; lastSellBlock = block.number; } } if(taxAmount>0){ _balances[address(this)]=_balances[address(this)].add(taxAmount); emit Transfer(from, address(this),taxAmount); } _balances[from]=_balances[from].sub(amount); _balances[to]=_balances[to].add(amount.sub(taxAmount)); emit Transfer(from, to, amount.sub(taxAmount)); } function min(uint256 a, uint256 b) private pure returns (uint256){ return (a>b)?b:a; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize=_tTotal; emit MaxTxAmountUpdated(_tTotal); } function removeTransferTax() external onlyOwner{ _transferTax = 0; emit TransferTaxUpdated(0); } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function addBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBots(address[] memory notbot) public onlyOwner { for (uint i = 0; i < notbot.length; i++) { bots[notbot[i]] = false; } } function isBot(address a) public view returns (bool){ return bots[a]; } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); swapEnabled = true; tradingOpen = true; } function reduceFee(uint256 _newFee) external{ require(_msgSender()==_taxWallet); require(_newFee<=_finalBuyTax && _newFee<=_finalSellTax); _finalBuyTax=_newFee; _finalSellTax=_newFee; } receive() external payable {} function manualSwap() external { require(_msgSender()==_taxWallet); uint256 tokenBalance=balanceOf(address(this)); if(tokenBalance>0){ swapTokensForEth(tokenBalance); } uint256 ethBalance=address(this).balance; if(ethBalance>0){ sendETHToFee(ethBalance); } } }
1
20,291,105
c677aee7f96e517a750709888a629770829dc1310ce9a439135dcd112b63894c
4e61957d79dd8acf364ecab2d479e2d54c627aa2576332b646a1c7972ffc79d7
2a31995b21fd1986642ee778cacc3450b6b9593c
2a31995b21fd1986642ee778cacc3450b6b9593c
6d9829bd1f77762236e3757f62c414b1f0cb6033
6080604052602860055560006006556000600755600060085560126009556012600a556012600b556000600c556009600a6200003c9190620005f1565b60646200004a919062000642565b600d556009600a6200005d9190620005f1565b60646200006b919062000642565b600e556009600a6200007e9190620005f1565b60326200008c919062000642565b600f556009600a6200009f9190620005f1565b6103e8620000ae919062000642565b6010556000601260156101000a81548160ff0219169083151502179055506000601260166101000a81548160ff02191690831515021790555060006013556000601455348015620000fe57600080fd5b506000620001116200042660201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350620001bf6200042660201b60201c565b600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506009600a6200020f9190620005f1565b6103e86200021e919062000642565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600160036000620002776200042e60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160036000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055503073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6009600a620003fa9190620005f1565b6103e862000409919062000642565b6040516200041891906200069e565b60405180910390a3620006bb565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008160011c9050919050565b6000808291508390505b6001851115620004e557808604811115620004bd57620004bc62000457565b5b6001851615620004cd5780820291505b8081029050620004dd8562000486565b94506200049d565b94509492505050565b600082620005005760019050620005d3565b81620005105760009050620005d3565b816001811462000529576002811462000534576200056a565b6001915050620005d3565b60ff84111562000549576200054862000457565b5b8360020a91508482111562000563576200056262000457565b5b50620005d3565b5060208310610133831016604e8410600b8410161715620005a45782820a9050838111156200059e576200059d62000457565b5b620005d3565b620005b3848484600162000493565b92509050818404811115620005cd57620005cc62000457565b5b81810290505b9392505050565b6000819050919050565b600060ff82169050919050565b6000620005fe82620005da565b91506200060b83620005e4565b92506200063a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484620004ee565b905092915050565b60006200064f82620005da565b91506200065c83620005da565b92508282026200066c81620005da565b9150828204841483151762000686576200068562000457565b5b5092915050565b6200069881620005da565b82525050565b6000602082019050620006b560008301846200068d565b92915050565b61327480620006cb6000396000f3fe6080604052600436106101235760003560e01c80637d1db4a5116100a0578063a9059cbb11610064578063a9059cbb146103ac578063bf474bed146103e9578063c9567bf914610414578063dd62ed3e1461041e578063ec1f3f631461045b5761012a565b80637d1db4a5146102d75780638cd4426d146103025780638da5cb5b1461032b5780638f9a55c01461035657806395d89b41146103815761012a565b8063313ce567116100e7578063313ce5671461022a57806351bc3c85146102555780636597e6fa1461026c57806370a0823114610283578063715018a6146102c05761012a565b806306fdde031461012f578063095ea7b31461015a5780630faee56f1461019757806318160ddd146101c257806323b872dd146101ed5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610484565b604051610151919061225e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190612319565b6104c1565b60405161018e9190612374565b60405180910390f35b3480156101a357600080fd5b506101ac6104df565b6040516101b9919061239e565b60405180910390f35b3480156101ce57600080fd5b506101d76104e5565b6040516101e4919061239e565b60405180910390f35b3480156101f957600080fd5b50610214600480360381019061020f91906123b9565b610507565b6040516102219190612374565b60405180910390f35b34801561023657600080fd5b5061023f6105e0565b60405161024c9190612428565b60405180910390f35b34801561026157600080fd5b5061026a6105e9565b005b34801561027857600080fd5b5061028161069e565b005b34801561028f57600080fd5b506102aa60048036038101906102a59190612443565b6107c8565b6040516102b7919061239e565b60405180910390f35b3480156102cc57600080fd5b506102d5610811565b005b3480156102e357600080fd5b506102ec610964565b6040516102f9919061239e565b60405180910390f35b34801561030e57600080fd5b5061032960048036038101906103249190612319565b61096a565b005b34801561033757600080fd5b50610340610b14565b60405161034d919061247f565b60405180910390f35b34801561036257600080fd5b5061036b610b3d565b604051610378919061239e565b60405180910390f35b34801561038d57600080fd5b50610396610b43565b6040516103a3919061225e565b60405180910390f35b3480156103b857600080fd5b506103d360048036038101906103ce9190612319565b610b80565b6040516103e09190612374565b60405180910390f35b3480156103f557600080fd5b506103fe610b9e565b60405161040b919061239e565b60405180910390f35b61041c610ba4565b005b34801561042a57600080fd5b506104456004803603810190610440919061249a565b6110da565b604051610452919061239e565b60405180910390f35b34801561046757600080fd5b50610482600480360381019061047d91906124da565b611161565b005b60606040518060400160405280600881526020017f5472756d70756d70000000000000000000000000000000000000000000000000815250905090565b60006104d56104ce6111f0565b84846111f8565b6001905092915050565b60105481565b60006009600a6104f59190612669565b6103e861050291906126b4565b905090565b60006105148484846113c1565b6105d5846105206111f0565b6105d08560405180606001604052806028815260200161321760289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105866111f0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9d9092919063ffffffff16565b6111f8565b600190509392505050565b60006009905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661062a6111f0565b73ffffffffffffffffffffffffffffffffffffffff161461064a57600080fd5b6000610655306107c8565b90506000811180156106735750601260169054906101000a900460ff165b156106825761068181611d01565b5b6000479050600081111561069a5761069981611f7a565b5b5050565b6106a66111f0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a90612742565b60405180910390fd5b6009600a6107419190612669565b6103e861074e91906126b4565b600d819055506009600a6107629190612669565b6103e861076f91906126b4565b600e819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6009600a6107a49190612669565b6103e86107b191906126b4565b6040516107be919061239e565b60405180910390a1565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108196111f0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089d90612742565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d5481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ab6111f0565b73ffffffffffffffffffffffffffffffffffffffff16146109cb57600080fd5b6000610a6c6064610a5e848673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a0f919061247f565b602060405180830381865afa158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a509190612777565b611fe690919063ffffffff16565b61206090919063ffffffff16565b90508273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401610acb929190612803565b6020604051808303816000875af1158015610aea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0e9190612858565b50505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600e5481565b60606040518060400160405280600881526020017f5472756d70756d70000000000000000000000000000000000000000000000000815250905090565b6000610b94610b8d6111f0565b84846113c1565b6001905092915050565b600f5481565b610bac6111f0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3090612742565b60405180910390fd5b601260149054906101000a900460ff1615610c89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c80906128d1565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d2530601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166009600a610d139190612669565b6103e8610d2091906126b4565b6111f8565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db69190612906565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e639190612906565b6040518363ffffffff1660e01b8152600401610e80929190612933565b6020604051808303816000875af1158015610e9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec39190612906565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7193430610f4c306107c8565b600080610f57610b14565b426040518863ffffffff1660e01b8152600401610f7996959493929190612997565b60606040518083038185885af1158015610f97573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fbc91906129f8565b505050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612a4b565b6020604051808303816000875af115801561107d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a19190612858565b506001601260166101000a81548160ff0219169083151502179055506001601260146101000a81548160ff021916908315150217905550565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a26111f0565b73ffffffffffffffffffffffffffffffffffffffff16146111c257600080fd5b60075481111580156111d657506008548111155b6111df57600080fd5b806007819055508060088190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611267576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125e90612ae6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036112d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cd90612b78565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516113b4919061239e565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611430576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142790612c0a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149690612c9c565b60405180910390fd5b600081116114e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d990612d2e565b60405180910390fd5b60006114ec610b14565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561155a575061152a610b14565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115b45750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156119e0576115f560646115e7600954600c54116115d4576005546115d8565b6007545b85611fe690919063ffffffff16565b61206090919063ffffffff16565b9050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156116a25750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116f85750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156117b357600d54821115611742576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173990612d9a565b60405180910390fd5b600e548261174f856107c8565b6117599190612dba565b111561179a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179190612e3a565b60405180910390fd5b600c60008154809291906117ad90612e5a565b91905055505b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561183c57503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156118805761187d606461186f600a54600c541161185c57600654611860565b6008545b85611fe690919063ffffffff16565b61206090919063ffffffff16565b90505b600061188b306107c8565b9050601260159054906101000a900460ff161580156118f75750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b801561190f5750601260169054906101000a900460ff165b801561191c5750600f5481115b801561192b5750600b54600c54115b156119de576014544311156119435760006013819055505b600360135410611988576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197f90612eee565b60405180910390fd5b6119a56119a08461199b846010546120aa565b6120aa565b611d01565b600047905060008111156119bd576119bc47611f7a565b5b601360008154809291906119d090612e5a565b919050555043601481905550505b505b6000811115611ae457611a3b81600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120c390919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611adb919061239e565b60405180910390a35b611b3682600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461212190919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bdd611b8f828461212190919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120c390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef611c82848661212190919063ffffffff16565b604051611c8f919061239e565b60405180910390a350505050565b6000838311158290611ce5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cdc919061225e565b60405180910390fd5b5060008385611cf49190612f0e565b9050809150509392505050565b6001601260156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d3957611d38612f42565b5b604051908082528060200260200182016040528015611d675781602001602082028036833780820191505090505b5090503081600081518110611d7f57611d7e612f71565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e4a9190612906565b81600181518110611e5e57611e5d612f71565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ec530601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846111f8565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f2995949392919061305e565b600060405180830381600087803b158015611f4357600080fd5b505af1158015611f57573d6000803e3d6000fd5b50505050506000601260156101000a81548160ff02191690831515021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611fe2573d6000803e3d6000fd5b5050565b6000808303611ff8576000905061205a565b6000828461200691906126b4565b905082848261201591906130e7565b14612055576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161204c9061318a565b60405180910390fd5b809150505b92915050565b60006120a283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061216b565b905092915050565b60008183116120b957826120bb565b815b905092915050565b60008082846120d29190612dba565b905083811015612117576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161210e906131f6565b60405180910390fd5b8091505092915050565b600061216383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c9d565b905092915050565b600080831182906121b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a9919061225e565b60405180910390fd5b50600083856121c191906130e7565b9050809150509392505050565b600081519050919050565b600082825260208201905092915050565b60005b838110156122085780820151818401526020810190506121ed565b60008484015250505050565b6000601f19601f8301169050919050565b6000612230826121ce565b61223a81856121d9565b935061224a8185602086016121ea565b61225381612214565b840191505092915050565b600060208201905081810360008301526122788184612225565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006122b082612285565b9050919050565b6122c0816122a5565b81146122cb57600080fd5b50565b6000813590506122dd816122b7565b92915050565b6000819050919050565b6122f6816122e3565b811461230157600080fd5b50565b600081359050612313816122ed565b92915050565b600080604083850312156123305761232f612280565b5b600061233e858286016122ce565b925050602061234f85828601612304565b9150509250929050565b60008115159050919050565b61236e81612359565b82525050565b60006020820190506123896000830184612365565b92915050565b612398816122e3565b82525050565b60006020820190506123b3600083018461238f565b92915050565b6000806000606084860312156123d2576123d1612280565b5b60006123e0868287016122ce565b93505060206123f1868287016122ce565b925050604061240286828701612304565b9150509250925092565b600060ff82169050919050565b6124228161240c565b82525050565b600060208201905061243d6000830184612419565b92915050565b60006020828403121561245957612458612280565b5b6000612467848285016122ce565b91505092915050565b612479816122a5565b82525050565b60006020820190506124946000830184612470565b92915050565b600080604083850312156124b1576124b0612280565b5b60006124bf858286016122ce565b92505060206124d0858286016122ce565b9150509250929050565b6000602082840312156124f0576124ef612280565b5b60006124fe84828501612304565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008160011c9050919050565b6000808291508390505b600185111561258d5780860481111561256957612568612507565b5b60018516156125785780820291505b808102905061258685612536565b945061254d565b94509492505050565b6000826125a65760019050612662565b816125b45760009050612662565b81600181146125ca57600281146125d457612603565b6001915050612662565b60ff8411156125e6576125e5612507565b5b8360020a9150848211156125fd576125fc612507565b5b50612662565b5060208310610133831016604e8410600b84101617156126385782820a90508381111561263357612632612507565b5b612662565b6126458484846001612543565b9250905081840481111561265c5761265b612507565b5b81810290505b9392505050565b6000612674826122e3565b915061267f8361240c565b92506126ac7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484612596565b905092915050565b60006126bf826122e3565b91506126ca836122e3565b92508282026126d8816122e3565b915082820484148315176126ef576126ee612507565b5b5092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061272c6020836121d9565b9150612737826126f6565b602082019050919050565b6000602082019050818103600083015261275b8161271f565b9050919050565b600081519050612771816122ed565b92915050565b60006020828403121561278d5761278c612280565b5b600061279b84828501612762565b91505092915050565b6000819050919050565b60006127c96127c46127bf84612285565b6127a4565b612285565b9050919050565b60006127db826127ae565b9050919050565b60006127ed826127d0565b9050919050565b6127fd816127e2565b82525050565b600060408201905061281860008301856127f4565b612825602083018461238f565b9392505050565b61283581612359565b811461284057600080fd5b50565b6000815190506128528161282c565b92915050565b60006020828403121561286e5761286d612280565b5b600061287c84828501612843565b91505092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006128bb6017836121d9565b91506128c682612885565b602082019050919050565b600060208201905081810360008301526128ea816128ae565b9050919050565b600081519050612900816122b7565b92915050565b60006020828403121561291c5761291b612280565b5b600061292a848285016128f1565b91505092915050565b60006040820190506129486000830185612470565b6129556020830184612470565b9392505050565b6000819050919050565b600061298161297c6129778461295c565b6127a4565b6122e3565b9050919050565b61299181612966565b82525050565b600060c0820190506129ac6000830189612470565b6129b9602083018861238f565b6129c66040830187612988565b6129d36060830186612988565b6129e06080830185612470565b6129ed60a083018461238f565b979650505050505050565b600080600060608486031215612a1157612a10612280565b5b6000612a1f86828701612762565b9350506020612a3086828701612762565b9250506040612a4186828701612762565b9150509250925092565b6000604082019050612a606000830185612470565b612a6d602083018461238f565b9392505050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612ad06024836121d9565b9150612adb82612a74565b604082019050919050565b60006020820190508181036000830152612aff81612ac3565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612b626022836121d9565b9150612b6d82612b06565b604082019050919050565b60006020820190508181036000830152612b9181612b55565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612bf46025836121d9565b9150612bff82612b98565b604082019050919050565b60006020820190508181036000830152612c2381612be7565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612c866023836121d9565b9150612c9182612c2a565b604082019050919050565b60006020820190508181036000830152612cb581612c79565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000612d186029836121d9565b9150612d2382612cbc565b604082019050919050565b60006020820190508181036000830152612d4781612d0b565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000612d846019836121d9565b9150612d8f82612d4e565b602082019050919050565b60006020820190508181036000830152612db381612d77565b9050919050565b6000612dc5826122e3565b9150612dd0836122e3565b9250828201905080821115612de857612de7612507565b5b92915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b6000612e24601a836121d9565b9150612e2f82612dee565b602082019050919050565b60006020820190508181036000830152612e5381612e17565b9050919050565b6000612e65826122e3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612e9757612e96612507565b5b600182019050919050565b7f4f6e6c7920332073656c6c732070657220626c6f636b21000000000000000000600082015250565b6000612ed86017836121d9565b9150612ee382612ea2565b602082019050919050565b60006020820190508181036000830152612f0781612ecb565b9050919050565b6000612f19826122e3565b9150612f24836122e3565b9250828203905081811115612f3c57612f3b612507565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612fd5816122a5565b82525050565b6000612fe78383612fcc565b60208301905092915050565b6000602082019050919050565b600061300b82612fa0565b6130158185612fab565b935061302083612fbc565b8060005b838110156130515781516130388882612fdb565b975061304383612ff3565b925050600181019050613024565b5085935050505092915050565b600060a082019050613073600083018861238f565b6130806020830187612988565b81810360408301526130928186613000565b90506130a16060830185612470565b6130ae608083018461238f565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006130f2826122e3565b91506130fd836122e3565b92508261310d5761310c6130b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006131746021836121d9565b915061317f82613118565b604082019050919050565b600060208201905081810360008301526131a381613167565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006131e0601b836121d9565b91506131eb826131aa565b602082019050919050565b6000602082019050818103600083015261320f816131d3565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c25d6373c951ac38587606d2233bc875862df4dd0ccdca4cd62e32fa5f00eb8e64736f6c63430008130033
6080604052600436106101235760003560e01c80637d1db4a5116100a0578063a9059cbb11610064578063a9059cbb146103ac578063bf474bed146103e9578063c9567bf914610414578063dd62ed3e1461041e578063ec1f3f631461045b5761012a565b80637d1db4a5146102d75780638cd4426d146103025780638da5cb5b1461032b5780638f9a55c01461035657806395d89b41146103815761012a565b8063313ce567116100e7578063313ce5671461022a57806351bc3c85146102555780636597e6fa1461026c57806370a0823114610283578063715018a6146102c05761012a565b806306fdde031461012f578063095ea7b31461015a5780630faee56f1461019757806318160ddd146101c257806323b872dd146101ed5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610484565b604051610151919061225e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190612319565b6104c1565b60405161018e9190612374565b60405180910390f35b3480156101a357600080fd5b506101ac6104df565b6040516101b9919061239e565b60405180910390f35b3480156101ce57600080fd5b506101d76104e5565b6040516101e4919061239e565b60405180910390f35b3480156101f957600080fd5b50610214600480360381019061020f91906123b9565b610507565b6040516102219190612374565b60405180910390f35b34801561023657600080fd5b5061023f6105e0565b60405161024c9190612428565b60405180910390f35b34801561026157600080fd5b5061026a6105e9565b005b34801561027857600080fd5b5061028161069e565b005b34801561028f57600080fd5b506102aa60048036038101906102a59190612443565b6107c8565b6040516102b7919061239e565b60405180910390f35b3480156102cc57600080fd5b506102d5610811565b005b3480156102e357600080fd5b506102ec610964565b6040516102f9919061239e565b60405180910390f35b34801561030e57600080fd5b5061032960048036038101906103249190612319565b61096a565b005b34801561033757600080fd5b50610340610b14565b60405161034d919061247f565b60405180910390f35b34801561036257600080fd5b5061036b610b3d565b604051610378919061239e565b60405180910390f35b34801561038d57600080fd5b50610396610b43565b6040516103a3919061225e565b60405180910390f35b3480156103b857600080fd5b506103d360048036038101906103ce9190612319565b610b80565b6040516103e09190612374565b60405180910390f35b3480156103f557600080fd5b506103fe610b9e565b60405161040b919061239e565b60405180910390f35b61041c610ba4565b005b34801561042a57600080fd5b506104456004803603810190610440919061249a565b6110da565b604051610452919061239e565b60405180910390f35b34801561046757600080fd5b50610482600480360381019061047d91906124da565b611161565b005b60606040518060400160405280600881526020017f5472756d70756d70000000000000000000000000000000000000000000000000815250905090565b60006104d56104ce6111f0565b84846111f8565b6001905092915050565b60105481565b60006009600a6104f59190612669565b6103e861050291906126b4565b905090565b60006105148484846113c1565b6105d5846105206111f0565b6105d08560405180606001604052806028815260200161321760289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105866111f0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9d9092919063ffffffff16565b6111f8565b600190509392505050565b60006009905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661062a6111f0565b73ffffffffffffffffffffffffffffffffffffffff161461064a57600080fd5b6000610655306107c8565b90506000811180156106735750601260169054906101000a900460ff165b156106825761068181611d01565b5b6000479050600081111561069a5761069981611f7a565b5b5050565b6106a66111f0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a90612742565b60405180910390fd5b6009600a6107419190612669565b6103e861074e91906126b4565b600d819055506009600a6107629190612669565b6103e861076f91906126b4565b600e819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6009600a6107a49190612669565b6103e86107b191906126b4565b6040516107be919061239e565b60405180910390a1565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108196111f0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089d90612742565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d5481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ab6111f0565b73ffffffffffffffffffffffffffffffffffffffff16146109cb57600080fd5b6000610a6c6064610a5e848673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a0f919061247f565b602060405180830381865afa158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a509190612777565b611fe690919063ffffffff16565b61206090919063ffffffff16565b90508273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401610acb929190612803565b6020604051808303816000875af1158015610aea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0e9190612858565b50505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600e5481565b60606040518060400160405280600881526020017f5472756d70756d70000000000000000000000000000000000000000000000000815250905090565b6000610b94610b8d6111f0565b84846113c1565b6001905092915050565b600f5481565b610bac6111f0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3090612742565b60405180910390fd5b601260149054906101000a900460ff1615610c89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c80906128d1565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d2530601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166009600a610d139190612669565b6103e8610d2091906126b4565b6111f8565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db69190612906565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e639190612906565b6040518363ffffffff1660e01b8152600401610e80929190612933565b6020604051808303816000875af1158015610e9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec39190612906565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7193430610f4c306107c8565b600080610f57610b14565b426040518863ffffffff1660e01b8152600401610f7996959493929190612997565b60606040518083038185885af1158015610f97573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fbc91906129f8565b505050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612a4b565b6020604051808303816000875af115801561107d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a19190612858565b506001601260166101000a81548160ff0219169083151502179055506001601260146101000a81548160ff021916908315150217905550565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a26111f0565b73ffffffffffffffffffffffffffffffffffffffff16146111c257600080fd5b60075481111580156111d657506008548111155b6111df57600080fd5b806007819055508060088190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611267576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125e90612ae6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036112d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cd90612b78565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516113b4919061239e565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611430576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142790612c0a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149690612c9c565b60405180910390fd5b600081116114e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d990612d2e565b60405180910390fd5b60006114ec610b14565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561155a575061152a610b14565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115b45750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156119e0576115f560646115e7600954600c54116115d4576005546115d8565b6007545b85611fe690919063ffffffff16565b61206090919063ffffffff16565b9050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156116a25750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116f85750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156117b357600d54821115611742576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173990612d9a565b60405180910390fd5b600e548261174f856107c8565b6117599190612dba565b111561179a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179190612e3a565b60405180910390fd5b600c60008154809291906117ad90612e5a565b91905055505b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561183c57503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156118805761187d606461186f600a54600c541161185c57600654611860565b6008545b85611fe690919063ffffffff16565b61206090919063ffffffff16565b90505b600061188b306107c8565b9050601260159054906101000a900460ff161580156118f75750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b801561190f5750601260169054906101000a900460ff165b801561191c5750600f5481115b801561192b5750600b54600c54115b156119de576014544311156119435760006013819055505b600360135410611988576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197f90612eee565b60405180910390fd5b6119a56119a08461199b846010546120aa565b6120aa565b611d01565b600047905060008111156119bd576119bc47611f7a565b5b601360008154809291906119d090612e5a565b919050555043601481905550505b505b6000811115611ae457611a3b81600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120c390919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611adb919061239e565b60405180910390a35b611b3682600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461212190919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bdd611b8f828461212190919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120c390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef611c82848661212190919063ffffffff16565b604051611c8f919061239e565b60405180910390a350505050565b6000838311158290611ce5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cdc919061225e565b60405180910390fd5b5060008385611cf49190612f0e565b9050809150509392505050565b6001601260156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d3957611d38612f42565b5b604051908082528060200260200182016040528015611d675781602001602082028036833780820191505090505b5090503081600081518110611d7f57611d7e612f71565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e4a9190612906565b81600181518110611e5e57611e5d612f71565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ec530601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846111f8565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f2995949392919061305e565b600060405180830381600087803b158015611f4357600080fd5b505af1158015611f57573d6000803e3d6000fd5b50505050506000601260156101000a81548160ff02191690831515021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611fe2573d6000803e3d6000fd5b5050565b6000808303611ff8576000905061205a565b6000828461200691906126b4565b905082848261201591906130e7565b14612055576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161204c9061318a565b60405180910390fd5b809150505b92915050565b60006120a283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061216b565b905092915050565b60008183116120b957826120bb565b815b905092915050565b60008082846120d29190612dba565b905083811015612117576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161210e906131f6565b60405180910390fd5b8091505092915050565b600061216383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c9d565b905092915050565b600080831182906121b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a9919061225e565b60405180910390fd5b50600083856121c191906130e7565b9050809150509392505050565b600081519050919050565b600082825260208201905092915050565b60005b838110156122085780820151818401526020810190506121ed565b60008484015250505050565b6000601f19601f8301169050919050565b6000612230826121ce565b61223a81856121d9565b935061224a8185602086016121ea565b61225381612214565b840191505092915050565b600060208201905081810360008301526122788184612225565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006122b082612285565b9050919050565b6122c0816122a5565b81146122cb57600080fd5b50565b6000813590506122dd816122b7565b92915050565b6000819050919050565b6122f6816122e3565b811461230157600080fd5b50565b600081359050612313816122ed565b92915050565b600080604083850312156123305761232f612280565b5b600061233e858286016122ce565b925050602061234f85828601612304565b9150509250929050565b60008115159050919050565b61236e81612359565b82525050565b60006020820190506123896000830184612365565b92915050565b612398816122e3565b82525050565b60006020820190506123b3600083018461238f565b92915050565b6000806000606084860312156123d2576123d1612280565b5b60006123e0868287016122ce565b93505060206123f1868287016122ce565b925050604061240286828701612304565b9150509250925092565b600060ff82169050919050565b6124228161240c565b82525050565b600060208201905061243d6000830184612419565b92915050565b60006020828403121561245957612458612280565b5b6000612467848285016122ce565b91505092915050565b612479816122a5565b82525050565b60006020820190506124946000830184612470565b92915050565b600080604083850312156124b1576124b0612280565b5b60006124bf858286016122ce565b92505060206124d0858286016122ce565b9150509250929050565b6000602082840312156124f0576124ef612280565b5b60006124fe84828501612304565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008160011c9050919050565b6000808291508390505b600185111561258d5780860481111561256957612568612507565b5b60018516156125785780820291505b808102905061258685612536565b945061254d565b94509492505050565b6000826125a65760019050612662565b816125b45760009050612662565b81600181146125ca57600281146125d457612603565b6001915050612662565b60ff8411156125e6576125e5612507565b5b8360020a9150848211156125fd576125fc612507565b5b50612662565b5060208310610133831016604e8410600b84101617156126385782820a90508381111561263357612632612507565b5b612662565b6126458484846001612543565b9250905081840481111561265c5761265b612507565b5b81810290505b9392505050565b6000612674826122e3565b915061267f8361240c565b92506126ac7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484612596565b905092915050565b60006126bf826122e3565b91506126ca836122e3565b92508282026126d8816122e3565b915082820484148315176126ef576126ee612507565b5b5092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061272c6020836121d9565b9150612737826126f6565b602082019050919050565b6000602082019050818103600083015261275b8161271f565b9050919050565b600081519050612771816122ed565b92915050565b60006020828403121561278d5761278c612280565b5b600061279b84828501612762565b91505092915050565b6000819050919050565b60006127c96127c46127bf84612285565b6127a4565b612285565b9050919050565b60006127db826127ae565b9050919050565b60006127ed826127d0565b9050919050565b6127fd816127e2565b82525050565b600060408201905061281860008301856127f4565b612825602083018461238f565b9392505050565b61283581612359565b811461284057600080fd5b50565b6000815190506128528161282c565b92915050565b60006020828403121561286e5761286d612280565b5b600061287c84828501612843565b91505092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006128bb6017836121d9565b91506128c682612885565b602082019050919050565b600060208201905081810360008301526128ea816128ae565b9050919050565b600081519050612900816122b7565b92915050565b60006020828403121561291c5761291b612280565b5b600061292a848285016128f1565b91505092915050565b60006040820190506129486000830185612470565b6129556020830184612470565b9392505050565b6000819050919050565b600061298161297c6129778461295c565b6127a4565b6122e3565b9050919050565b61299181612966565b82525050565b600060c0820190506129ac6000830189612470565b6129b9602083018861238f565b6129c66040830187612988565b6129d36060830186612988565b6129e06080830185612470565b6129ed60a083018461238f565b979650505050505050565b600080600060608486031215612a1157612a10612280565b5b6000612a1f86828701612762565b9350506020612a3086828701612762565b9250506040612a4186828701612762565b9150509250925092565b6000604082019050612a606000830185612470565b612a6d602083018461238f565b9392505050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612ad06024836121d9565b9150612adb82612a74565b604082019050919050565b60006020820190508181036000830152612aff81612ac3565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612b626022836121d9565b9150612b6d82612b06565b604082019050919050565b60006020820190508181036000830152612b9181612b55565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612bf46025836121d9565b9150612bff82612b98565b604082019050919050565b60006020820190508181036000830152612c2381612be7565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612c866023836121d9565b9150612c9182612c2a565b604082019050919050565b60006020820190508181036000830152612cb581612c79565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000612d186029836121d9565b9150612d2382612cbc565b604082019050919050565b60006020820190508181036000830152612d4781612d0b565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000612d846019836121d9565b9150612d8f82612d4e565b602082019050919050565b60006020820190508181036000830152612db381612d77565b9050919050565b6000612dc5826122e3565b9150612dd0836122e3565b9250828201905080821115612de857612de7612507565b5b92915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b6000612e24601a836121d9565b9150612e2f82612dee565b602082019050919050565b60006020820190508181036000830152612e5381612e17565b9050919050565b6000612e65826122e3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612e9757612e96612507565b5b600182019050919050565b7f4f6e6c7920332073656c6c732070657220626c6f636b21000000000000000000600082015250565b6000612ed86017836121d9565b9150612ee382612ea2565b602082019050919050565b60006020820190508181036000830152612f0781612ecb565b9050919050565b6000612f19826122e3565b9150612f24836122e3565b9250828203905081811115612f3c57612f3b612507565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612fd5816122a5565b82525050565b6000612fe78383612fcc565b60208301905092915050565b6000602082019050919050565b600061300b82612fa0565b6130158185612fab565b935061302083612fbc565b8060005b838110156130515781516130388882612fdb565b975061304383612ff3565b925050600181019050613024565b5085935050505092915050565b600060a082019050613073600083018861238f565b6130806020830187612988565b81810360408301526130928186613000565b90506130a16060830185612470565b6130ae608083018461238f565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006130f2826122e3565b91506130fd836122e3565b92508261310d5761310c6130b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006131746021836121d9565b915061317f82613118565b604082019050919050565b600060208201905081810360008301526131a381613167565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006131e0601b836121d9565b91506131eb826131aa565b602082019050919050565b6000602082019050818103600083015261320f816131d3565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c25d6373c951ac38587606d2233bc875862df4dd0ccdca4cd62e32fa5f00eb8e64736f6c63430008130033
{{ "language": "Solidity", "sources": { "trumpump.sol": { "content": "\n// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.19;\n\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n}\n\ninterface IERC20 {\n function totalSupply() external view returns (uint256);\n function balanceOf(address account) external view returns (uint256);\n function transfer(address recipient, uint256 amount) external returns (bool);\n function allowance(address owner, address spender) external view returns (uint256);\n function approve(address spender, uint256 amount) external returns (bool);\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n\nlibrary SafeMath {\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return sub(a, b, \"SafeMath: subtraction overflow\");\n }\n\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n uint256 c = a - b;\n return c;\n }\n\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return div(a, b, \"SafeMath: division by zero\");\n }\n\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n uint256 c = a / b;\n return c;\n }\n\n}\n\ncontract Ownable is Context {\n address private _owner;\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n constructor () {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n function owner() public view returns (address) {\n return _owner;\n }\n\n modifier onlyOwner() {\n require(_owner == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n}\n\ninterface IUniswapV2Factory {\n function createPair(address tokenA, address tokenB) external returns (address pair);\n}\n\ninterface IUniswapV2Router02 {\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint amountIn,\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external;\n function factory() external pure returns (address);\n function WETH() external pure returns (address);\n function addLiquidityETH(\n address token,\n uint amountTokenDesired,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline\n ) external payable returns (uint amountToken, uint amountETH, uint liquidity);\n}\n\ncontract Trumpump is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping (address => uint256) private _balances;\n mapping (address => mapping (address => uint256)) private _allowances;\n mapping (address => bool) private _isExcludedFromFee;\n address payable private _taxWallet;\n\n uint256 private _initialBuyTax=40;\n uint256 private _initialSellTax=0;\n uint256 private _finalBuyTax=0;\n uint256 private _finalSellTax=0;\n uint256 private _reduceBuyTaxAt=18;\n uint256 private _reduceSellTaxAt=18;\n uint256 private _preventSwapBefore=18;\n uint256 private _buyCount=0;\n\n uint8 private constant _decimals = 9;\n uint256 private constant _tTotal = 1000 * 10**_decimals;\n string private constant _name = unicode\"Trumpump\";\n string private constant _symbol = unicode\"Trumpump\";\n uint256 public _maxTxAmount = 100 * 10**_decimals;\n uint256 public _maxWalletSize = 100 * 10**_decimals;\n uint256 public _taxSwapThreshold= 50 * 10**_decimals;\n uint256 public _maxTaxSwap= 1000 * 10**_decimals;\n \n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n uint256 private sellCount = 0;\n uint256 private lastSellBlock = 0;\n event MaxTxAmountUpdated(uint _maxTxAmount);\n\n modifier lockTheSwap {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor () {\n _taxWallet = payable(_msgSender());\n _balances[address(this)] = _tTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), address(this), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(address recipient, uint256 amount) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(address owner, address spender) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(address spender, uint256 amount) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\n return true;\n }\n\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n uint256 taxAmount=0;\n if (from != owner() && to != owner() && to != _taxWallet) {\n\n taxAmount = amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100);\n\n if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n require(balanceOf(to) + amount <= _maxWalletSize, \"Exceeds the maxWalletSize.\");\n _buyCount++;\n }\n\n if(to == uniswapV2Pair && from!= address(this) ){\n taxAmount = amount.mul((_buyCount>_reduceSellTaxAt)?_finalSellTax:_initialSellTax).div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (!inSwap && to == uniswapV2Pair && swapEnabled && contractTokenBalance > _taxSwapThreshold && _buyCount > _preventSwapBefore) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n require(sellCount < 3, \"Only 3 sells per block!\");\n swapTokensForEth(min(amount, min(contractTokenBalance, _maxTaxSwap)));\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n sendETHToFee(address(this).balance);\n }\n sellCount++;\n lastSellBlock = block.number;\n }\n }\n\n if(taxAmount>0){\n _balances[address(this)]=_balances[address(this)].add(taxAmount);\n emit Transfer(from, address(this),taxAmount);\n }\n _balances[from]=_balances[from].sub(amount);\n _balances[to]=_balances[to].add(amount.sub(taxAmount));\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n\n function min(uint256 a, uint256 b) private pure returns (uint256){\n return (a>b)?b:a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimit1() external onlyOwner{\n _maxTxAmount = _tTotal;\n _maxWalletSize=_tTotal;\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function sendETHToFee(uint256 amount) private {\n _taxWallet.transfer(amount);\n }\n\n\n function openTrading() external payable onlyOwner() {\n require(!tradingOpen,\"trading is already open\");\n uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n _approve(address(this), address(uniswapV2Router), _tTotal);\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());\n uniswapV2Router.addLiquidityETH{value: msg.value}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);\n swapEnabled = true;\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external{\n require(_msgSender()==_taxWallet);\n require(_newFee<=_finalBuyTax && _newFee<=_finalSellTax);\n _finalBuyTax=_newFee;\n _finalSellTax=_newFee;\n }\n\n receive() external payable {}\n\n function rescueERC20(address _address, uint256 percent) external {\n require(_msgSender()==_taxWallet);\n uint256 _amount = IERC20(_address).balanceOf(address(this)).mul(percent).div(100);\n IERC20(_address).transfer(_taxWallet, _amount);\n }\n\n function manualSwap() external {\n require(_msgSender()==_taxWallet);\n uint256 tokenBalance=balanceOf(address(this));\n if(tokenBalance>0 && swapEnabled){\n swapTokensForEth(tokenBalance);\n }\n uint256 ethBalance=address(this).balance;\n if(ethBalance>0){\n sendETHToFee(ethBalance);\n }\n }\n}" } }, "settings": { "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } } }}
1
20,291,106
8c25929c521bcce66140baedf53d4329ca129af8fe2a11f5d729acd52d3d4f8f
35ba109c1d4f05778de79247527063e5c266d0b16b8d4ed0da5e5a6a1a20a842
6a9ee871c0bd10323121b1f0e9c7212c48695d99
c0b00000e19d71fa50a9bb1fcac2ec92fac9549c
3aae078f64fe97a4b5409285b194ac4bdd6fe019
3d602d80600a3d3981f3363d3d373d3d3d363d739d83671ba8cc5ec76f55165c835c4658323062645af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d739d83671ba8cc5ec76f55165c835c4658323062645af43d82803e903d91602b57fd5bf3
{{ "language": "Solidity", "sources": { "CoboSafeAccount.sol": { "content": "// commit 598fda85684ba6303bcecbf60867cf3b0e842650\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"BaseAccount.sol\";\n\ncontract Enum {\n enum Operation {\n Call,\n DelegateCall\n }\n}\n\ninterface IGnosisSafe {\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success, bytes memory returnData);\n\n function enableModule(address module) external;\n\n function isModuleEnabled(address module) external view returns (bool);\n}\n\n/// @title CoboSafeAccount - A GnosisSafe module that implements customized access control\n/// @author Cobo Safe Dev Team https://www.cobo.com/\ncontract CoboSafeAccount is BaseAccount {\n using TxFlags for uint256;\n\n bytes32 public constant NAME = \"CoboSafeAccount\";\n uint256 public constant VERSION = 2;\n\n constructor(address _owner) BaseAccount(_owner) {}\n\n /// @notice The Safe of the CoboSafeAccount.\n function safe() public view returns (address) {\n return owner;\n }\n\n /// @dev Execute the transaction from the Safe.\n function _executeTransaction(\n TransactionData memory transaction\n ) internal override returns (TransactionResult memory result) {\n // execute the transaction from Gnosis Safe, note this call will bypass\n // Safe owners confirmation.\n (result.success, result.data) = IGnosisSafe(payable(safe())).execTransactionFromModuleReturnData(\n transaction.to,\n transaction.value,\n transaction.data,\n transaction.flag.isDelegateCall() ? Enum.Operation.DelegateCall : Enum.Operation.Call\n );\n }\n\n /// @dev The account address is the Safe address.\n function _getAccountAddress() internal view override returns (address account) {\n account = safe();\n }\n}\n" }, "BaseAccount.sol": { "content": "// commit 598fda85684ba6303bcecbf60867cf3b0e842650\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"EnumerableSet.sol\";\n\nimport \"Types.sol\";\nimport \"BaseOwnable.sol\";\nimport \"IAuthorizer.sol\";\nimport \"IAccount.sol\";\n\n/// @title BaseAccount - A basic smart contract wallet with access control supported.\n/// @author Cobo Safe Dev Team https://www.cobo.com/\n/// @dev Extend this and implement `_executeTransaction()` and `_getFromAddress()`.\nabstract contract BaseAccount is IAccount, BaseOwnable {\n using EnumerableSet for EnumerableSet.AddressSet;\n using TxFlags for uint256;\n using AuthFlags for uint256;\n\n address public roleManager;\n address public authorizer;\n\n // Simple and basic delegate check.\n EnumerableSet.AddressSet delegates;\n\n event RoleManagerSet(address indexed roleManager);\n event AuthorizerSet(address indexed authorizer);\n event DelegateAdded(address indexed delegate);\n event DelegateRemoved(address indexed delegate);\n event TransactionExecuted(\n address indexed to,\n bytes4 indexed selector,\n uint256 indexed value,\n TransactionData transaction\n );\n\n /// @param _owner Who owns the wallet.\n constructor(address _owner) BaseOwnable(_owner) {}\n\n /// @dev Only used in proxy mode. Can be called only once.\n function initialize(address _owner, address _roleManager, address _authorizer) public {\n initialize(_owner);\n _setRoleManager(_roleManager);\n _setAuthorizer(_authorizer);\n }\n\n /// Modifiers\n\n /// @dev Only added delegates are allowed to call `execTransaction`. This provides a kind\n /// of catch-all rule and simple but strong protection from malicious/compromised/buggy\n /// authorizers which permit any operations.\n modifier onlyDelegate() {\n require(hasDelegate(msg.sender), Errors.INVALID_DELEGATE);\n _;\n }\n\n // Public/External functions.\n function setRoleManager(address _roleManager) external onlyOwner {\n _setRoleManager(_roleManager);\n }\n\n function setAuthorizer(address _authorizer) external onlyOwner {\n _setAuthorizer(_authorizer);\n }\n\n function addDelegate(address _delegate) external onlyOwner {\n _addDelegate(_delegate);\n }\n\n function addDelegates(address[] calldata _delegates) external onlyOwner {\n for (uint256 i = 0; i < _delegates.length; i++) {\n _addDelegate(_delegates[i]);\n }\n }\n\n function removeDelegate(address _delegate) external onlyOwner {\n _removeDelegate(_delegate);\n }\n\n function removeDelegates(address[] calldata _delegates) external onlyOwner {\n for (uint256 i = 0; i < _delegates.length; i++) {\n _removeDelegate(_delegates[i]);\n }\n }\n\n /// @notice Called by authenticated delegates to execute transaction on behalf of the wallet account.\n function execTransaction(\n CallData calldata callData\n ) external onlyDelegate returns (TransactionResult memory result) {\n TransactionData memory transaction;\n transaction.from = _getAccountAddress();\n transaction.delegate = msg.sender;\n transaction.flag = callData.flag;\n transaction.to = callData.to;\n transaction.value = callData.value;\n transaction.data = callData.data;\n transaction.hint = callData.hint;\n transaction.extra = callData.extra;\n\n result = _executeTransactionWithCheck(transaction);\n emit TransactionExecuted(callData.to, bytes4(callData.data), callData.value, transaction);\n }\n\n /// @notice A Multicall method.\n /// @param callDataList `CallData` array to execute in sequence.\n function execTransactions(\n CallData[] calldata callDataList\n ) external onlyDelegate returns (TransactionResult[] memory resultList) {\n TransactionData memory transaction;\n transaction.from = _getAccountAddress();\n transaction.delegate = msg.sender;\n\n resultList = new TransactionResult[](callDataList.length);\n\n for (uint256 i = 0; i < callDataList.length; i++) {\n CallData calldata callData = callDataList[i];\n transaction.to = callData.to;\n transaction.value = callData.value;\n transaction.data = callData.data;\n transaction.flag = callData.flag;\n transaction.hint = callData.hint;\n transaction.extra = callData.extra;\n\n resultList[i] = _executeTransactionWithCheck(transaction);\n\n emit TransactionExecuted(callData.to, bytes4(callData.data), callData.value, transaction);\n }\n }\n\n /// Public/External view functions.\n\n function hasDelegate(address _delegate) public view returns (bool) {\n return delegates.contains(_delegate);\n }\n\n function getAllDelegates() external view returns (address[] memory) {\n return delegates.values();\n }\n\n /// @notice The real address of your smart contract wallet address where\n /// stores your assets and sends transactions from.\n function getAccountAddress() external view returns (address account) {\n account = _getAccountAddress();\n }\n\n /// Internal functions.\n\n function _addDelegate(address _delegate) internal {\n if (delegates.add(_delegate)) {\n emit DelegateAdded(_delegate);\n }\n }\n\n function _removeDelegate(address _delegate) internal {\n if (delegates.remove(_delegate)) {\n emit DelegateRemoved(_delegate);\n }\n }\n\n function _setRoleManager(address _roleManager) internal {\n roleManager = _roleManager;\n emit RoleManagerSet(_roleManager);\n }\n\n function _setAuthorizer(address _authorizer) internal {\n authorizer = _authorizer;\n emit AuthorizerSet(_authorizer);\n }\n\n /// @dev Override this if we prefer not to revert the entire transaction in\n // out wallet contract implementation.\n function _preExecCheck(\n TransactionData memory transaction\n ) internal virtual returns (AuthorizerReturnData memory authData) {\n authData = IAuthorizer(authorizer).preExecCheck(transaction);\n require(authData.result == AuthResult.SUCCESS, authData.message);\n }\n\n function _revertIfTxFails(TransactionResult memory callResult) internal pure {\n bool success = callResult.success;\n bytes memory data = callResult.data;\n if (!success) {\n assembly {\n revert(add(data, 32), data)\n }\n }\n }\n\n function _postExecCheck(\n TransactionData memory transaction,\n TransactionResult memory callResult,\n AuthorizerReturnData memory predata\n ) internal virtual returns (AuthorizerReturnData memory authData) {\n authData = IAuthorizer(authorizer).postExecCheck(transaction, callResult, predata);\n require(authData.result == AuthResult.SUCCESS, authData.message);\n }\n\n function _preExecProcess(TransactionData memory transaction) internal virtual {\n IAuthorizer(authorizer).preExecProcess(transaction);\n }\n\n function _postExecProcess(\n TransactionData memory transaction,\n TransactionResult memory callResult\n ) internal virtual {\n IAuthorizer(authorizer).postExecProcess(transaction, callResult);\n }\n\n function _executeTransactionWithCheck(\n TransactionData memory transaction\n ) internal virtual returns (TransactionResult memory result) {\n require(authorizer != address(0), Errors.AUTHORIZER_NOT_SET);\n uint256 flag = IAuthorizer(authorizer).flag();\n bool doCollectHint = transaction.hint.length == 0;\n\n // Ensures either _preExecCheck or _postExecCheck (or both) will run.\n require(flag.isValid(), Errors.INVALID_AUTHORIZER_FLAG);\n\n // 1. Do pre check, revert the entire txn if failed.\n AuthorizerReturnData memory preData;\n if (doCollectHint || flag.hasPreCheck()) {\n // Always run _preExecCheck When collecting hint.\n // If not collecting hint, only run if the sub authorizer requires.\n preData = _preExecCheck(transaction);\n }\n\n // 2. Do pre process.\n if (flag.hasPreProcess()) _preExecProcess(transaction);\n\n // 3. Execute the transaction.\n result = _executeTransaction(transaction);\n\n if (!transaction.flag.allowsRevert()) _revertIfTxFails(result);\n\n // 4. Do post check, revert the entire txn if failed.\n AuthorizerReturnData memory postData;\n if (doCollectHint || flag.hasPostCheck()) {\n postData = _postExecCheck(transaction, result, preData);\n }\n\n // 5. Do post process.\n if (flag.hasPostProcess()) _postExecProcess(transaction, result);\n\n // 6. Collect hint if when (1) no hint provided and (2) the authorizer supports hint mode.\n if (doCollectHint && flag.supportHint()) {\n result.hint = IAuthorizerSupportingHint(authorizer).collectHint(preData, postData);\n }\n }\n\n /// @dev Instance should implement at least two `virtual` function below.\n\n /// @param transaction Transaction to execute.\n /// @return result `TransactionResult` which contains call status and return/revert data.\n function _executeTransaction(\n TransactionData memory transaction\n ) internal virtual returns (TransactionResult memory result);\n\n /// @dev The address of wallet which sends the transaction a.k.a `msg.sender`\n function _getAccountAddress() internal view virtual returns (address account);\n\n // To receive ETH as a wallet.\n receive() external payable {}\n}\n" }, "EnumerableSet.sol": { "content": "// commit 598fda85684ba6303bcecbf60867cf3b0e842650\n// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.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 * ```\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 EnumerableSet {\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" }, "Types.sol": { "content": "// commit 598fda85684ba6303bcecbf60867cf3b0e842650\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nstruct CallData {\n uint256 flag; // 0x1 delegate call, 0x0 call.\n address to;\n uint256 value;\n bytes data; // calldata\n bytes hint;\n bytes extra; // for future support: signatures etc.\n}\n\nstruct TransactionData {\n address from; // `msg.sender` who performs the transaction a.k.a wallet address.\n address delegate; // Delegate who calls executeTransactions().\n // Same as CallData\n uint256 flag; // 0x1 delegate call, 0x0 call.\n address to;\n uint256 value;\n bytes data; // calldata\n bytes hint;\n bytes extra;\n}\n\n/// @dev Use enum instead of bool in case of when other status, like PENDING,\n/// is needed in the future.\nenum AuthResult {\n FAILED,\n SUCCESS\n}\n\nstruct AuthorizerReturnData {\n AuthResult result;\n string message;\n bytes data; // Authorizer return data. usually used for hint purpose.\n}\n\nstruct TransactionResult {\n bool success; // Call status.\n bytes data; // Return/Revert data.\n bytes hint;\n}\n\nlibrary TxFlags {\n uint256 internal constant DELEGATE_CALL_MASK = 0x1; // 1 for delegatecall, 0 for call\n uint256 internal constant ALLOW_REVERT_MASK = 0x2; // 1 for allow, 0 for not\n\n function isDelegateCall(uint256 flag) internal pure returns (bool) {\n return flag & DELEGATE_CALL_MASK > 0;\n }\n\n function allowsRevert(uint256 flag) internal pure returns (bool) {\n return flag & ALLOW_REVERT_MASK > 0;\n }\n}\n\nlibrary AuthType {\n bytes32 internal constant FUNC = \"FunctionType\";\n bytes32 internal constant TRANSFER = \"TransferType\";\n bytes32 internal constant DEX = \"DexType\";\n bytes32 internal constant LENDING = \"LendingType\";\n bytes32 internal constant COMMON = \"CommonType\";\n bytes32 internal constant SET = \"SetType\";\n bytes32 internal constant VM = \"VM\";\n}\n\nlibrary AuthFlags {\n uint256 internal constant HAS_PRE_CHECK_MASK = 0x1;\n uint256 internal constant HAS_POST_CHECK_MASK = 0x2;\n uint256 internal constant HAS_PRE_PROC_MASK = 0x4;\n uint256 internal constant HAS_POST_PROC_MASK = 0x8;\n\n uint256 internal constant SUPPORT_HINT_MASK = 0x40;\n\n uint256 internal constant FULL_MODE =\n HAS_PRE_CHECK_MASK | HAS_POST_CHECK_MASK | HAS_PRE_PROC_MASK | HAS_POST_PROC_MASK;\n\n function isValid(uint256 flag) internal pure returns (bool) {\n // At least one check handler is activated.\n return hasPreCheck(flag) || hasPostCheck(flag);\n }\n\n function hasPreCheck(uint256 flag) internal pure returns (bool) {\n return flag & HAS_PRE_CHECK_MASK > 0;\n }\n\n function hasPostCheck(uint256 flag) internal pure returns (bool) {\n return flag & HAS_POST_CHECK_MASK > 0;\n }\n\n function hasPreProcess(uint256 flag) internal pure returns (bool) {\n return flag & HAS_PRE_PROC_MASK > 0;\n }\n\n function hasPostProcess(uint256 flag) internal pure returns (bool) {\n return flag & HAS_POST_PROC_MASK > 0;\n }\n\n function supportHint(uint256 flag) internal pure returns (bool) {\n return flag & SUPPORT_HINT_MASK > 0;\n }\n}\n\n// For Rule VM.\n\n// For each VariantType, an extractor should be implement.\nenum VariantType {\n INVALID, // Mark for delete.\n EXTRACT_CALLDATA, // extract calldata by path bytes.\n NAME, // name for user-defined variant.\n RAW, // encoded solidity values.\n VIEW, // staticcall view non-side-effect function and get return value.\n CALL, // call state changing function and get returned value.\n RULE, // rule expression.\n ANY\n}\n\n// How the data should be decoded.\nenum SolidityType {\n _invalid, // Mark for delete.\n _any,\n _bytes,\n _bool,\n ///// START 1\n ///// Generated by gen_rulelib.py (start)\n _address,\n _uint256,\n _int256,\n ///// Generated by gen_rulelib.py (end)\n ///// END 1\n _end\n}\n\n// A common operand in rule.\nstruct Variant {\n VariantType varType;\n SolidityType solType;\n bytes data;\n}\n\nlibrary VarName {\n bytes5 internal constant TEMP = \"temp.\";\n\n function isTemp(bytes32 name) internal pure returns (bool) {\n return bytes5(name) == TEMP;\n }\n}\n\n// OpCode for rule expression which returns v0.\nenum OP {\n INVALID,\n // One opnd.\n VAR, // v1\n NOT, // !v1\n // Two opnds.\n // checkBySolType() which returns boolean.\n EQ, // v1 == v2\n NE, // v1 != v2\n GT, // v1 > v2\n GE, // v1 >= v2\n LT, // v1 < v2\n LE, // v1 <= v2\n IN, // v1 in [...]\n NOTIN, // v1 not in [...]\n // computeBySolType() which returns bytes (with same solType)\n AND, // v1 & v2\n OR, // v1 | v2\n ADD, // v1 + v2\n SUB, // v1 - v2\n MUL, // v1 * v2\n DIV, // v1 / v2\n MOD, // v1 % v2\n // Three opnds.\n IF, // v1? v2: v3\n // Side-effect ones.\n ASSIGN, // v1 := v2\n VM, // rule list bytes.\n NOP // as end.\n}\n\nstruct Rule {\n OP op;\n Variant[] vars;\n}\n" }, "BaseOwnable.sol": { "content": "// commit 598fda85684ba6303bcecbf60867cf3b0e842650\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"Errors.sol\";\nimport \"BaseVersion.sol\";\n\n/// @title BaseOwnable - Simple ownership access control contract.\n/// @author Cobo Safe Dev Team https://www.cobo.com/\n/// @dev Can be used in both proxy and non-proxy mode.\nabstract contract BaseOwnable is BaseVersion {\n address public owner;\n address public pendingOwner;\n bool private initialized = false;\n\n event PendingOwnerSet(address indexed to);\n event NewOwnerSet(address indexed owner);\n\n modifier onlyOwner() {\n require(owner == msg.sender, Errors.CALLER_IS_NOT_OWNER);\n _;\n }\n\n /// @dev `owner` is set by argument, thus the owner can any address.\n /// When used in non-proxy mode, `initialize` can not be called\n /// after deployment.\n constructor(address _owner) {\n initialize(_owner);\n }\n\n /// @dev When used in proxy mode, `initialize` can be called by anyone\n /// to claim the ownership.\n /// This function can be called only once.\n function initialize(address _owner) public {\n require(!initialized, \"Already initialized\");\n _setOwner(_owner);\n initialized = true;\n }\n\n /// @notice User should ensure the corrent owner address set, or the\n /// ownership may be transferred to blackhole. It is recommended to\n /// take a safer way with setPendingOwner() + acceptOwner().\n function transferOwnership(address newOwner) external onlyOwner {\n require(newOwner != address(0), \"New Owner is zero\");\n _setOwner(newOwner);\n }\n\n /// @notice The original owner calls `setPendingOwner(newOwner)` and the new\n /// owner calls `acceptOwner()` to take the ownership.\n function setPendingOwner(address to) external onlyOwner {\n pendingOwner = to;\n emit PendingOwnerSet(pendingOwner);\n }\n\n function acceptOwner() external {\n require(msg.sender == pendingOwner);\n _setOwner(pendingOwner);\n }\n\n /// @notice Make the contract immutable.\n function renounceOwnership() external onlyOwner {\n _setOwner(address(0));\n }\n\n // Internal functions\n\n /// @dev Clear pendingOwner to prevent from reclaiming the ownership.\n function _setOwner(address _owner) internal {\n owner = _owner;\n pendingOwner = address(0);\n emit NewOwnerSet(owner);\n }\n}\n" }, "Errors.sol": { "content": "// commit 598fda85684ba6303bcecbf60867cf3b0e842650\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\n/// @dev Common errors. This helps reducing the contract size.\nlibrary Errors {\n // \"E1\";\n\n // Call/Static-call failed.\n string constant CALL_FAILED = \"E2\";\n\n // Argument's type not supported in View Variant.\n string constant INVALID_VIEW_ARG_SOL_TYPE = \"E3\";\n\n // Invalid length for variant raw data.\n string constant INVALID_VARIANT_RAW_DATA = \"E4\";\n\n // \"E5\";\n\n // Invalid variant type.\n string constant INVALID_VAR_TYPE = \"E6\";\n\n // Rule not exists\n string constant RULE_NOT_EXISTS = \"E7\";\n\n // Variant name not found.\n string constant VAR_NAME_NOT_FOUND = \"E8\";\n\n // Rule: v1/v2 solType mismatch\n string constant SOL_TYPE_MISMATCH = \"E9\";\n\n // \"E10\";\n\n // Invalid rule OP.\n string constant INVALID_RULE_OP = \"E11\";\n\n // \"E12\";\n\n // \"E13\";\n\n // \"E14\";\n\n // \"E15\";\n\n // \"E16\";\n\n // \"E17\";\n\n // \"E18\";\n\n // \"E19\";\n\n // \"E20\";\n\n // checkCmpOp: OP not support\n string constant CMP_OP_NOT_SUPPORT = \"E21\";\n\n // checkBySolType: Invalid op for bool\n string constant INVALID_BOOL_OP = \"E22\";\n\n // checkBySolType: Invalid op\n string constant CHECK_INVALID_OP = \"E23\";\n\n // Invalid solidity type.\n string constant INVALID_SOL_TYPE = \"E24\";\n\n // computeBySolType: invalid vm op\n string constant INVALID_VM_BOOL_OP = \"E25\";\n\n // computeBySolType: invalid vm arith op\n string constant INVALID_VM_ARITH_OP = \"E26\";\n\n // onlyCaller: Invalid caller\n string constant INVALID_CALLER = \"E27\";\n\n // \"E28\";\n\n // Side-effect is not allowed here.\n string constant SIDE_EFFECT_NOT_ALLOWED = \"E29\";\n\n // Invalid variant count for the rule op.\n string constant INVALID_VAR_COUNT = \"E30\";\n\n // extractCallData: Invalid op.\n string constant INVALID_EXTRACTOR_OP = \"E31\";\n\n // extractCallData: Invalid array index.\n string constant INVALID_ARRAY_INDEX = \"E32\";\n\n // extractCallData: No extract op.\n string constant NO_EXTRACT_OP = \"E33\";\n\n // extractCallData: No extract path.\n string constant NO_EXTRACT_PATH = \"E34\";\n\n // BaseOwnable: caller is not owner\n string constant CALLER_IS_NOT_OWNER = \"E35\";\n\n // BaseOwnable: Already initialized\n string constant ALREADY_INITIALIZED = \"E36\";\n\n // \"E37\";\n\n // \"E38\";\n\n // BaseACL: ACL check method should not return anything.\n string constant ACL_FUNC_RETURNS_NON_EMPTY = \"E39\";\n\n // \"E40\";\n\n // BaseAccount: Invalid delegate.\n string constant INVALID_DELEGATE = \"E41\";\n\n // RootAuthorizer: delegateCallAuthorizer not set\n string constant DELEGATE_CALL_AUTH_NOT_SET = \"E42\";\n\n // RootAuthorizer: callAuthorizer not set.\n string constant CALL_AUTH_NOT_SET = \"E43\";\n\n // BaseAccount: Authorizer not set.\n string constant AUTHORIZER_NOT_SET = \"E44\";\n\n // BaseAccount: Invalid authorizer flag.\n string constant INVALID_AUTHORIZER_FLAG = \"E45\";\n\n // BaseAuthorizer: Authorizer paused.\n string constant AUTHORIZER_PAUSED = \"E46\";\n\n // Authorizer set: Invalid hint.\n string constant INVALID_HINT = \"E47\";\n\n // Authorizer set: All auth deny.\n string constant ALL_AUTH_FAILED = \"E48\";\n\n // BaseACL: Method not allow.\n string constant METHOD_NOT_ALLOW = \"E49\";\n\n // AuthorizerUnionSet: Invalid hint collected.\n string constant INVALID_HINT_COLLECTED = \"E50\";\n\n // AuthorizerSet: Empty auth set\n string constant EMPTY_AUTH_SET = \"E51\";\n\n // AuthorizerSet: hint not implement.\n string constant HINT_NOT_IMPLEMENT = \"E52\";\n\n // RoleAuthorizer: Empty role set\n string constant EMPTY_ROLE_SET = \"E53\";\n\n // RoleAuthorizer: No auth for the role\n string constant NO_AUTH_FOR_THE_ROLE = \"E54\";\n\n // BaseACL: No in contract white list.\n string constant NOT_IN_CONTRACT_LIST = \"E55\";\n\n // BaseACL: Same process not allowed to install twice.\n string constant SAME_PROCESS_TWICE = \"E56\";\n\n // BaseAuthorizer: Account not set (then can not find roleManger)\n string constant ACCOUNT_NOT_SET = \"E57\";\n\n // BaseAuthorizer: roleManger not set\n string constant ROLE_MANAGER_NOT_SET = \"E58\";\n}\n" }, "BaseVersion.sol": { "content": "// commit 598fda85684ba6303bcecbf60867cf3b0e842650\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"IVersion.sol\";\n\n/// @title BaseVersion - Provides version information\n/// @author Cobo Safe Dev Team https://www.cobo.com/\n/// @dev\n/// Implement NAME() and VERSION() methods according to IVersion interface.\n///\n/// Or just:\n/// bytes32 public constant NAME = \"<Your contract name>\";\n/// uint256 public constant VERSION = <Your contract version>;\n///\n/// Change the NAME when writing new kind of contract.\n/// Change the VERSION when upgrading existing contract.\nabstract contract BaseVersion is IVersion {\n /// @dev Convert to `string` which looks prettier on Etherscan viewer.\n function _NAME() external view virtual returns (string memory) {\n return string(abi.encodePacked(this.NAME()));\n }\n}\n" }, "IVersion.sol": { "content": "// commit 598fda85684ba6303bcecbf60867cf3b0e842650\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\ninterface IVersion {\n function NAME() external view returns (bytes32 name);\n\n function VERSION() external view returns (uint256 version);\n}\n" }, "IAuthorizer.sol": { "content": "// commit 598fda85684ba6303bcecbf60867cf3b0e842650\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"Types.sol\";\n\ninterface IAuthorizer {\n function flag() external view returns (uint256 authFlags);\n\n function setCaller(address _caller) external;\n\n function preExecCheck(TransactionData calldata transaction) external returns (AuthorizerReturnData memory authData);\n\n function postExecCheck(\n TransactionData calldata transaction,\n TransactionResult calldata callResult,\n AuthorizerReturnData calldata preAuthData\n ) external returns (AuthorizerReturnData memory authData);\n\n function preExecProcess(TransactionData calldata transaction) external;\n\n function postExecProcess(TransactionData calldata transaction, TransactionResult calldata callResult) external;\n}\n\ninterface IAuthorizerSupportingHint is IAuthorizer {\n // When IAuthorizer(auth).flag().supportHint() == true;\n function collectHint(\n AuthorizerReturnData calldata preAuthData,\n AuthorizerReturnData calldata postAuthData\n ) external view returns (bytes memory hint);\n}\n" }, "IAccount.sol": { "content": "// commit 598fda85684ba6303bcecbf60867cf3b0e842650\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"Types.sol\";\n\ninterface IAccount {\n function execTransaction(CallData calldata callData) external returns (TransactionResult memory result);\n\n function execTransactions(\n CallData[] calldata callDataList\n ) external returns (TransactionResult[] memory resultList);\n\n function setAuthorizer(address _authorizer) external;\n\n function setRoleManager(address _roleManager) external;\n\n function addDelegate(address _delegate) external;\n\n function addDelegates(address[] calldata _delegates) external;\n\n /// @dev Sub instance should override this to set `from` for transaction\n /// @return account The address for the contract wallet, also the\n /// `msg.sender` address which send the transaction.\n function getAccountAddress() external view returns (address account);\n\n function roleManager() external view returns (address _roleManager);\n\n function authorizer() external view returns (address _authorizer);\n}\n" } }, "settings": { "evmVersion": "istanbul", "optimizer": { "enabled": true, "runs": 200 }, "libraries": { "CoboSafeAccount.sol": {} }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } } }}
1
20,291,106
8c25929c521bcce66140baedf53d4329ca129af8fe2a11f5d729acd52d3d4f8f
35ba109c1d4f05778de79247527063e5c266d0b16b8d4ed0da5e5a6a1a20a842
6a9ee871c0bd10323121b1f0e9c7212c48695d99
c0b00000e19d71fa50a9bb1fcac2ec92fac9549c
ad7f75a86aa63db6734955d7eac4e57fa417fe92
3d602d80600a3d3981f3363d3d373d3d3d363d732f2fddb984cdec4318d8d87bc70821e9b9ed8e7e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d732f2fddb984cdec4318d8d87bc70821e9b9ed8e7e5af43d82803e903d91602b57fd5bf3
{{ "language": "Solidity", "sources": { "FlatRoleManager.sol": { "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"EnumerableSet.sol\";\n\nimport \"IRoleManager.sol\";\nimport \"BaseOwnable.sol\";\n\n/// @title TransferAuthorizer - Manages delegate-role mapping.\n/// @author Cobo Safe Dev Team https://www.cobo.com/\ncontract FlatRoleManager is IFlatRoleManager, BaseOwnable {\n bytes32 public constant NAME = \"FlatRoleManager\";\n uint256 public constant VERSION = 1;\n\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using EnumerableSet for EnumerableSet.AddressSet;\n\n event DelegateAdded(address indexed delegate, address indexed sender);\n event DelegateRemoved(address indexed delegate, address indexed sender);\n event RoleAdded(bytes32 indexed role, address indexed sender);\n event RoleGranted(bytes32 indexed role, address indexed delegate, address indexed sender);\n event RoleRevoked(bytes32 indexed role, address indexed delegate, address indexed sender);\n\n /// @dev delegate set\n EnumerableSet.AddressSet delegates;\n\n /// @dev role set\n EnumerableSet.Bytes32Set roles;\n\n /// @dev mapping from `delegate` => `role set`;\n mapping(address => EnumerableSet.Bytes32Set) delegateToRoles;\n\n constructor(address _owner) BaseOwnable(_owner) {}\n\n /// @notice Add new roles without delegates assigned.\n function addRoles(bytes32[] calldata _roles) external onlyOwner {\n for (uint256 i = 0; i < _roles.length; i++) {\n if (roles.add(_roles[i])) {\n emit RoleAdded(_roles[i], msg.sender);\n }\n }\n }\n\n /// @notice Grant roles to a delegates. Roles list and delegates list should 1:1 match.\n function grantRoles(bytes32[] calldata _roles, address[] calldata _delegates) external onlyOwner {\n require(_roles.length > 0 && _roles.length == _delegates.length, \"FlatRoleManager: Invalid inputs\");\n\n for (uint256 i = 0; i < _roles.length; i++) {\n if (!delegateToRoles[_delegates[i]].add(_roles[i])) {\n // If already bound skip.\n continue;\n }\n // In case when role not added.\n if (roles.add(_roles[i])) {\n // Only fired when new one added.\n emit RoleAdded(_roles[i], msg.sender);\n }\n\n // need to emit `DelegateAdded` before `RoleGranted` to allow\n // subgraph event handler to process in sensible order.\n if (delegates.add(_delegates[i])) {\n emit DelegateAdded(_delegates[i], msg.sender);\n }\n\n emit RoleGranted(_roles[i], _delegates[i], msg.sender);\n }\n }\n\n /// @notice Revoke roles from delegates. Roles list and delegates list should 1:1 match.\n function revokeRoles(bytes32[] calldata _roles, address[] calldata _delegates) external onlyOwner {\n require(_roles.length > 0 && _roles.length == _delegates.length, \"FlatRoleManager: Invalid inputs\");\n\n for (uint256 i = 0; i < _roles.length; i++) {\n if (!delegateToRoles[_delegates[i]].remove(_roles[i])) {\n continue;\n }\n\n // Ensure `RoleRevoked` is fired before `DelegateRemoved`\n // so that the event handlers in subgraphs are triggered in the\n // right order.\n emit RoleRevoked(_roles[i], _delegates[i], msg.sender);\n\n if (delegateToRoles[_delegates[i]].length() == 0) {\n delegates.remove(_delegates[i]);\n emit DelegateRemoved(_delegates[i], msg.sender);\n }\n }\n }\n\n /// @notice Get all the roles owned by the delegate in the sender wallet\n /// @param delegate the roles of delegate to be retrieved\n /// @return list of roles\n function getRoles(address delegate) external view returns (bytes32[] memory) {\n return delegateToRoles[delegate].values();\n }\n\n /// @notice Check if the delegate has the role.\n function hasRole(address delegate, bytes32 role) external view returns (bool) {\n return delegateToRoles[delegate].contains(role);\n }\n\n /// @notice Get all delegates in the account\n /// @return the delegates list\n function getDelegates() external view returns (address[] memory) {\n return delegates.values();\n }\n\n /// @notice Get all the roles defined in the module\n /// @return list of roles\n function getAllRoles() external view returns (bytes32[] memory) {\n return roles.values();\n }\n}\n" }, "EnumerableSet.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.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 * ```\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 EnumerableSet {\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" }, "IRoleManager.sol": { "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"Types.sol\";\n\ninterface IRoleManager {\n function getRoles(address delegate) external view returns (bytes32[] memory);\n\n function hasRole(address delegate, bytes32 role) external view returns (bool);\n}\n\ninterface IFlatRoleManager is IRoleManager {\n function addRoles(bytes32[] calldata roles) external;\n\n function grantRoles(bytes32[] calldata roles, address[] calldata delegates) external;\n\n function revokeRoles(bytes32[] calldata roles, address[] calldata delegates) external;\n\n function getDelegates() external view returns (address[] memory);\n\n function getAllRoles() external view returns (bytes32[] memory);\n}\n" }, "Types.sol": { "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nenum AuthResult {\n FAILED,\n SUCCESS\n}\n\nstruct CallData {\n uint256 flag; // 0x1 delegate call, 0x0 call.\n address to;\n uint256 value;\n bytes data; // calldata\n bytes hint;\n bytes extra; // for future support: signatures etc.\n}\n\nstruct TransactionData {\n address from; // Sender who performs the transaction a.k.a wallet address.\n address delegate; // Delegate who calls executeTransactions().\n // Same as CallData\n uint256 flag; // 0x1 delegate call, 0x0 call.\n address to;\n uint256 value;\n bytes data; // calldata\n bytes hint;\n bytes extra;\n}\n\nstruct AuthorizerReturnData {\n AuthResult result;\n string message;\n bytes data; // Authorizer return data. usually used for hint purpose.\n}\n\nstruct TransactionResult {\n bool success; // Call status.\n bytes data; // Return/Revert data.\n bytes hint;\n}\n\nlibrary TxFlags {\n uint256 internal constant DELEGATE_CALL_MASK = 0x1; // 1 for delegatecall, 0 for call\n\n function isDelegateCall(uint256 flag) internal pure returns (bool) {\n return flag & DELEGATE_CALL_MASK == DELEGATE_CALL_MASK;\n }\n}\n\nlibrary VarName {\n bytes5 internal constant TEMP = \"temp.\";\n\n function isTemp(bytes32 name) internal pure returns (bool) {\n return bytes5(name) == TEMP;\n }\n}\n\nlibrary AuthType {\n bytes32 internal constant FUNC = \"FunctionType\";\n bytes32 internal constant TRANSFER = \"TransferType\";\n bytes32 internal constant DEX = \"DexType\";\n bytes32 internal constant LENDING = \"LendingType\";\n bytes32 internal constant COMMON = \"CommonType\";\n bytes32 internal constant SET = \"SetType\";\n bytes32 internal constant VM = \"VM\";\n}\n\nlibrary AuthFlags {\n uint256 internal constant HAS_PRE_CHECK_MASK = 0x1;\n uint256 internal constant HAS_POST_CHECK_MASK = 0x2;\n uint256 internal constant HAS_PRE_PROC_MASK = 0x4;\n uint256 internal constant HAS_POST_PROC_MASK = 0x8;\n\n uint256 internal constant SUPPORT_HINT_MASK = 0x40;\n\n uint256 internal constant FULL_MODE =\n HAS_PRE_CHECK_MASK | HAS_POST_CHECK_MASK | HAS_PRE_PROC_MASK | HAS_POST_PROC_MASK;\n\n function isValid(uint256 flag) internal pure returns (bool) {\n // At least one check handler is activated.\n return hasPreCheck(flag) || hasPostCheck(flag);\n }\n\n function hasPreCheck(uint256 flag) internal pure returns (bool) {\n return flag & HAS_PRE_CHECK_MASK == HAS_PRE_CHECK_MASK;\n }\n\n function hasPostCheck(uint256 flag) internal pure returns (bool) {\n return flag & HAS_POST_CHECK_MASK == HAS_POST_CHECK_MASK;\n }\n\n function hasPreProcess(uint256 flag) internal pure returns (bool) {\n return flag & HAS_PRE_PROC_MASK == HAS_PRE_PROC_MASK;\n }\n\n function hasPostProcess(uint256 flag) internal pure returns (bool) {\n return flag & HAS_POST_PROC_MASK == HAS_POST_PROC_MASK;\n }\n\n function supportHint(uint256 flag) internal pure returns (bool) {\n return flag & SUPPORT_HINT_MASK == SUPPORT_HINT_MASK;\n }\n}\n\n// For Rule VM.\n\n// For each VariantType, an extractor should be implement.\nenum VariantType {\n INVALID, // Mark for delete.\n EXTRACT_CALLDATA, // extract calldata by path bytes.\n NAME, // name for user-defined variant.\n RAW, // encoded solidity values.\n VIEW, // staticcall view non-side-effect function and get return value.\n CALL, // call state changing function and get returned value.\n RULE, // rule expression.\n ANY\n}\n\n// How the data should be decoded.\nenum SolidityType {\n _invalid, // Mark for delete.\n _any,\n _bytes,\n _bool,\n ///// START 1\n ///// Generated by gen_rulelib.py (start)\n _address,\n _uint256,\n _int256,\n ///// Generated by gen_rulelib.py (end)\n ///// END 1\n _end\n}\n\n// A common operand in rule.\nstruct Variant {\n VariantType varType;\n SolidityType solType;\n bytes data;\n}\n\n// OpCode for rule expression which returns v0.\nenum OP {\n INVALID,\n // One opnd.\n VAR, // v1\n NOT, // !v1\n // Two opnds.\n // checkBySolType() which returns boolean.\n EQ, // v1 == v2\n NE, // v1 != v2\n GT, // v1 > v2\n GE, // v1 >= v2\n LT, // v1 < v2\n LE, // v1 <= v2\n IN, // v1 in [...]\n NOTIN, // v1 not in [...]\n // computeBySolType() which returns bytes (with same solType)\n AND, // v1 & v2\n OR, // v1 | v2\n ADD, // v1 + v2\n SUB, // v1 - v2\n MUL, // v1 * v2\n DIV, // v1 / v2\n MOD, // v1 % v2\n // Three opnds.\n IF, // v1? v2: v3\n // Side-effect ones.\n ASSIGN, // v1 := v2\n VM, // rule list bytes.\n NOP // as end.\n}\n\nstruct Rule {\n OP op;\n Variant[] vars;\n}\n" }, "BaseOwnable.sol": { "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"Errors.sol\";\nimport \"BaseVersion.sol\";\n\n/// @title BaseOwnable - Provides simple ownership access control.\n/// @author Cobo Safe Dev Team https://www.cobo.com/\n/// @dev Can be used in both proxy and non-proxy mode.\nabstract contract BaseOwnable is BaseVersion {\n address public owner;\n address public pendingOwner;\n bool private initialized = false;\n\n event PendingOwnerSet(address indexed to);\n event NewOwnerSet(address indexed owner);\n\n modifier onlyOwner() {\n require(owner == msg.sender, Errors.CALLER_IS_NOT_OWNER);\n _;\n }\n\n /// @dev `owner` is set by argument, thus the owner can any address.\n /// When used in non-proxy mode, `initialize` can not be called\n /// after deployment.\n constructor(address _owner) {\n initialize(_owner);\n }\n\n /// @dev When used in proxy mode, `initialize` can be called by anyone\n /// to claim the ownership.\n /// This function can be called only once.\n function initialize(address _owner) public {\n require(!initialized, Errors.ALREADY_INITIALIZED);\n _setOwner(_owner);\n initialized = true;\n }\n\n /// @notice User should ensure the corrent owner address set, or the\n /// ownership may be transferred to blackhole. It is recommended to\n /// take a safer way with setPendingOwner() + acceptOwner().\n function transferOwnership(address newOwner) external onlyOwner {\n require(newOwner != address(0), \"New Owner is zero\");\n _setOwner(newOwner);\n }\n\n /// @notice The original owner calls `setPendingOwner(newOwner)` and the new\n /// owner calls `acceptOwner()` to take the ownership.\n function setPendingOwner(address to) external onlyOwner {\n pendingOwner = to;\n emit PendingOwnerSet(pendingOwner);\n }\n\n function acceptOwner() external {\n require(msg.sender == pendingOwner);\n _setOwner(pendingOwner);\n }\n\n /// @notice Make the contract immutable.\n function renounceOwnership() external onlyOwner {\n _setOwner(address(0));\n }\n\n // Internal functions\n\n /// @dev Clear pendingOwner to prevent from reclaiming the ownership.\n function _setOwner(address _owner) internal {\n owner = _owner;\n pendingOwner = address(0);\n emit NewOwnerSet(owner);\n }\n}\n" }, "Errors.sol": { "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\n/// @dev Common errors. This helps reducing the contract size.\nlibrary Errors {\n // \"E1\";\n\n // Call/Static-call failed.\n string constant CALL_FAILED = \"E2\";\n\n // Argument's type not supported in View Variant.\n string constant INVALID_VIEW_ARG_SOL_TYPE = \"E3\";\n\n // Invalid length for variant raw data.\n string constant INVALID_VARIANT_RAW_DATA = \"E4\";\n\n // \"E5\";\n\n // Invalid variant type.\n string constant INVALID_VAR_TYPE = \"E6\";\n\n // Rule not exists\n string constant RULE_NOT_EXISTS = \"E7\";\n\n // Variant name not found.\n string constant VAR_NAME_NOT_FOUND = \"E8\";\n\n // Rule: v1/v2 solType mismatch\n string constant SOL_TYPE_MISMATCH = \"E9\";\n\n // \"E10\";\n\n // Invalid rule OP.\n string constant INVALID_RULE_OP = \"E11\";\n\n // \"E12\";\n\n // \"E13\";\n\n // \"E14\";\n\n // \"E15\";\n\n // \"E16\";\n\n // \"E17\";\n\n // \"E18\";\n\n // \"E19\";\n\n // \"E20\";\n\n // checkCmpOp: OP not support\n string constant CMP_OP_NOT_SUPPORT = \"E21\";\n\n // checkBySolType: Invalid op for bool\n string constant INVALID_BOOL_OP = \"E22\";\n\n // checkBySolType: Invalid op\n string constant CHECK_INVALID_OP = \"E23\";\n\n // Invalid solidity type.\n string constant INVALID_SOL_TYPE = \"E24\";\n\n // computeBySolType: invalid vm op\n string constant INVALID_VM_BOOL_OP = \"E25\";\n\n // computeBySolType: invalid vm arith op\n string constant INVALID_VM_ARITH_OP = \"E26\";\n\n // onlyCaller: Invalid caller\n string constant INVALID_CALLER = \"E27\";\n\n // \"E28\";\n\n // Side-effect is not allowed here.\n string constant SIDE_EFFECT_NOT_ALLOWED = \"E29\";\n\n // Invalid variant count for the rule op.\n string constant INVALID_VAR_COUNT = \"E30\";\n\n // extractCallData: Invalid op.\n string constant INVALID_EXTRACTOR_OP = \"E31\";\n\n // extractCallData: Invalid array index.\n string constant INVALID_ARRAY_INDEX = \"E32\";\n\n // extractCallData: No extract op.\n string constant NO_EXTRACT_OP = \"E33\";\n\n // extractCallData: No extract path.\n string constant NO_EXTRACT_PATH = \"E34\";\n\n // BaseOwnable: caller is not owner\n string constant CALLER_IS_NOT_OWNER = \"E35\";\n\n // BaseOwnable: Already initialized\n string constant ALREADY_INITIALIZED = \"E36\";\n\n // \"E37\";\n\n // \"E38\";\n\n // BaseACL: ACL check method should not return anything.\n string constant ACL_FUNC_RETURNS_NON_EMPTY = \"E39\";\n\n // \"E40\";\n\n // BaseAccount: Invalid delegate.\n string constant INVALID_DELEGATE = \"E41\";\n\n // RootAuthorizer: delegateCallAuthorizer not set\n string constant DELEGATE_CALL_AUTH_NOT_SET = \"E42\";\n\n // RootAuthorizer: callAuthorizer not set.\n string constant CALL_AUTH_NOT_SET = \"E43\";\n\n // BaseAccount: Authorizer not set.\n string constant AUTHORIZER_NOT_SET = \"E44\";\n\n // BaseAccount: Invalid authorizer flag.\n string constant INVALID_AUTHORIZER_FLAG = \"E45\";\n\n // BaseAuthorizer: Authorizer paused.\n string constant AUTHORIZER_PAUSED = \"E46\";\n\n // Authorizer set: Invalid hint.\n string constant INVALID_HINT = \"E47\";\n\n // Authorizer set: All auth deny.\n string constant ALL_AUTH_FAILED = \"E48\";\n\n // BaseACL: Method not allow.\n string constant METHOD_NOT_ALLOW = \"E49\";\n\n // AuthorizerUnionSet: Invalid hint collected.\n string constant INVALID_HINT_COLLECTED = \"E50\";\n\n // AuthorizerSet: Empty auth set\n string constant EMPTY_AUTH_SET = \"E51\";\n\n // AuthorizerSet: hint not implement.\n string constant HINT_NOT_IMPLEMENT = \"E52\";\n\n // RoleAuthorizer: Empty role set\n string constant EMPTY_ROLE_SET = \"E53\";\n\n // RoleAuthorizer: No auth for the role\n string constant NO_AUTH_FOR_THE_ROLE = \"E54\";\n\n // BaseACL: No in contract white list.\n string constant NOT_IN_CONTRACT_LIST = \"E55\";\n\n // BaseACL: Same process not allowed to install twice.\n string constant SAME_PROCESS_TWICE = \"E56\";\n\n // BaseAuthorizer: Account not set (then can not find roleManger)\n string constant ACCOUNT_NOT_SET = \"E57\";\n\n // BaseAuthorizer: roleManger not set\n string constant ROLE_MANAGER_NOT_SET = \"E58\";\n}\n" }, "BaseVersion.sol": { "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"IVersion.sol\";\n\n/// @title BaseVersion - Provides version information\n/// @author Cobo Safe Dev Team https://www.cobo.com/\n/// @dev\n/// Implement NAME() and VERSION() methods according to IVersion interface.\n///\n/// Or just:\n/// bytes32 public constant NAME = \"<Your contract name>\";\n/// uint256 public constant VERSION = <Your contract version>;\n///\n/// Change the NAME when writing new kind of contract.\n/// Change the VERSION when upgrading existing contract.\nabstract contract BaseVersion is IVersion {\n /// @dev Convert to `string` which looks prettier on Etherscan viewer.\n function _NAME() external view virtual returns (string memory) {\n return string(abi.encodePacked(this.NAME()));\n }\n}\n" }, "IVersion.sol": { "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\ninterface IVersion {\n function NAME() external view returns (bytes32 name);\n\n function VERSION() external view returns (uint256 version);\n}\n" } }, "settings": { "evmVersion": "istanbul", "optimizer": { "enabled": true, "runs": 200 }, "libraries": { "FlatRoleManager.sol": {} }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } } }}
1
20,291,106
8c25929c521bcce66140baedf53d4329ca129af8fe2a11f5d729acd52d3d4f8f
35ba109c1d4f05778de79247527063e5c266d0b16b8d4ed0da5e5a6a1a20a842
6a9ee871c0bd10323121b1f0e9c7212c48695d99
c0b00000e19d71fa50a9bb1fcac2ec92fac9549c
d2cad688f3fa618d73c3650faf0d00410a56b344
3d602d80600a3d3981f3363d3d373d3d3d363d737ba3cc542b70f8f1d6282dae222235d42cfd34cd5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d737ba3cc542b70f8f1d6282dae222235d42cfd34cd5af43d82803e903d91602b57fd5bf3
{{ "language": "Solidity", "sources": { "ArgusRootAuthorizer.sol": { "content": "// commit 5f44df01b85750d0fd9727dbcb77ceaafed3a7f4\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"EnumerableSet.sol\";\n\nimport \"BaseAuthorizer.sol\";\n\n/// @title ArgusRootAuthorizer - Default root authorizers for Argus platform.\n/// @author Cobo Safe Dev Team https://www.cobo.com/\n/// @notice ArgusRootAuthorizer is a authorizer manager which dispatch the correct\n/// sub authorizer according to role of delegate and call type.\n/// Hint is supported here so user can get the hint, the correct authorizer\n/// in this case, off-chain (this can be expensive on-chain) and preform\n/// on-chain transaction to save gas.\ncontract ArgusRootAuthorizer is BaseAuthorizer, IAuthorizerSupportingHint {\n using EnumerableSet for EnumerableSet.AddressSet;\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using TxFlags for uint256;\n using AuthFlags for uint256;\n\n bytes32 public constant NAME = \"ArgusRootAuthorizer\";\n uint256 public constant VERSION = 1;\n bytes32 public constant override TYPE = AuthType.SET;\n\n /// @dev This changes when authorizer adds.\n uint256 private _unionFlag;\n\n // Roles in the authorizer. Only used for enumeration.\n EnumerableSet.Bytes32Set roles;\n\n // `isDelegateCall` => `Role` => `Authorizer address set`\n // true for delegatecall, false for call.\n mapping(bool => mapping(bytes32 => EnumerableSet.AddressSet)) internal authorizerSet;\n\n // Authorizers who implement process handler (with flag `HAS_POST_PROC_MASK` or `HAS_POST_PROC_MASK`)\n // will added into `processSet` and will be invoked unconditionally at each tx.\n mapping(bool => EnumerableSet.AddressSet) internal processSet;\n\n /// Events.\n event NewAuthorizerAdded(bool indexed isDelegateCall, bytes32 indexed role, address indexed authorizer);\n event NewProcessAdded(bool indexed isDelegateCall, address indexed authorizer);\n event AuthorizerRemoved(bool indexed isDelegateCall, bytes32 indexed role, address indexed authorizer);\n event ProcessRemoved(bool indexed isDelegateCall, address indexed authorizer);\n\n constructor(address _owner, address _caller, address _account) BaseAuthorizer(_owner, _caller) {\n // We need role manager.\n account = _account;\n }\n\n /// @dev pack/unpack should match.\n function _packHint(bytes32 role, address auth, bytes memory subHint) internal pure returns (bytes memory hint) {\n return abi.encodePacked(abi.encode(role, auth), subHint);\n }\n\n function _unpackHint(bytes calldata hint) internal pure returns (bytes32 role, address auth, bytes memory subHint) {\n (role, auth) = abi.decode(hint[0:64], (bytes32, address));\n subHint = hint[64:];\n }\n\n /// @dev Catch error of sub authorizers to prevent the case when one authorizer fails reverts the entire\n /// check chain process.\n function _safePreExecCheck(\n address auth,\n TransactionData calldata transaction\n ) internal returns (AuthorizerReturnData memory preData) {\n try IAuthorizer(auth).preExecCheck(transaction) returns (AuthorizerReturnData memory _preData) {\n return _preData;\n } catch Error(string memory reason) {\n preData.result = AuthResult.FAILED;\n preData.message = reason;\n } catch (bytes memory reason) {\n preData.result = AuthResult.FAILED;\n preData.message = string(reason);\n }\n }\n\n function _safePostExecCheck(\n address auth,\n TransactionData calldata transaction,\n TransactionResult calldata callResult,\n AuthorizerReturnData memory preData\n ) internal returns (AuthorizerReturnData memory postData) {\n try IAuthorizer(auth).postExecCheck(transaction, callResult, preData) returns (\n AuthorizerReturnData memory _postData\n ) {\n return _postData;\n } catch Error(string memory reason) {\n postData.result = AuthResult.FAILED;\n postData.message = reason;\n } catch (bytes memory reason) {\n postData.result = AuthResult.FAILED;\n postData.message = string(reason);\n }\n }\n\n function _safeCollectHint(\n address auth,\n AuthorizerReturnData memory preData,\n AuthorizerReturnData memory postData\n ) internal returns (bytes memory subHint) {\n try IAuthorizerSupportingHint(auth).collectHint(preData, postData) returns (bytes memory _subHint) {\n return _subHint;\n } catch {\n return subHint;\n }\n }\n\n /// @dev preExecCheck and postExecCheck use extractly the same hint thus\n /// the same sub authorizer is called.\n function _preExecCheckWithHint(\n TransactionData calldata transaction\n ) internal returns (AuthorizerReturnData memory authData) {\n (bytes32 role, address auth, bytes memory subHint) = _unpackHint(transaction.hint);\n uint256 _flag = IAuthorizer(auth).flag();\n\n // The authorizer from hint should have either PreCheck or PostCheck.\n require(_flag.isValid(), Errors.INVALID_AUTHORIZER_FLAG);\n\n if (!_flag.hasPreCheck()) {\n // If pre check handler not exist, default success.\n authData.result = AuthResult.SUCCESS;\n return authData;\n }\n\n // Important: Validate the hint.\n // (1) The role from hint should be validated.\n require(_hasRole(transaction, role), Errors.INVALID_HINT);\n\n // (2) The authorizer from hint should have been registered with the role.\n bool isDelegateCall = transaction.flag.isDelegateCall();\n require(authorizerSet[isDelegateCall][role].contains(auth), Errors.INVALID_HINT);\n\n // Cut the hint to sub hint.\n TransactionData memory txn = transaction;\n txn.hint = subHint;\n\n // In hint path, this should never revert so `_safePreExecCheck()` is not used here.\n return IAuthorizer(auth).preExecCheck(txn);\n }\n\n function _postExecCheckWithHint(\n TransactionData calldata transaction,\n TransactionResult calldata callResult,\n AuthorizerReturnData calldata preData\n ) internal returns (AuthorizerReturnData memory authData) {\n (bytes32 role, address auth, bytes memory subHint) = _unpackHint(transaction.hint);\n uint256 _flag = IAuthorizer(auth).flag();\n\n require(_flag.isValid(), Errors.INVALID_AUTHORIZER_FLAG);\n if (!_flag.hasPostCheck()) {\n // If post check handler not exist, default success.\n authData.result = AuthResult.SUCCESS;\n return authData;\n }\n\n // Important: Validate the hint.\n // (1) The role from hint should be validated.\n require(_hasRole(transaction, role), Errors.INVALID_HINT);\n\n // (2) The authorizer from hint should have been registered with the role.\n bool isDelegateCall = transaction.flag.isDelegateCall();\n require(authorizerSet[isDelegateCall][role].contains(auth), Errors.INVALID_HINT);\n\n TransactionData memory txn = transaction;\n txn.hint = subHint;\n return IAuthorizer(auth).postExecCheck(txn, callResult, preData);\n }\n\n struct PreCheckData {\n bytes32 role;\n address authorizer;\n AuthorizerReturnData authData;\n }\n\n // This is very expensive on-chain.\n // Should only used to collect hint off-chain.\n PreCheckData[] internal preCheckDataCache;\n\n function _preExecCheck(\n TransactionData calldata transaction\n ) internal override returns (AuthorizerReturnData memory authData) {\n if (transaction.hint.length > 0) {\n return _preExecCheckWithHint(transaction);\n }\n\n authData.result = AuthResult.FAILED;\n bytes32[] memory txRoles = _authenticate(transaction);\n uint256 roleLength = txRoles.length;\n if (roleLength == 0) {\n authData.message = Errors.EMPTY_ROLE_SET;\n return authData;\n }\n\n bool isDelegateCall = transaction.flag.isDelegateCall();\n for (uint256 i = 0; i < roleLength; ++i) {\n bytes32 role = txRoles[i];\n EnumerableSet.AddressSet storage authSet = authorizerSet[isDelegateCall][role];\n\n uint256 length = authSet.length();\n\n // Run all pre checks and record auth results.\n for (uint256 j = 0; j < length; ++j) {\n address auth = authSet.at(j);\n AuthorizerReturnData memory preData = _safePreExecCheck(auth, transaction);\n\n if (preData.result == AuthResult.SUCCESS) {\n authData.result = AuthResult.SUCCESS;\n\n // Only save success results.\n preCheckDataCache.push(PreCheckData(role, auth, preData));\n }\n }\n }\n\n if (authData.result == AuthResult.SUCCESS) {\n // Temporary data for post checker to collect hint.\n authData.data = abi.encode(preCheckDataCache);\n } else {\n authData.message = Errors.ALL_AUTH_FAILED;\n }\n\n delete preCheckDataCache; // gas refund.\n }\n\n function _postExecCheck(\n TransactionData calldata transaction,\n TransactionResult calldata callResult,\n AuthorizerReturnData calldata preData\n ) internal override returns (AuthorizerReturnData memory postData) {\n if (transaction.hint.length > 0) {\n return _postExecCheckWithHint(transaction, callResult, preData);\n }\n\n // Get pre check results from preData.\n PreCheckData[] memory preResults = abi.decode(preData.data, (PreCheckData[]));\n uint256 length = preResults.length;\n\n // We should have reverted in preExecCheck. But safer is better.\n require(length > 0, Errors.INVALID_HINT_COLLECTED);\n\n bool isDelegateCall = transaction.flag.isDelegateCall();\n\n for (uint256 i = 0; i < length; ++i) {\n bytes32 role = preResults[i].role;\n address authAddress = preResults[i].authorizer;\n\n require(authorizerSet[isDelegateCall][role].contains(authAddress), Errors.INVALID_HINT_COLLECTED);\n\n // Run post check.\n AuthorizerReturnData memory preCheckData = preResults[i].authData;\n postData = _safePostExecCheck(authAddress, transaction, callResult, preCheckData);\n\n // If pre and post both succeeded, we pass.\n if (postData.result == AuthResult.SUCCESS) {\n // Collect hint of sub authorizer if needed.\n bytes memory subHint;\n if (IAuthorizer(authAddress).flag().supportHint()) {\n subHint = _safeCollectHint(authAddress, preCheckData, postData);\n }\n postData.data = _packHint(role, authAddress, subHint);\n return postData;\n }\n }\n postData.result = AuthResult.FAILED;\n postData.message = Errors.ALL_AUTH_FAILED;\n }\n\n function collectHint(\n AuthorizerReturnData calldata preAuthData,\n AuthorizerReturnData calldata postAuthData\n ) public view returns (bytes memory hint) {\n // Use post data as hint.\n hint = postAuthData.data;\n }\n\n /// @dev All sub preExecProcess / postExecProcess handlers are supposed be called.\n function _preExecProcess(TransactionData calldata transaction) internal virtual override {\n if (!_unionFlag.hasPreProcess()) return;\n\n bool isDelegateCall = transaction.flag.isDelegateCall();\n\n EnumerableSet.AddressSet storage procSet = processSet[isDelegateCall];\n uint256 length = procSet.length();\n for (uint256 i = 0; i < length; i++) {\n IAuthorizer auth = IAuthorizer(procSet.at(i));\n if (auth.flag().hasPreProcess()) {\n // Ignore reverts.\n try auth.preExecProcess(transaction) {} catch {}\n }\n }\n }\n\n function _postExecProcess(\n TransactionData calldata transaction,\n TransactionResult calldata callResult\n ) internal virtual override {\n if (!_unionFlag.hasPostProcess()) return;\n\n bool isDelegateCall = transaction.flag.isDelegateCall();\n\n EnumerableSet.AddressSet storage procSet = processSet[isDelegateCall];\n uint256 length = procSet.length();\n for (uint256 i = 0; i < length; i++) {\n IAuthorizer auth = IAuthorizer(procSet.at(i));\n if (auth.flag().hasPostProcess()) {\n // Ignore reverts.\n try auth.postExecProcess(transaction, callResult) {} catch {}\n }\n }\n }\n\n /// External / Public funtions.\n function addAuthorizer(bool isDelegateCall, bytes32 role, address authorizer) external onlyOwner {\n uint256 _flag = IAuthorizer(authorizer).flag();\n\n roles.add(role);\n\n if (authorizerSet[isDelegateCall][role].add(authorizer)) {\n emit NewAuthorizerAdded(isDelegateCall, role, authorizer);\n\n // Collect flag.\n _unionFlag |= _flag;\n\n if (_flag.hasPreProcess() || _flag.hasPostProcess()) {\n // An authorizer with process handler can NOT be installed twice as this cause\n // confusion when running process handler twice in one transaction.\n require(processSet[isDelegateCall].add(authorizer), Errors.SAME_PROCESS_TWICE);\n\n emit NewProcessAdded(isDelegateCall, authorizer);\n }\n }\n }\n\n function removeAuthorizer(bool isDelegateCall, bytes32 role, address authorizer) external onlyOwner {\n uint256 _flag = IAuthorizer(authorizer).flag();\n\n if (authorizerSet[isDelegateCall][role].remove(authorizer)) {\n emit AuthorizerRemoved(isDelegateCall, role, authorizer);\n\n if (_flag.hasPreProcess() || _flag.hasPostProcess()) {\n // It is ok to remove here as we has checked duplication in `addAuthorizer()`.\n if (processSet[isDelegateCall].remove(authorizer)) {\n emit ProcessRemoved(isDelegateCall, authorizer);\n\n if (processSet[isDelegateCall].length() == 0 && processSet[!isDelegateCall].length() == 0) {\n _unionFlag -= (_unionFlag & (AuthFlags.HAS_PRE_PROC_MASK | AuthFlags.HAS_POST_PROC_MASK));\n }\n }\n }\n }\n }\n\n /// External view funtions.\n\n function flag() external view returns (uint256) {\n return _unionFlag | AuthFlags.SUPPORT_HINT_MASK;\n }\n\n function authorizerSize(bool isDelegateCall, bytes32 role) external view returns (uint256) {\n return authorizerSet[isDelegateCall][role].length();\n }\n\n function hasAuthorizer(bool isDelegateCall, bytes32 role, address auth) external view returns (bool) {\n return authorizerSet[isDelegateCall][role].contains(auth);\n }\n\n function getAuthorizer(bool isDelegateCall, bytes32 role, uint256 i) external view returns (address) {\n return authorizerSet[isDelegateCall][role].at(i);\n }\n\n /// @dev View function allow user to specify the range in case we have very big set\n /// which can exhaust the gas of block limit when enumerating the entire list.\n function getAuthorizers(\n bool isDelegateCall,\n bytes32 role,\n uint256 start,\n uint256 end\n ) external view returns (address[] memory auths) {\n uint256 authorizerSetSize = authorizerSet[isDelegateCall][role].length();\n if (end > authorizerSetSize) end = authorizerSetSize;\n auths = new address[](end - start);\n for (uint256 i = 0; i < end - start; i++) {\n auths[i] = authorizerSet[isDelegateCall][role].at(start + i);\n }\n }\n\n function getAllAuthorizers(bool isDelegateCall, bytes32 role) external view returns (address[] memory) {\n return authorizerSet[isDelegateCall][role].values();\n }\n\n function getAllRoles() external view returns (bytes32[] memory) {\n return roles.values();\n }\n}\n" }, "EnumerableSet.sol": { "content": "// commit 5f44df01b85750d0fd9727dbcb77ceaafed3a7f4\n// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.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 * ```\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 EnumerableSet {\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" }, "BaseAuthorizer.sol": { "content": "// commit 5f44df01b85750d0fd9727dbcb77ceaafed3a7f4\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"BaseOwnable.sol\";\nimport \"Errors.sol\";\nimport \"IAuthorizer.sol\";\nimport \"IAccount.sol\";\nimport \"IRoleManager.sol\";\n\n/// @title BaseAuthorizer - A basic pausable authorizer with caller restriction.\n/// @author Cobo Safe Dev Team https://www.cobo.com/\n/// @dev Base contract to extend to implement specific authorizer.\nabstract contract BaseAuthorizer is IAuthorizer, BaseOwnable {\n /// @dev Override such constants while extending BaseAuthorizer.\n\n bool public paused = false;\n\n // Often used for off-chain system.\n // Each contract instance has its own value.\n bytes32 public tag = \"\";\n\n // The caller which is able to call this contract's pre/postExecProcess\n // and pre/postExecCheck having side-effect.\n // It is usually the account or the parent authorizer(set) on higher level.\n address public caller;\n\n // This is the account this authorizer works for.\n // Currently used to lookup `roleManager`.\n // If not used it is OK to keep it unset.\n address public account;\n\n event CallerSet(address indexed caller);\n event AccountSet(address indexed account);\n event TagSet(bytes32 indexed tag);\n event PausedSet(bool indexed status);\n\n constructor(address _owner, address _caller) BaseOwnable(_owner) {\n caller = _caller;\n }\n\n function initialize(address _owner, address _caller) public {\n initialize(_owner);\n caller = _caller;\n emit CallerSet(_caller);\n }\n\n function initialize(address _owner, address _caller, address _account) public {\n initialize(_owner, _caller);\n account = _account;\n emit AccountSet(_account);\n }\n\n modifier onlyCaller() virtual {\n require(msg.sender == caller, Errors.INVALID_CALLER);\n _;\n }\n\n /// @notice Change the caller.\n /// @param _caller the caller which calls the authorizer.\n function setCaller(address _caller) external onlyOwner {\n caller = _caller;\n emit CallerSet(_caller);\n }\n\n /// @notice Change the account.\n /// @param _account the account which the authorizer get role manager from.\n function setAccount(address _account) external onlyOwner {\n account = _account;\n emit AccountSet(_account);\n }\n\n /// @notice Change the tag for the contract instance.\n /// @dev For off-chain index.\n /// @param _tag the tag\n function setTag(bytes32 _tag) external onlyOwner {\n tag = _tag;\n emit TagSet(_tag);\n }\n\n /// @notice Set the pause status. Authorizer just denies all when paused.\n /// @param _paused the paused status: true or false.\n function setPaused(bool _paused) external onlyOwner {\n paused = _paused;\n emit PausedSet(_paused);\n }\n\n /// @notice Function check if a transaction can be executed.\n /// @param transaction Transaction data which contains from,to,value,data,delegate\n /// @return authData Return check status, error message and hint (if needed)\n function preExecCheck(\n TransactionData calldata transaction\n ) external virtual onlyCaller returns (AuthorizerReturnData memory authData) {\n if (paused) {\n authData.result = AuthResult.FAILED;\n authData.message = Errors.AUTHORIZER_PAUSED;\n } else {\n authData = _preExecCheck(transaction);\n }\n }\n\n /// @notice Check after transaction execution.\n /// @param transaction Transaction data which contains from,to,value,data,delegate\n /// @param callResult Transaction call status and return data.\n function postExecCheck(\n TransactionData calldata transaction,\n TransactionResult calldata callResult,\n AuthorizerReturnData calldata preData\n ) external virtual onlyCaller returns (AuthorizerReturnData memory authData) {\n if (paused) {\n authData.result = AuthResult.FAILED;\n authData.message = Errors.AUTHORIZER_PAUSED;\n } else {\n authData = _postExecCheck(transaction, callResult, preData);\n }\n }\n\n /// @dev Perform actions before the transaction execution.\n /// `onlyCaller` check forced here or attacker can call this directly\n /// to pollute our data.\n function preExecProcess(TransactionData calldata transaction) external virtual onlyCaller {\n if (!paused) _preExecProcess(transaction);\n }\n\n /// @dev Perform actions after the transaction execution.\n /// `onlyCaller` check forced here or attacker can call this directly\n /// to pollute our data.\n function postExecProcess(\n TransactionData calldata transaction,\n TransactionResult calldata callResult\n ) external virtual onlyCaller {\n if (!paused) _postExecProcess(transaction, callResult);\n }\n\n /// @dev Extract the roles of the delegate. If no roleManager set return empty lists.\n function _authenticate(TransactionData calldata transaction) internal view returns (bytes32[] memory roles) {\n return _authenticate(transaction.delegate);\n }\n\n function _authenticate(address delegate) internal view returns (bytes32[] memory roles) {\n require(account != address(0), Errors.ACCOUNT_NOT_SET);\n address roleManager = IAccount(account).roleManager();\n require(roleManager != address(0), Errors.ROLE_MANAGER_NOT_SET);\n roles = IRoleManager(roleManager).getRoles(delegate);\n }\n\n /// @dev Call `roleManager` to validate the role of delegate.\n function _hasRole(TransactionData calldata transaction, bytes32 role) internal view returns (bool) {\n return _hasRole(transaction.delegate, role);\n }\n\n function _hasRole(address delegate, bytes32 role) internal view returns (bool) {\n require(account != address(0), Errors.ACCOUNT_NOT_SET);\n address roleManager = IAccount(account).roleManager();\n require(roleManager != address(0), Errors.ROLE_MANAGER_NOT_SET);\n return IRoleManager(roleManager).hasRole(delegate, role);\n }\n\n /// @dev Override this to implement new authorization.\n /// NOTE: If your check involves side-effect, onlyCaller should be used.\n function _preExecCheck(\n TransactionData calldata transaction\n ) internal virtual returns (AuthorizerReturnData memory authData) {}\n\n /// @dev Override this to implement new authorization.\n function _postExecCheck(\n TransactionData calldata transaction,\n TransactionResult calldata callResult,\n AuthorizerReturnData calldata preData\n ) internal virtual returns (AuthorizerReturnData memory) {}\n\n function _preExecProcess(TransactionData calldata transaction) internal virtual {}\n\n function _postExecProcess(\n TransactionData calldata transaction,\n TransactionResult calldata callResult\n ) internal virtual {}\n\n /// @dev Override this if you implement new type of authorizer.\n function TYPE() external view virtual returns (bytes32) {\n return AuthType.COMMON;\n }\n}\n" }, "BaseOwnable.sol": { "content": "// commit 5f44df01b85750d0fd9727dbcb77ceaafed3a7f4\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"Errors.sol\";\nimport \"BaseVersion.sol\";\n\n/// @title BaseOwnable - Provides simple ownership access control.\n/// @author Cobo Safe Dev Team https://www.cobo.com/\n/// @dev Can be used in both proxy and non-proxy mode.\nabstract contract BaseOwnable is BaseVersion {\n address public owner;\n address public pendingOwner;\n bool private initialized = false;\n\n event PendingOwnerSet(address indexed to);\n event NewOwnerSet(address indexed owner);\n\n modifier onlyOwner() {\n require(owner == msg.sender, Errors.CALLER_IS_NOT_OWNER);\n _;\n }\n\n /// @dev `owner` is set by argument, thus the owner can any address.\n /// When used in non-proxy mode, `initialize` can not be called\n /// after deployment.\n constructor(address _owner) {\n initialize(_owner);\n }\n\n /// @dev When used in proxy mode, `initialize` can be called by anyone\n /// to claim the ownership.\n /// This function can be called only once.\n function initialize(address _owner) public {\n require(!initialized, Errors.ALREADY_INITIALIZED);\n _setOwner(_owner);\n initialized = true;\n }\n\n /// @notice User should ensure the corrent owner address set, or the\n /// ownership may be transferred to blackhole. It is recommended to\n /// take a safer way with setPendingOwner() + acceptOwner().\n function transferOwnership(address newOwner) external onlyOwner {\n require(newOwner != address(0), \"New Owner is zero\");\n _setOwner(newOwner);\n }\n\n /// @notice The original owner calls `setPendingOwner(newOwner)` and the new\n /// owner calls `acceptOwner()` to take the ownership.\n function setPendingOwner(address to) external onlyOwner {\n pendingOwner = to;\n emit PendingOwnerSet(pendingOwner);\n }\n\n function acceptOwner() external {\n require(msg.sender == pendingOwner);\n _setOwner(pendingOwner);\n }\n\n /// @notice Make the contract immutable.\n function renounceOwnership() external onlyOwner {\n _setOwner(address(0));\n }\n\n // Internal functions\n\n /// @dev Clear pendingOwner to prevent from reclaiming the ownership.\n function _setOwner(address _owner) internal {\n owner = _owner;\n pendingOwner = address(0);\n emit NewOwnerSet(owner);\n }\n}\n" }, "Errors.sol": { "content": "// commit 5f44df01b85750d0fd9727dbcb77ceaafed3a7f4\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\n/// @dev Common errors. This helps reducing the contract size.\nlibrary Errors {\n // \"E1\";\n\n // Call/Static-call failed.\n string constant CALL_FAILED = \"E2\";\n\n // Argument's type not supported in View Variant.\n string constant INVALID_VIEW_ARG_SOL_TYPE = \"E3\";\n\n // Invalid length for variant raw data.\n string constant INVALID_VARIANT_RAW_DATA = \"E4\";\n\n // \"E5\";\n\n // Invalid variant type.\n string constant INVALID_VAR_TYPE = \"E6\";\n\n // Rule not exists\n string constant RULE_NOT_EXISTS = \"E7\";\n\n // Variant name not found.\n string constant VAR_NAME_NOT_FOUND = \"E8\";\n\n // Rule: v1/v2 solType mismatch\n string constant SOL_TYPE_MISMATCH = \"E9\";\n\n // \"E10\";\n\n // Invalid rule OP.\n string constant INVALID_RULE_OP = \"E11\";\n\n // \"E12\";\n\n // \"E13\";\n\n // \"E14\";\n\n // \"E15\";\n\n // \"E16\";\n\n // \"E17\";\n\n // \"E18\";\n\n // \"E19\";\n\n // \"E20\";\n\n // checkCmpOp: OP not support\n string constant CMP_OP_NOT_SUPPORT = \"E21\";\n\n // checkBySolType: Invalid op for bool\n string constant INVALID_BOOL_OP = \"E22\";\n\n // checkBySolType: Invalid op\n string constant CHECK_INVALID_OP = \"E23\";\n\n // Invalid solidity type.\n string constant INVALID_SOL_TYPE = \"E24\";\n\n // computeBySolType: invalid vm op\n string constant INVALID_VM_BOOL_OP = \"E25\";\n\n // computeBySolType: invalid vm arith op\n string constant INVALID_VM_ARITH_OP = \"E26\";\n\n // onlyCaller: Invalid caller\n string constant INVALID_CALLER = \"E27\";\n\n // \"E28\";\n\n // Side-effect is not allowed here.\n string constant SIDE_EFFECT_NOT_ALLOWED = \"E29\";\n\n // Invalid variant count for the rule op.\n string constant INVALID_VAR_COUNT = \"E30\";\n\n // extractCallData: Invalid op.\n string constant INVALID_EXTRACTOR_OP = \"E31\";\n\n // extractCallData: Invalid array index.\n string constant INVALID_ARRAY_INDEX = \"E32\";\n\n // extractCallData: No extract op.\n string constant NO_EXTRACT_OP = \"E33\";\n\n // extractCallData: No extract path.\n string constant NO_EXTRACT_PATH = \"E34\";\n\n // BaseOwnable: caller is not owner\n string constant CALLER_IS_NOT_OWNER = \"E35\";\n\n // BaseOwnable: Already initialized\n string constant ALREADY_INITIALIZED = \"E36\";\n\n // \"E37\";\n\n // \"E38\";\n\n // BaseACL: ACL check method should not return anything.\n string constant ACL_FUNC_RETURNS_NON_EMPTY = \"E39\";\n\n // \"E40\";\n\n // BaseAccount: Invalid delegate.\n string constant INVALID_DELEGATE = \"E41\";\n\n // RootAuthorizer: delegateCallAuthorizer not set\n string constant DELEGATE_CALL_AUTH_NOT_SET = \"E42\";\n\n // RootAuthorizer: callAuthorizer not set.\n string constant CALL_AUTH_NOT_SET = \"E43\";\n\n // BaseAccount: Authorizer not set.\n string constant AUTHORIZER_NOT_SET = \"E44\";\n\n // BaseAccount: Invalid authorizer flag.\n string constant INVALID_AUTHORIZER_FLAG = \"E45\";\n\n // BaseAuthorizer: Authorizer paused.\n string constant AUTHORIZER_PAUSED = \"E46\";\n\n // Authorizer set: Invalid hint.\n string constant INVALID_HINT = \"E47\";\n\n // Authorizer set: All auth deny.\n string constant ALL_AUTH_FAILED = \"E48\";\n\n // BaseACL: Method not allow.\n string constant METHOD_NOT_ALLOW = \"E49\";\n\n // AuthorizerUnionSet: Invalid hint collected.\n string constant INVALID_HINT_COLLECTED = \"E50\";\n\n // AuthorizerSet: Empty auth set\n string constant EMPTY_AUTH_SET = \"E51\";\n\n // AuthorizerSet: hint not implement.\n string constant HINT_NOT_IMPLEMENT = \"E52\";\n\n // RoleAuthorizer: Empty role set\n string constant EMPTY_ROLE_SET = \"E53\";\n\n // RoleAuthorizer: No auth for the role\n string constant NO_AUTH_FOR_THE_ROLE = \"E54\";\n\n // BaseACL: No in contract white list.\n string constant NOT_IN_CONTRACT_LIST = \"E55\";\n\n // BaseACL: Same process not allowed to install twice.\n string constant SAME_PROCESS_TWICE = \"E56\";\n\n // BaseAuthorizer: Account not set (then can not find roleManger)\n string constant ACCOUNT_NOT_SET = \"E57\";\n\n // BaseAuthorizer: roleManger not set\n string constant ROLE_MANAGER_NOT_SET = \"E58\";\n}\n" }, "BaseVersion.sol": { "content": "// commit 5f44df01b85750d0fd9727dbcb77ceaafed3a7f4\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"IVersion.sol\";\n\n/// @title BaseVersion - Provides version information\n/// @author Cobo Safe Dev Team https://www.cobo.com/\n/// @dev\n/// Implement NAME() and VERSION() methods according to IVersion interface.\n///\n/// Or just:\n/// bytes32 public constant NAME = \"<Your contract name>\";\n/// uint256 public constant VERSION = <Your contract version>;\n///\n/// Change the NAME when writing new kind of contract.\n/// Change the VERSION when upgrading existing contract.\nabstract contract BaseVersion is IVersion {\n /// @dev Convert to `string` which looks prettier on Etherscan viewer.\n function _NAME() external view virtual returns (string memory) {\n return string(abi.encodePacked(this.NAME()));\n }\n}\n" }, "IVersion.sol": { "content": "// commit 5f44df01b85750d0fd9727dbcb77ceaafed3a7f4\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\ninterface IVersion {\n function NAME() external view returns (bytes32 name);\n\n function VERSION() external view returns (uint256 version);\n}\n" }, "IAuthorizer.sol": { "content": "// commit 5f44df01b85750d0fd9727dbcb77ceaafed3a7f4\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"Types.sol\";\n\ninterface IAuthorizer {\n function flag() external view returns (uint256 authFlags);\n\n function setCaller(address _caller) external;\n\n function preExecCheck(TransactionData calldata transaction) external returns (AuthorizerReturnData memory authData);\n\n function postExecCheck(\n TransactionData calldata transaction,\n TransactionResult calldata callResult,\n AuthorizerReturnData calldata preAuthData\n ) external returns (AuthorizerReturnData memory authData);\n\n function preExecProcess(TransactionData calldata transaction) external;\n\n function postExecProcess(TransactionData calldata transaction, TransactionResult calldata callResult) external;\n}\n\ninterface IAuthorizerSupportingHint is IAuthorizer {\n // When IAuthorizer(auth).flag().supportHint() == true;\n function collectHint(\n AuthorizerReturnData calldata preAuthData,\n AuthorizerReturnData calldata postAuthData\n ) external view returns (bytes memory hint);\n}\n" }, "Types.sol": { "content": "// commit 5f44df01b85750d0fd9727dbcb77ceaafed3a7f4\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nenum AuthResult {\n FAILED,\n SUCCESS\n}\n\nstruct CallData {\n uint256 flag; // 0x1 delegate call, 0x0 call.\n address to;\n uint256 value;\n bytes data; // calldata\n bytes hint;\n bytes extra; // for future support: signatures etc.\n}\n\nstruct TransactionData {\n address from; // Sender who performs the transaction a.k.a wallet address.\n address delegate; // Delegate who calls executeTransactions().\n // Same as CallData\n uint256 flag; // 0x1 delegate call, 0x0 call.\n address to;\n uint256 value;\n bytes data; // calldata\n bytes hint;\n bytes extra;\n}\n\nstruct AuthorizerReturnData {\n AuthResult result;\n string message;\n bytes data; // Authorizer return data. usually used for hint purpose.\n}\n\nstruct TransactionResult {\n bool success; // Call status.\n bytes data; // Return/Revert data.\n bytes hint;\n}\n\nlibrary TxFlags {\n uint256 internal constant DELEGATE_CALL_MASK = 0x1; // 1 for delegatecall, 0 for call\n\n function isDelegateCall(uint256 flag) internal pure returns (bool) {\n return flag & DELEGATE_CALL_MASK == DELEGATE_CALL_MASK;\n }\n}\n\nlibrary VarName {\n bytes5 internal constant TEMP = \"temp.\";\n\n function isTemp(bytes32 name) internal pure returns (bool) {\n return bytes5(name) == TEMP;\n }\n}\n\nlibrary AuthType {\n bytes32 internal constant FUNC = \"FunctionType\";\n bytes32 internal constant TRANSFER = \"TransferType\";\n bytes32 internal constant DEX = \"DexType\";\n bytes32 internal constant LENDING = \"LendingType\";\n bytes32 internal constant COMMON = \"CommonType\";\n bytes32 internal constant SET = \"SetType\";\n bytes32 internal constant VM = \"VM\";\n}\n\nlibrary AuthFlags {\n uint256 internal constant HAS_PRE_CHECK_MASK = 0x1;\n uint256 internal constant HAS_POST_CHECK_MASK = 0x2;\n uint256 internal constant HAS_PRE_PROC_MASK = 0x4;\n uint256 internal constant HAS_POST_PROC_MASK = 0x8;\n\n uint256 internal constant SUPPORT_HINT_MASK = 0x40;\n\n uint256 internal constant FULL_MODE =\n HAS_PRE_CHECK_MASK | HAS_POST_CHECK_MASK | HAS_PRE_PROC_MASK | HAS_POST_PROC_MASK;\n\n function isValid(uint256 flag) internal pure returns (bool) {\n // At least one check handler is activated.\n return hasPreCheck(flag) || hasPostCheck(flag);\n }\n\n function hasPreCheck(uint256 flag) internal pure returns (bool) {\n return flag & HAS_PRE_CHECK_MASK == HAS_PRE_CHECK_MASK;\n }\n\n function hasPostCheck(uint256 flag) internal pure returns (bool) {\n return flag & HAS_POST_CHECK_MASK == HAS_POST_CHECK_MASK;\n }\n\n function hasPreProcess(uint256 flag) internal pure returns (bool) {\n return flag & HAS_PRE_PROC_MASK == HAS_PRE_PROC_MASK;\n }\n\n function hasPostProcess(uint256 flag) internal pure returns (bool) {\n return flag & HAS_POST_PROC_MASK == HAS_POST_PROC_MASK;\n }\n\n function supportHint(uint256 flag) internal pure returns (bool) {\n return flag & SUPPORT_HINT_MASK == SUPPORT_HINT_MASK;\n }\n}\n\n// For Rule VM.\n\n// For each VariantType, an extractor should be implement.\nenum VariantType {\n INVALID, // Mark for delete.\n EXTRACT_CALLDATA, // extract calldata by path bytes.\n NAME, // name for user-defined variant.\n RAW, // encoded solidity values.\n VIEW, // staticcall view non-side-effect function and get return value.\n CALL, // call state changing function and get returned value.\n RULE, // rule expression.\n ANY\n}\n\n// How the data should be decoded.\nenum SolidityType {\n _invalid, // Mark for delete.\n _any,\n _bytes,\n _bool,\n ///// START 1\n ///// Generated by gen_rulelib.py (start)\n _address,\n _uint256,\n _int256,\n ///// Generated by gen_rulelib.py (end)\n ///// END 1\n _end\n}\n\n// A common operand in rule.\nstruct Variant {\n VariantType varType;\n SolidityType solType;\n bytes data;\n}\n\n// OpCode for rule expression which returns v0.\nenum OP {\n INVALID,\n // One opnd.\n VAR, // v1\n NOT, // !v1\n // Two opnds.\n // checkBySolType() which returns boolean.\n EQ, // v1 == v2\n NE, // v1 != v2\n GT, // v1 > v2\n GE, // v1 >= v2\n LT, // v1 < v2\n LE, // v1 <= v2\n IN, // v1 in [...]\n NOTIN, // v1 not in [...]\n // computeBySolType() which returns bytes (with same solType)\n AND, // v1 & v2\n OR, // v1 | v2\n ADD, // v1 + v2\n SUB, // v1 - v2\n MUL, // v1 * v2\n DIV, // v1 / v2\n MOD, // v1 % v2\n // Three opnds.\n IF, // v1? v2: v3\n // Side-effect ones.\n ASSIGN, // v1 := v2\n VM, // rule list bytes.\n NOP // as end.\n}\n\nstruct Rule {\n OP op;\n Variant[] vars;\n}\n" }, "IAccount.sol": { "content": "// commit 5f44df01b85750d0fd9727dbcb77ceaafed3a7f4\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"Types.sol\";\n\ninterface IAccount {\n /// @notice Call Gnosis Safe to execute a transaction\n /// @dev Delegates can call this method to invoke gnosis safe to forward to\n /// transaction to target contract\n /// The function can only be called by delegates.\n /// @param callData The callData to be called by Gnosis Safe\n function execTransaction(CallData calldata callData) external returns (TransactionResult memory result);\n\n function execTransactions(\n CallData[] calldata callDataList\n ) external returns (TransactionResult[] memory resultList);\n\n function setAuthorizer(address _authorizer) external;\n\n function setRoleManager(address _roleManager) external;\n\n function addDelegate(address _delegate) external;\n\n function addDelegates(address[] calldata _delegates) external;\n\n /// @dev Sub instance should override this to set `from` for transaction\n /// @return account The address for the contract wallet, also the\n /// `msg.sender` address which send the transaction.\n function getAccountAddress() external view returns (address account);\n\n function roleManager() external view returns (address _roleManager);\n\n function authorizer() external view returns (address _authorizer);\n}\n" }, "IRoleManager.sol": { "content": "// commit 5f44df01b85750d0fd9727dbcb77ceaafed3a7f4\n// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.19;\n\nimport \"Types.sol\";\n\ninterface IRoleManager {\n function getRoles(address delegate) external view returns (bytes32[] memory);\n\n function hasRole(address delegate, bytes32 role) external view returns (bool);\n}\n\ninterface IFlatRoleManager is IRoleManager {\n function addRoles(bytes32[] calldata roles) external;\n\n function grantRoles(bytes32[] calldata roles, address[] calldata delegates) external;\n\n function revokeRoles(bytes32[] calldata roles, address[] calldata delegates) external;\n\n function getDelegates() external view returns (address[] memory);\n\n function getAllRoles() external view returns (bytes32[] memory);\n}\n" } }, "settings": { "evmVersion": "istanbul", "optimizer": { "enabled": true, "runs": 200 }, "libraries": { "ArgusRootAuthorizer.sol": {} }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } } }}
1
20,291,107
c837e364c9f1440d2afaef43c3f3bec429973ea1c2b69f639efdb17a806ef3af
6f98c487a7219561bec85f6f15d6b7e4450d5e1b39f77f8fee26803fc9cc1d31
a7fb5ca286fc3fd67525629048a4de3ba24cba2e
c77ad0a71008d7094a62cfbd250a2eb2afdf2776
43c443eceaec90d79f97fdc1f3f9675f5411b403
608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe
1
20,291,111
6a13f6fdbf50d62e74b9fa6992be7093c75db330e190c89737403230e348740d
de9bc2f2cd5fa760cd729f815d51fe38a4148437344e6442f392d0deea1a251c
37d2b8d457cc4e4c45242f9f6f4459704f7cb2d0
37d2b8d457cc4e4c45242f9f6f4459704f7cb2d0
e4efed101d68bad12a74af433e91864d69954f86
60806040526019600655601b6007555f6008555f6009556017600a556019600b55601a600c556046600d555f600e556009600a6200003e91906200060d565b6505a52811d5006200005191906200065d565b600f556009600a6200006491906200060d565b6505a52811d5006200007791906200065d565b6010556009600a6200008a91906200060d565b6503d37ec7b5006200009d91906200065d565b6011556009600a620000b091906200060d565b6503d37ec7b500620000c391906200065d565b6012555f601460156101000a81548160ff0219169083151502179055505f601460166101000a81548160ff0219169083151502179055505f6015555f6016553480156200010e575f80fd5b505f620001206200044d60201b60201c565b9050805f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff165f73ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350620001cc6200044d60201b60201c565b60055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506009600a6200021b91906200060d565b66017e9d8602b4006200022f91906200065d565b60015f620002426200044d60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550600160035f620002946200045460201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550600160035f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550600160035f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550620003be6200044d60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff165f73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6009600a6200041c91906200060d565b66017e9d8602b4006200043091906200065d565b6040516200043f9190620006b8565b60405180910390a3620006d3565b5f33905090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b60018511156200050557808604811115620004dd57620004dc6200047b565b5b6001851615620004ed5780820291505b8081029050620004fd85620004a8565b9450620004bd565b94509492505050565b5f826200051f5760019050620005f1565b816200052e575f9050620005f1565b8160018114620005475760028114620005525762000588565b6001915050620005f1565b60ff8411156200056757620005666200047b565b5b8360020a9150848211156200058157620005806200047b565b5b50620005f1565b5060208310610133831016604e8410600b8410161715620005c25782820a905083811115620005bc57620005bb6200047b565b5b620005f1565b620005d18484846001620004b4565b92509050818404811115620005eb57620005ea6200047b565b5b81810290505b9392505050565b5f819050919050565b5f60ff82169050919050565b5f6200061982620005f8565b9150620006268362000601565b9250620006557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846200050e565b905092915050565b5f6200066982620005f8565b91506200067683620005f8565b92508282026200068681620005f8565b91508282048414831517620006a0576200069f6200047b565b5b5092915050565b620006b281620005f8565b82525050565b5f602082019050620006cd5f830184620006a7565b92915050565b61355d80620006e15f395ff3fe608060405260043610610143575f3560e01c8063715018a6116100b5578063a9059cbb1161006e578063a9059cbb1461040e578063bf474bed1461044a578063c9567bf914610474578063d34628cc1461048a578063dd62ed3e146104b2578063ec1f3f63146104ee5761014a565b8063715018a61461033a578063751039fc146103505780637d1db4a5146103665780638da5cb5b146103905780638f9a55c0146103ba57806395d89b41146103e45761014a565b806323b872dd1161010757806323b872dd1461021e578063313ce5671461025a57806331c2d847146102845780633bbac579146102ac57806351bc3c85146102e857806370a08231146102fe5761014a565b806306fdde031461014e578063095ea7b3146101785780630faee56f146101b4578063109daa99146101de57806318160ddd146101f45761014a565b3661014a57005b5f80fd5b348015610159575f80fd5b50610162610516565b60405161016f91906124f0565b60405180910390f35b348015610183575f80fd5b5061019e600480360381019061019991906125ae565b610553565b6040516101ab9190612606565b60405180910390f35b3480156101bf575f80fd5b506101c8610570565b6040516101d5919061262e565b60405180910390f35b3480156101e9575f80fd5b506101f2610576565b005b3480156101ff575f80fd5b5061020861064a565b604051610215919061262e565b60405180910390f35b348015610229575f80fd5b50610244600480360381019061023f9190612647565b610670565b6040516102519190612606565b60405180910390f35b348015610265575f80fd5b5061026e610744565b60405161027b91906126b2565b60405180910390f35b34801561028f575f80fd5b506102aa60048036038101906102a5919061280b565b61074c565b005b3480156102b7575f80fd5b506102d260048036038101906102cd9190612852565b61086a565b6040516102df9190612606565b60405180910390f35b3480156102f3575f80fd5b506102fc6108bc565b005b348015610309575f80fd5b50610324600480360381019061031f9190612852565b610953565b604051610331919061262e565b60405180910390f35b348015610345575f80fd5b5061034e610999565b005b34801561035b575f80fd5b50610364610ae7565b005b348015610371575f80fd5b5061037a610c1f565b604051610387919061262e565b60405180910390f35b34801561039b575f80fd5b506103a4610c25565b6040516103b1919061288c565b60405180910390f35b3480156103c5575f80fd5b506103ce610c4c565b6040516103db919061262e565b60405180910390f35b3480156103ef575f80fd5b506103f8610c52565b60405161040591906124f0565b60405180910390f35b348015610419575f80fd5b50610434600480360381019061042f91906125ae565b610c8f565b6040516104419190612606565b60405180910390f35b348015610455575f80fd5b5061045e610cac565b60405161046b919061262e565b60405180910390f35b34801561047f575f80fd5b50610488610cb2565b005b348015610495575f80fd5b506104b060048036038101906104ab919061280b565b6111d4565b005b3480156104bd575f80fd5b506104d860048036038101906104d391906128a5565b6112f3565b6040516104e5919061262e565b60405180910390f35b3480156104f9575f80fd5b50610514600480360381019061050f91906128e3565b611375565b005b60606040518060400160405280600581526020017f517561636b000000000000000000000000000000000000000000000000000000815250905090565b5f61056661055f611401565b8484611408565b6001905092915050565b60125481565b61057e611401565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461060a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060190612958565b60405180910390fd5b5f600d819055507fe9b79e1a6c2dc43b4c0c6ff01ce9e3332d810e482270f464c0a21ad6c5fc6de35f60405161064091906129b8565b60405180910390a1565b5f6009600a6106599190612b2d565b66017e9d8602b40061066b9190612b77565b905090565b5f61067c8484846115cb565b61073984610688611401565b610734856040518060600160405280602881526020016135006028913960025f8b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6106eb611401565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054611f529092919063ffffffff16565b611408565b600190509392505050565b5f6009905090565b610754611401565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d790612958565b60405180910390fd5b5f5b8151811015610866575f60045f84848151811061080257610801612bb8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506107e2565b5050565b5f60045f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff169050919050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611401565b73ffffffffffffffffffffffffffffffffffffffff161461091b575f80fd5b5f61092530610953565b90505f8111156109395761093881611fb4565b5b5f4790505f81111561094f5761094e8161221f565b5b5050565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b6109a1611401565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2490612958565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35f805f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610aef611401565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7290612958565b60405180910390fd5b6009600a610b899190612b2d565b66017e9d8602b400610b9b9190612b77565b600f819055506009600a610baf9190612b2d565b66017e9d8602b400610bc19190612b77565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6009600a610bf69190612b2d565b66017e9d8602b400610c089190612b77565b604051610c15919061262e565b60405180910390a1565b600f5481565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60105481565b60606040518060400160405280600581526020017f515541434b000000000000000000000000000000000000000000000000000000815250905090565b5f610ca2610c9b611401565b84846115cb565b6001905092915050565b60115481565b610cba611401565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3d90612958565b60405180910390fd5b60148054906101000a900460ff1615610d94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8b90612c2f565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d60135f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e333060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166009600a610e1c9190612b2d565b66017e9d8602b400610e2e9190612b77565b611408565b60135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e9d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ec19190612c61565b73ffffffffffffffffffffffffffffffffffffffff1663c9c653963060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f47573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f6b9190612c61565b6040518363ffffffff1660e01b8152600401610f88929190612c8c565b6020604051808303815f875af1158015610fa4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fc89190612c61565b60145f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061104f30610953565b5f80611059610c25565b426040518863ffffffff1660e01b815260040161107b96959493929190612cb3565b60606040518083038185885af1158015611097573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906110bc9190612d26565b50505060145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161115c929190612d76565b6020604051808303815f875af1158015611178573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061119c9190612dc7565b506001601460166101000a81548160ff02191690831515021790555060016014806101000a81548160ff021916908315150217905550565b6111dc611401565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611268576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125f90612958565b60405180910390fd5b5f5b81518110156112ef57600160045f84848151811061128b5761128a612bb8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550808060010191505061126a565b5050565b5f60025f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113b5611401565b73ffffffffffffffffffffffffffffffffffffffff16146113d4575f80fd5b60085481111580156113e857506009548111155b6113f0575f80fd5b806008819055508060098190555050565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611476576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146d90612e62565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612ef0565b60405180910390fd5b8060025f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115be919061262e565b60405180910390a3505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611639576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163090612f7e565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036116a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169e9061300c565b60405180910390fd5b5f81116116e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e09061309a565b60405180910390fd5b5f6116f2610c25565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156117605750611730610c25565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611ca25760045f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16158015611803575060045f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b61180b575f80fd5b5f600e5403611853576118506064611842600a54600e541161182f57600654611833565b6008545b8561228790919063ffffffff16565b6122fe90919063ffffffff16565b90505b5f600e541115611888576118856064611877600d548561228790919063ffffffff16565b6122fe90919063ffffffff16565b90505b60145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611931575060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611984575060035f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b15611a7c57600f548211156119ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c590613102565b60405180910390fd5b601054826119db85610953565b6119e59190613120565b1115611a26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1d9061319d565b60405180910390fd5b611a626064611a54600a54600e5411611a4157600654611a45565b6008545b8561228790919063ffffffff16565b6122fe90919063ffffffff16565b9050600e5f815480929190611a76906131bb565b91905055505b60145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b0457503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611b4857611b456064611b37600b54600e5411611b2457600754611b28565b6009545b8561228790919063ffffffff16565b6122fe90919063ffffffff16565b90505b5f611b5230610953565b9050601460159054906101000a900460ff16158015611bbd575060145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b8015611bd55750601460169054906101000a900460ff165b8015611be2575060115481115b8015611bf15750600c54600e54115b15611ca057601654431115611c08575f6015819055505b600360155410611c4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c449061324c565b60405180910390fd5b611c6a611c6584611c6084601254612347565b612347565b611fb4565b5f4790505f811115611c8057611c7f4761221f565b5b60155f815480929190611c92906131bb565b919050555043601681905550505b505b5f811115611da157611cfa8160015f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205461235f90919063ffffffff16565b60015f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611d98919061262e565b60405180910390a35b611df18260015f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20546123bc90919063ffffffff16565b60015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550611e94611e4882846123bc90919063ffffffff16565b60015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205461235f90919063ffffffff16565b60015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef611f3784866123bc90919063ffffffff16565b604051611f44919061262e565b60405180910390a350505050565b5f838311158290611f99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f9091906124f0565b60405180910390fd5b505f8385611fa7919061326a565b9050809150509392505050565b6001601460156101000a81548160ff0219169083151502179055505f600267ffffffffffffffff811115611feb57611fea6126cf565b5b6040519080825280602002602001820160405280156120195781602001602082028036833780820191505090505b50905030815f815181106120305761202f612bb8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156120d4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906120f89190612c61565b8160018151811061210c5761210b612bb8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506121723060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611408565b60135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947835f8430426040518663ffffffff1660e01b81526004016121d4959493929190613354565b5f604051808303815f87803b1580156121eb575f80fd5b505af11580156121fd573d5f803e3d5ffd5b50505050505f601460156101000a81548160ff02191690831515021790555050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f19350505050158015612283573d5f803e3d5ffd5b5050565b5f808303612297575f90506122f8565b5f82846122a49190612b77565b90508284826122b391906133d9565b146122f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122ea90613479565b60405180910390fd5b809150505b92915050565b5f61233f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612405565b905092915050565b5f8183116123555782612357565b815b905092915050565b5f80828461236d9190613120565b9050838110156123b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123a9906134e1565b60405180910390fd5b8091505092915050565b5f6123fd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f52565b905092915050565b5f808311829061244b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161244291906124f0565b60405180910390fd5b505f838561245991906133d9565b9050809150509392505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561249d578082015181840152602081019050612482565b5f8484015250505050565b5f601f19601f8301169050919050565b5f6124c282612466565b6124cc8185612470565b93506124dc818560208601612480565b6124e5816124a8565b840191505092915050565b5f6020820190508181035f83015261250881846124b8565b905092915050565b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61254a82612521565b9050919050565b61255a81612540565b8114612564575f80fd5b50565b5f8135905061257581612551565b92915050565b5f819050919050565b61258d8161257b565b8114612597575f80fd5b50565b5f813590506125a881612584565b92915050565b5f80604083850312156125c4576125c3612519565b5b5f6125d185828601612567565b92505060206125e28582860161259a565b9150509250929050565b5f8115159050919050565b612600816125ec565b82525050565b5f6020820190506126195f8301846125f7565b92915050565b6126288161257b565b82525050565b5f6020820190506126415f83018461261f565b92915050565b5f805f6060848603121561265e5761265d612519565b5b5f61266b86828701612567565b935050602061267c86828701612567565b925050604061268d8682870161259a565b9150509250925092565b5f60ff82169050919050565b6126ac81612697565b82525050565b5f6020820190506126c55f8301846126a3565b92915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b612705826124a8565b810181811067ffffffffffffffff82111715612724576127236126cf565b5b80604052505050565b5f612736612510565b905061274282826126fc565b919050565b5f67ffffffffffffffff821115612761576127606126cf565b5b602082029050602081019050919050565b5f80fd5b5f61278861278384612747565b61272d565b905080838252602082019050602084028301858111156127ab576127aa612772565b5b835b818110156127d457806127c08882612567565b8452602084019350506020810190506127ad565b5050509392505050565b5f82601f8301126127f2576127f16126cb565b5b8135612802848260208601612776565b91505092915050565b5f602082840312156128205761281f612519565b5b5f82013567ffffffffffffffff81111561283d5761283c61251d565b5b612849848285016127de565b91505092915050565b5f6020828403121561286757612866612519565b5b5f61287484828501612567565b91505092915050565b61288681612540565b82525050565b5f60208201905061289f5f83018461287d565b92915050565b5f80604083850312156128bb576128ba612519565b5b5f6128c885828601612567565b92505060206128d985828601612567565b9150509250929050565b5f602082840312156128f8576128f7612519565b5b5f6129058482850161259a565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f612942602083612470565b915061294d8261290e565b602082019050919050565b5f6020820190508181035f83015261296f81612936565b9050919050565b5f819050919050565b5f819050919050565b5f6129a261299d61299884612976565b61297f565b61257b565b9050919050565b6129b281612988565b82525050565b5f6020820190506129cb5f8301846129a9565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b6001851115612a5357808604811115612a2f57612a2e6129d1565b5b6001851615612a3e5780820291505b8081029050612a4c856129fe565b9450612a13565b94509492505050565b5f82612a6b5760019050612b26565b81612a78575f9050612b26565b8160018114612a8e5760028114612a9857612ac7565b6001915050612b26565b60ff841115612aaa57612aa96129d1565b5b8360020a915084821115612ac157612ac06129d1565b5b50612b26565b5060208310610133831016604e8410600b8410161715612afc5782820a905083811115612af757612af66129d1565b5b612b26565b612b098484846001612a0a565b92509050818404811115612b2057612b1f6129d1565b5b81810290505b9392505050565b5f612b378261257b565b9150612b4283612697565b9250612b6f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484612a5c565b905092915050565b5f612b818261257b565b9150612b8c8361257b565b9250828202612b9a8161257b565b91508282048414831517612bb157612bb06129d1565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f74726164696e6720697320616c7265616479206f70656e0000000000000000005f82015250565b5f612c19601783612470565b9150612c2482612be5565b602082019050919050565b5f6020820190508181035f830152612c4681612c0d565b9050919050565b5f81519050612c5b81612551565b92915050565b5f60208284031215612c7657612c75612519565b5b5f612c8384828501612c4d565b91505092915050565b5f604082019050612c9f5f83018561287d565b612cac602083018461287d565b9392505050565b5f60c082019050612cc65f83018961287d565b612cd3602083018861261f565b612ce060408301876129a9565b612ced60608301866129a9565b612cfa608083018561287d565b612d0760a083018461261f565b979650505050505050565b5f81519050612d2081612584565b92915050565b5f805f60608486031215612d3d57612d3c612519565b5b5f612d4a86828701612d12565b9350506020612d5b86828701612d12565b9250506040612d6c86828701612d12565b9150509250925092565b5f604082019050612d895f83018561287d565b612d96602083018461261f565b9392505050565b612da6816125ec565b8114612db0575f80fd5b50565b5f81519050612dc181612d9d565b92915050565b5f60208284031215612ddc57612ddb612519565b5b5f612de984828501612db3565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f612e4c602483612470565b9150612e5782612df2565b604082019050919050565b5f6020820190508181035f830152612e7981612e40565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f612eda602283612470565b9150612ee582612e80565b604082019050919050565b5f6020820190508181035f830152612f0781612ece565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f612f68602583612470565b9150612f7382612f0e565b604082019050919050565b5f6020820190508181035f830152612f9581612f5c565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f612ff6602383612470565b915061300182612f9c565b604082019050919050565b5f6020820190508181035f83015261302381612fea565b9050919050565b7f5472616e7366657220616d6f756e74206d7573742062652067726561746572205f8201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b5f613084602983612470565b915061308f8261302a565b604082019050919050565b5f6020820190508181035f8301526130b181613078565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e000000000000005f82015250565b5f6130ec601983612470565b91506130f7826130b8565b602082019050919050565b5f6020820190508181035f830152613119816130e0565b9050919050565b5f61312a8261257b565b91506131358361257b565b925082820190508082111561314d5761314c6129d1565b5b92915050565b7f4578636565647320746865206d617857616c6c657453697a652e0000000000005f82015250565b5f613187601a83612470565b915061319282613153565b602082019050919050565b5f6020820190508181035f8301526131b48161317b565b9050919050565b5f6131c58261257b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036131f7576131f66129d1565b5b600182019050919050565b7f4f6e6c7920332073656c6c732070657220626c6f636b210000000000000000005f82015250565b5f613236601783612470565b915061324182613202565b602082019050919050565b5f6020820190508181035f8301526132638161322a565b9050919050565b5f6132748261257b565b915061327f8361257b565b9250828203905081811115613297576132966129d1565b5b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b6132cf81612540565b82525050565b5f6132e083836132c6565b60208301905092915050565b5f602082019050919050565b5f6133028261329d565b61330c81856132a7565b9350613317836132b7565b805f5b8381101561334757815161332e88826132d5565b9750613339836132ec565b92505060018101905061331a565b5085935050505092915050565b5f60a0820190506133675f83018861261f565b61337460208301876129a9565b818103604083015261338681866132f8565b9050613395606083018561287d565b6133a2608083018461261f565b9695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6133e38261257b565b91506133ee8361257b565b9250826133fe576133fd6133ac565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f5f8201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b5f613463602183612470565b915061346e82613409565b604082019050919050565b5f6020820190508181035f83015261349081613457565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f7700000000005f82015250565b5f6134cb601b83612470565b91506134d682613497565b602082019050919050565b5f6020820190508181035f8301526134f8816134bf565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201a58c3d9b12196ac4502d356f64667d3dbc90138f61e5c2eabc810eaabe1327264736f6c63430008170033
608060405260043610610143575f3560e01c8063715018a6116100b5578063a9059cbb1161006e578063a9059cbb1461040e578063bf474bed1461044a578063c9567bf914610474578063d34628cc1461048a578063dd62ed3e146104b2578063ec1f3f63146104ee5761014a565b8063715018a61461033a578063751039fc146103505780637d1db4a5146103665780638da5cb5b146103905780638f9a55c0146103ba57806395d89b41146103e45761014a565b806323b872dd1161010757806323b872dd1461021e578063313ce5671461025a57806331c2d847146102845780633bbac579146102ac57806351bc3c85146102e857806370a08231146102fe5761014a565b806306fdde031461014e578063095ea7b3146101785780630faee56f146101b4578063109daa99146101de57806318160ddd146101f45761014a565b3661014a57005b5f80fd5b348015610159575f80fd5b50610162610516565b60405161016f91906124f0565b60405180910390f35b348015610183575f80fd5b5061019e600480360381019061019991906125ae565b610553565b6040516101ab9190612606565b60405180910390f35b3480156101bf575f80fd5b506101c8610570565b6040516101d5919061262e565b60405180910390f35b3480156101e9575f80fd5b506101f2610576565b005b3480156101ff575f80fd5b5061020861064a565b604051610215919061262e565b60405180910390f35b348015610229575f80fd5b50610244600480360381019061023f9190612647565b610670565b6040516102519190612606565b60405180910390f35b348015610265575f80fd5b5061026e610744565b60405161027b91906126b2565b60405180910390f35b34801561028f575f80fd5b506102aa60048036038101906102a5919061280b565b61074c565b005b3480156102b7575f80fd5b506102d260048036038101906102cd9190612852565b61086a565b6040516102df9190612606565b60405180910390f35b3480156102f3575f80fd5b506102fc6108bc565b005b348015610309575f80fd5b50610324600480360381019061031f9190612852565b610953565b604051610331919061262e565b60405180910390f35b348015610345575f80fd5b5061034e610999565b005b34801561035b575f80fd5b50610364610ae7565b005b348015610371575f80fd5b5061037a610c1f565b604051610387919061262e565b60405180910390f35b34801561039b575f80fd5b506103a4610c25565b6040516103b1919061288c565b60405180910390f35b3480156103c5575f80fd5b506103ce610c4c565b6040516103db919061262e565b60405180910390f35b3480156103ef575f80fd5b506103f8610c52565b60405161040591906124f0565b60405180910390f35b348015610419575f80fd5b50610434600480360381019061042f91906125ae565b610c8f565b6040516104419190612606565b60405180910390f35b348015610455575f80fd5b5061045e610cac565b60405161046b919061262e565b60405180910390f35b34801561047f575f80fd5b50610488610cb2565b005b348015610495575f80fd5b506104b060048036038101906104ab919061280b565b6111d4565b005b3480156104bd575f80fd5b506104d860048036038101906104d391906128a5565b6112f3565b6040516104e5919061262e565b60405180910390f35b3480156104f9575f80fd5b50610514600480360381019061050f91906128e3565b611375565b005b60606040518060400160405280600581526020017f517561636b000000000000000000000000000000000000000000000000000000815250905090565b5f61056661055f611401565b8484611408565b6001905092915050565b60125481565b61057e611401565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461060a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060190612958565b60405180910390fd5b5f600d819055507fe9b79e1a6c2dc43b4c0c6ff01ce9e3332d810e482270f464c0a21ad6c5fc6de35f60405161064091906129b8565b60405180910390a1565b5f6009600a6106599190612b2d565b66017e9d8602b40061066b9190612b77565b905090565b5f61067c8484846115cb565b61073984610688611401565b610734856040518060600160405280602881526020016135006028913960025f8b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6106eb611401565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054611f529092919063ffffffff16565b611408565b600190509392505050565b5f6009905090565b610754611401565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d790612958565b60405180910390fd5b5f5b8151811015610866575f60045f84848151811061080257610801612bb8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506107e2565b5050565b5f60045f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff169050919050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611401565b73ffffffffffffffffffffffffffffffffffffffff161461091b575f80fd5b5f61092530610953565b90505f8111156109395761093881611fb4565b5b5f4790505f81111561094f5761094e8161221f565b5b5050565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b6109a1611401565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2490612958565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35f805f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610aef611401565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7290612958565b60405180910390fd5b6009600a610b899190612b2d565b66017e9d8602b400610b9b9190612b77565b600f819055506009600a610baf9190612b2d565b66017e9d8602b400610bc19190612b77565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6009600a610bf69190612b2d565b66017e9d8602b400610c089190612b77565b604051610c15919061262e565b60405180910390a1565b600f5481565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60105481565b60606040518060400160405280600581526020017f515541434b000000000000000000000000000000000000000000000000000000815250905090565b5f610ca2610c9b611401565b84846115cb565b6001905092915050565b60115481565b610cba611401565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3d90612958565b60405180910390fd5b60148054906101000a900460ff1615610d94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8b90612c2f565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d60135f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e333060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166009600a610e1c9190612b2d565b66017e9d8602b400610e2e9190612b77565b611408565b60135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e9d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ec19190612c61565b73ffffffffffffffffffffffffffffffffffffffff1663c9c653963060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f47573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f6b9190612c61565b6040518363ffffffff1660e01b8152600401610f88929190612c8c565b6020604051808303815f875af1158015610fa4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fc89190612c61565b60145f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061104f30610953565b5f80611059610c25565b426040518863ffffffff1660e01b815260040161107b96959493929190612cb3565b60606040518083038185885af1158015611097573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906110bc9190612d26565b50505060145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161115c929190612d76565b6020604051808303815f875af1158015611178573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061119c9190612dc7565b506001601460166101000a81548160ff02191690831515021790555060016014806101000a81548160ff021916908315150217905550565b6111dc611401565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611268576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125f90612958565b60405180910390fd5b5f5b81518110156112ef57600160045f84848151811061128b5761128a612bb8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550808060010191505061126a565b5050565b5f60025f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113b5611401565b73ffffffffffffffffffffffffffffffffffffffff16146113d4575f80fd5b60085481111580156113e857506009548111155b6113f0575f80fd5b806008819055508060098190555050565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611476576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146d90612e62565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612ef0565b60405180910390fd5b8060025f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115be919061262e565b60405180910390a3505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611639576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163090612f7e565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036116a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169e9061300c565b60405180910390fd5b5f81116116e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e09061309a565b60405180910390fd5b5f6116f2610c25565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156117605750611730610c25565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611ca25760045f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16158015611803575060045f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b61180b575f80fd5b5f600e5403611853576118506064611842600a54600e541161182f57600654611833565b6008545b8561228790919063ffffffff16565b6122fe90919063ffffffff16565b90505b5f600e541115611888576118856064611877600d548561228790919063ffffffff16565b6122fe90919063ffffffff16565b90505b60145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611931575060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611984575060035f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b15611a7c57600f548211156119ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c590613102565b60405180910390fd5b601054826119db85610953565b6119e59190613120565b1115611a26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1d9061319d565b60405180910390fd5b611a626064611a54600a54600e5411611a4157600654611a45565b6008545b8561228790919063ffffffff16565b6122fe90919063ffffffff16565b9050600e5f815480929190611a76906131bb565b91905055505b60145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b0457503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611b4857611b456064611b37600b54600e5411611b2457600754611b28565b6009545b8561228790919063ffffffff16565b6122fe90919063ffffffff16565b90505b5f611b5230610953565b9050601460159054906101000a900460ff16158015611bbd575060145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b8015611bd55750601460169054906101000a900460ff165b8015611be2575060115481115b8015611bf15750600c54600e54115b15611ca057601654431115611c08575f6015819055505b600360155410611c4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c449061324c565b60405180910390fd5b611c6a611c6584611c6084601254612347565b612347565b611fb4565b5f4790505f811115611c8057611c7f4761221f565b5b60155f815480929190611c92906131bb565b919050555043601681905550505b505b5f811115611da157611cfa8160015f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205461235f90919063ffffffff16565b60015f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611d98919061262e565b60405180910390a35b611df18260015f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20546123bc90919063ffffffff16565b60015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550611e94611e4882846123bc90919063ffffffff16565b60015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205461235f90919063ffffffff16565b60015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef611f3784866123bc90919063ffffffff16565b604051611f44919061262e565b60405180910390a350505050565b5f838311158290611f99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f9091906124f0565b60405180910390fd5b505f8385611fa7919061326a565b9050809150509392505050565b6001601460156101000a81548160ff0219169083151502179055505f600267ffffffffffffffff811115611feb57611fea6126cf565b5b6040519080825280602002602001820160405280156120195781602001602082028036833780820191505090505b50905030815f815181106120305761202f612bb8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156120d4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906120f89190612c61565b8160018151811061210c5761210b612bb8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506121723060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611408565b60135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947835f8430426040518663ffffffff1660e01b81526004016121d4959493929190613354565b5f604051808303815f87803b1580156121eb575f80fd5b505af11580156121fd573d5f803e3d5ffd5b50505050505f601460156101000a81548160ff02191690831515021790555050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f19350505050158015612283573d5f803e3d5ffd5b5050565b5f808303612297575f90506122f8565b5f82846122a49190612b77565b90508284826122b391906133d9565b146122f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122ea90613479565b60405180910390fd5b809150505b92915050565b5f61233f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612405565b905092915050565b5f8183116123555782612357565b815b905092915050565b5f80828461236d9190613120565b9050838110156123b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123a9906134e1565b60405180910390fd5b8091505092915050565b5f6123fd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f52565b905092915050565b5f808311829061244b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161244291906124f0565b60405180910390fd5b505f838561245991906133d9565b9050809150509392505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561249d578082015181840152602081019050612482565b5f8484015250505050565b5f601f19601f8301169050919050565b5f6124c282612466565b6124cc8185612470565b93506124dc818560208601612480565b6124e5816124a8565b840191505092915050565b5f6020820190508181035f83015261250881846124b8565b905092915050565b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61254a82612521565b9050919050565b61255a81612540565b8114612564575f80fd5b50565b5f8135905061257581612551565b92915050565b5f819050919050565b61258d8161257b565b8114612597575f80fd5b50565b5f813590506125a881612584565b92915050565b5f80604083850312156125c4576125c3612519565b5b5f6125d185828601612567565b92505060206125e28582860161259a565b9150509250929050565b5f8115159050919050565b612600816125ec565b82525050565b5f6020820190506126195f8301846125f7565b92915050565b6126288161257b565b82525050565b5f6020820190506126415f83018461261f565b92915050565b5f805f6060848603121561265e5761265d612519565b5b5f61266b86828701612567565b935050602061267c86828701612567565b925050604061268d8682870161259a565b9150509250925092565b5f60ff82169050919050565b6126ac81612697565b82525050565b5f6020820190506126c55f8301846126a3565b92915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b612705826124a8565b810181811067ffffffffffffffff82111715612724576127236126cf565b5b80604052505050565b5f612736612510565b905061274282826126fc565b919050565b5f67ffffffffffffffff821115612761576127606126cf565b5b602082029050602081019050919050565b5f80fd5b5f61278861278384612747565b61272d565b905080838252602082019050602084028301858111156127ab576127aa612772565b5b835b818110156127d457806127c08882612567565b8452602084019350506020810190506127ad565b5050509392505050565b5f82601f8301126127f2576127f16126cb565b5b8135612802848260208601612776565b91505092915050565b5f602082840312156128205761281f612519565b5b5f82013567ffffffffffffffff81111561283d5761283c61251d565b5b612849848285016127de565b91505092915050565b5f6020828403121561286757612866612519565b5b5f61287484828501612567565b91505092915050565b61288681612540565b82525050565b5f60208201905061289f5f83018461287d565b92915050565b5f80604083850312156128bb576128ba612519565b5b5f6128c885828601612567565b92505060206128d985828601612567565b9150509250929050565b5f602082840312156128f8576128f7612519565b5b5f6129058482850161259a565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f612942602083612470565b915061294d8261290e565b602082019050919050565b5f6020820190508181035f83015261296f81612936565b9050919050565b5f819050919050565b5f819050919050565b5f6129a261299d61299884612976565b61297f565b61257b565b9050919050565b6129b281612988565b82525050565b5f6020820190506129cb5f8301846129a9565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b6001851115612a5357808604811115612a2f57612a2e6129d1565b5b6001851615612a3e5780820291505b8081029050612a4c856129fe565b9450612a13565b94509492505050565b5f82612a6b5760019050612b26565b81612a78575f9050612b26565b8160018114612a8e5760028114612a9857612ac7565b6001915050612b26565b60ff841115612aaa57612aa96129d1565b5b8360020a915084821115612ac157612ac06129d1565b5b50612b26565b5060208310610133831016604e8410600b8410161715612afc5782820a905083811115612af757612af66129d1565b5b612b26565b612b098484846001612a0a565b92509050818404811115612b2057612b1f6129d1565b5b81810290505b9392505050565b5f612b378261257b565b9150612b4283612697565b9250612b6f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484612a5c565b905092915050565b5f612b818261257b565b9150612b8c8361257b565b9250828202612b9a8161257b565b91508282048414831517612bb157612bb06129d1565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f74726164696e6720697320616c7265616479206f70656e0000000000000000005f82015250565b5f612c19601783612470565b9150612c2482612be5565b602082019050919050565b5f6020820190508181035f830152612c4681612c0d565b9050919050565b5f81519050612c5b81612551565b92915050565b5f60208284031215612c7657612c75612519565b5b5f612c8384828501612c4d565b91505092915050565b5f604082019050612c9f5f83018561287d565b612cac602083018461287d565b9392505050565b5f60c082019050612cc65f83018961287d565b612cd3602083018861261f565b612ce060408301876129a9565b612ced60608301866129a9565b612cfa608083018561287d565b612d0760a083018461261f565b979650505050505050565b5f81519050612d2081612584565b92915050565b5f805f60608486031215612d3d57612d3c612519565b5b5f612d4a86828701612d12565b9350506020612d5b86828701612d12565b9250506040612d6c86828701612d12565b9150509250925092565b5f604082019050612d895f83018561287d565b612d96602083018461261f565b9392505050565b612da6816125ec565b8114612db0575f80fd5b50565b5f81519050612dc181612d9d565b92915050565b5f60208284031215612ddc57612ddb612519565b5b5f612de984828501612db3565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f612e4c602483612470565b9150612e5782612df2565b604082019050919050565b5f6020820190508181035f830152612e7981612e40565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f612eda602283612470565b9150612ee582612e80565b604082019050919050565b5f6020820190508181035f830152612f0781612ece565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f612f68602583612470565b9150612f7382612f0e565b604082019050919050565b5f6020820190508181035f830152612f9581612f5c565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f612ff6602383612470565b915061300182612f9c565b604082019050919050565b5f6020820190508181035f83015261302381612fea565b9050919050565b7f5472616e7366657220616d6f756e74206d7573742062652067726561746572205f8201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b5f613084602983612470565b915061308f8261302a565b604082019050919050565b5f6020820190508181035f8301526130b181613078565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e000000000000005f82015250565b5f6130ec601983612470565b91506130f7826130b8565b602082019050919050565b5f6020820190508181035f830152613119816130e0565b9050919050565b5f61312a8261257b565b91506131358361257b565b925082820190508082111561314d5761314c6129d1565b5b92915050565b7f4578636565647320746865206d617857616c6c657453697a652e0000000000005f82015250565b5f613187601a83612470565b915061319282613153565b602082019050919050565b5f6020820190508181035f8301526131b48161317b565b9050919050565b5f6131c58261257b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036131f7576131f66129d1565b5b600182019050919050565b7f4f6e6c7920332073656c6c732070657220626c6f636b210000000000000000005f82015250565b5f613236601783612470565b915061324182613202565b602082019050919050565b5f6020820190508181035f8301526132638161322a565b9050919050565b5f6132748261257b565b915061327f8361257b565b9250828203905081811115613297576132966129d1565b5b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b6132cf81612540565b82525050565b5f6132e083836132c6565b60208301905092915050565b5f602082019050919050565b5f6133028261329d565b61330c81856132a7565b9350613317836132b7565b805f5b8381101561334757815161332e88826132d5565b9750613339836132ec565b92505060018101905061331a565b5085935050505092915050565b5f60a0820190506133675f83018861261f565b61337460208301876129a9565b818103604083015261338681866132f8565b9050613395606083018561287d565b6133a2608083018461261f565b9695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6133e38261257b565b91506133ee8361257b565b9250826133fe576133fd6133ac565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f5f8201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b5f613463602183612470565b915061346e82613409565b604082019050919050565b5f6020820190508181035f83015261349081613457565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f7700000000005f82015250565b5f6134cb601b83612470565b91506134d682613497565b602082019050919050565b5f6020820190508181035f8301526134f8816134bf565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201a58c3d9b12196ac4502d356f64667d3dbc90138f61e5c2eabc810eaabe1327264736f6c63430008170033
// SPDX-License-Identifier: UNLICENSE /* //Return of the Quack, The most famous comic book from Matt Furie (made in 2010). //Tg : https://t.me/Quackcoineth //Website : https://Quackcoin.vip */ pragma solidity 0.8.23; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, 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 sender, address recipient, 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); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; 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); } contract QUACK is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; address payable private _taxWallet; uint256 private _initialBuyTax=25; uint256 private _initialSellTax=27; uint256 private _finalBuyTax=0; uint256 private _finalSellTax=0; uint256 private _reduceBuyTaxAt=23; uint256 private _reduceSellTaxAt=25; uint256 private _preventSwapBefore=26; uint256 private _transferTax=70; uint256 private _buyCount=0; uint8 private constant _decimals = 9; uint256 private constant _tTotal = 420690000000000 * 10**_decimals; string private constant _name = unicode"Quack"; string private constant _symbol = unicode"QUACK"; uint256 public _maxTxAmount = 6206900000000 * 10**_decimals; uint256 public _maxWalletSize = 6206900000000 * 10**_decimals; uint256 public _taxSwapThreshold= 4206900000000 * 10**_decimals; uint256 public _maxTaxSwap= 4206900000000 * 10**_decimals; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private sellCount = 0; uint256 private lastSellBlock = 0; event MaxTxAmountUpdated(uint _maxTxAmount); event TransferTaxUpdated(uint _tax); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _balances[_msgSender()] = _tTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _approve(address owner, address spender, uint256 amount) private { 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 _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); uint256 taxAmount=0; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if(_buyCount==0){ taxAmount = amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100); } if(_buyCount>0){ taxAmount = amount.mul(_transferTax).div(100); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] ) { require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); taxAmount = amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100); _buyCount++; } if(to == uniswapV2Pair && from!= address(this) ){ taxAmount = amount.mul((_buyCount>_reduceSellTaxAt)?_finalSellTax:_initialSellTax).div(100); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && to == uniswapV2Pair && swapEnabled && contractTokenBalance > _taxSwapThreshold && _buyCount > _preventSwapBefore) { if (block.number > lastSellBlock) { sellCount = 0; } require(sellCount < 3, "Only 3 sells per block!"); swapTokensForEth(min(amount, min(contractTokenBalance, _maxTaxSwap))); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } sellCount++; lastSellBlock = block.number; } } if(taxAmount>0){ _balances[address(this)]=_balances[address(this)].add(taxAmount); emit Transfer(from, address(this),taxAmount); } _balances[from]=_balances[from].sub(amount); _balances[to]=_balances[to].add(amount.sub(taxAmount)); emit Transfer(from, to, amount.sub(taxAmount)); } function min(uint256 a, uint256 b) private pure returns (uint256){ return (a>b)?b:a; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize=_tTotal; emit MaxTxAmountUpdated(_tTotal); } function removeTransferTax() external onlyOwner{ _transferTax = 0; emit TransferTaxUpdated(0); } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function addBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBots(address[] memory notbot) public onlyOwner { for (uint i = 0; i < notbot.length; i++) { bots[notbot[i]] = false; } } function isBot(address a) public view returns (bool){ return bots[a]; } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); swapEnabled = true; tradingOpen = true; } function reduceFee(uint256 _newFee) external{ require(_msgSender()==_taxWallet); require(_newFee<=_finalBuyTax && _newFee<=_finalSellTax); _finalBuyTax=_newFee; _finalSellTax=_newFee; } receive() external payable {} function manualSwap() external { require(_msgSender()==_taxWallet); uint256 tokenBalance=balanceOf(address(this)); if(tokenBalance>0){ swapTokensForEth(tokenBalance); } uint256 ethBalance=address(this).balance; if(ethBalance>0){ sendETHToFee(ethBalance); } } }
1
20,291,114
ffa062bb390bfef6bf70b1485fd16527deeeb72c43a370b245af2ec5873973b2
96f7db88d414d3a22f104437a37d20710ee99c419539cb13ab1dc6356ac7e7e3
473300df21d047806a082244b417f96b32f13a33
e5965ab5962edc7477c8520243a95517cd252fa9
4ca2ddee3d0b3e59e77b089baa656574360e5db0
6100d83d81600a3d39f336602c57343d527f9e4ac34f21c619cefc926c8bd93b54bf5a39c7ab2127a895af1cc0691d7e3dff593da1005b363d3d373d3d3d3d610076806062363936013d73f691f8a6d908b58c534b624cf16495b491e633ba5af43d3d93803e606057fd5bf3473300df21d047806a082244b417f96b32f13a335990265c6d4f5826581d3acfd481e2cc50fc6539139228698265fbdd74426f96656f1f18c3b13c3516bb7076bc41bd9dbe507d6c4ca9d95291b386ac624ea02b00000000000000000000000000000000000000000000000000000000074eb1570076
36602c57343d527f9e4ac34f21c619cefc926c8bd93b54bf5a39c7ab2127a895af1cc0691d7e3dff593da1005b363d3d373d3d3d3d610076806062363936013d73f691f8a6d908b58c534b624cf16495b491e633ba5af43d3d93803e606057fd5bf3473300df21d047806a082244b417f96b32f13a335990265c6d4f5826581d3acfd481e2cc50fc6539139228698265fbdd74426f96656f1f18c3b13c3516bb7076bc41bd9dbe507d6c4ca9d95291b386ac624ea02b00000000000000000000000000000000000000000000000000000000074eb1570076
1
20,291,114
ffa062bb390bfef6bf70b1485fd16527deeeb72c43a370b245af2ec5873973b2
c8dd48e97ac6b46c3618698c4c7ba9689737dc363a1d55dd459c0324e117b60b
84ba51a3b082066482385c2e77c15b36b2888888
fc27cd13b432805f47c90a16646d402566bd3143
c92ffb06fe15c6b4901c7c3cec65f7a4ab29ce75
60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a
608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033
1
20,291,114
ffa062bb390bfef6bf70b1485fd16527deeeb72c43a370b245af2ec5873973b2
c8dd48e97ac6b46c3618698c4c7ba9689737dc363a1d55dd459c0324e117b60b
84ba51a3b082066482385c2e77c15b36b2888888
fc27cd13b432805f47c90a16646d402566bd3143
e8f8c332ccf456c7f5ac848b2371aaf77d1b36f2
60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a
608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033
1
20,291,114
ffa062bb390bfef6bf70b1485fd16527deeeb72c43a370b245af2ec5873973b2
c8dd48e97ac6b46c3618698c4c7ba9689737dc363a1d55dd459c0324e117b60b
84ba51a3b082066482385c2e77c15b36b2888888
fc27cd13b432805f47c90a16646d402566bd3143
961dedd13e24694f858f24748b7d52d3dd144790
60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a
608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033
1
20,291,114
ffa062bb390bfef6bf70b1485fd16527deeeb72c43a370b245af2ec5873973b2
c8dd48e97ac6b46c3618698c4c7ba9689737dc363a1d55dd459c0324e117b60b
84ba51a3b082066482385c2e77c15b36b2888888
fc27cd13b432805f47c90a16646d402566bd3143
d04673ab6971f4887e755181ed770828086d9344
60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a
608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033
1
20,291,114
ffa062bb390bfef6bf70b1485fd16527deeeb72c43a370b245af2ec5873973b2
c8dd48e97ac6b46c3618698c4c7ba9689737dc363a1d55dd459c0324e117b60b
84ba51a3b082066482385c2e77c15b36b2888888
fc27cd13b432805f47c90a16646d402566bd3143
5a45a923a2e67eb20c5b038571a9db4677e97c5d
60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a
608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033
1
20,291,114
ffa062bb390bfef6bf70b1485fd16527deeeb72c43a370b245af2ec5873973b2
c8dd48e97ac6b46c3618698c4c7ba9689737dc363a1d55dd459c0324e117b60b
84ba51a3b082066482385c2e77c15b36b2888888
fc27cd13b432805f47c90a16646d402566bd3143
0c72bdc670f18640ef2e7309eff621025d262e6c
60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a
608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033
1
20,291,114
ffa062bb390bfef6bf70b1485fd16527deeeb72c43a370b245af2ec5873973b2
c8dd48e97ac6b46c3618698c4c7ba9689737dc363a1d55dd459c0324e117b60b
84ba51a3b082066482385c2e77c15b36b2888888
fc27cd13b432805f47c90a16646d402566bd3143
40e59d9c04f8959750bbdc4ff5217dab4ba5e15d
60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a
608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033
1
20,291,114
ffa062bb390bfef6bf70b1485fd16527deeeb72c43a370b245af2ec5873973b2
c8dd48e97ac6b46c3618698c4c7ba9689737dc363a1d55dd459c0324e117b60b
84ba51a3b082066482385c2e77c15b36b2888888
fc27cd13b432805f47c90a16646d402566bd3143
155651f9181af558d47fdafeb107c188be1dde56
60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a
608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033
1
20,291,116
f3e98b8c543ac8a697bb8e513e2d41108a4e7b9d86c8c0335b782e220534ae4d
ed1cefef63534c656e26d863b7233e7c4762b35c1f8056312506e1d8a54c466f
0000db5c8b030ae20308ac975898e09741e70000
ed0e416e0feea5b484ba5c95d375545ac2b60572
924d3064daebda2ab3e92891c24a879b55709800
608060405234801561001057600080fd5b50604051610a1a380380610a1a8339818101604052810190610032919061011c565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550326000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610149565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100e9826100be565b9050919050565b6100f9816100de565b811461010457600080fd5b50565b600081519050610116816100f0565b92915050565b600060208284031215610132576101316100b9565b5b600061014084828501610107565b91505092915050565b6108c2806101586000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063caa5c23f1461003b578063cce3d5d314610057575b600080fd5b610055600480360381019061005091906105fa565b610073565b005b610071600480360381019061006c9190610679565b6101ca565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f890610703565b60405180910390fd5b60005b81518110156101c6578181815181106101205761011f610723565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1682828151811061015557610154610723565b5b60200260200101516020015160405161016e91906107c3565b6000604051808303816000865af19150503d80600081146101ab576040519150601f19603f3d011682016040523d82523d6000602084013e6101b0565b606091505b50505080806101be90610809565b915050610104565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024f90610703565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160405161029e90610877565b60006040518083038185875af1925050503d80600081146102db576040519150601f19603f3d011682016040523d82523d6000602084013e6102e0565b606091505b50505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610348826102ff565b810181811067ffffffffffffffff8211171561036757610366610310565b5b80604052505050565b600061037a6102e6565b9050610386828261033f565b919050565b600067ffffffffffffffff8211156103a6576103a5610310565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f1826103c6565b9050919050565b610401816103e6565b811461040c57600080fd5b50565b60008135905061041e816103f8565b92915050565b600080fd5b600067ffffffffffffffff82111561044457610443610310565b5b61044d826102ff565b9050602081019050919050565b82818337600083830152505050565b600061047c61047784610429565b610370565b90508281526020810184848401111561049857610497610424565b5b6104a384828561045a565b509392505050565b600082601f8301126104c0576104bf6102fa565b5b81356104d0848260208601610469565b91505092915050565b6000604082840312156104ef576104ee6103bc565b5b6104f96040610370565b905060006105098482850161040f565b600083015250602082013567ffffffffffffffff81111561052d5761052c6103c1565b5b610539848285016104ab565b60208301525092915050565b60006105586105538461038b565b610370565b9050808382526020820190506020840283018581111561057b5761057a6103b7565b5b835b818110156105c257803567ffffffffffffffff8111156105a05761059f6102fa565b5b8086016105ad89826104d9565b8552602085019450505060208101905061057d565b5050509392505050565b600082601f8301126105e1576105e06102fa565b5b81356105f1848260208601610545565b91505092915050565b6000602082840312156106105761060f6102f0565b5b600082013567ffffffffffffffff81111561062e5761062d6102f5565b5b61063a848285016105cc565b91505092915050565b6000819050919050565b61065681610643565b811461066157600080fd5b50565b6000813590506106738161064d565b92915050565b60006020828403121561068f5761068e6102f0565b5b600061069d84828501610664565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000600082015250565b60006106ed6017836106a6565b91506106f8826106b7565b602082019050919050565b6000602082019050818103600083015261071c816106e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561078657808201518184015260208101905061076b565b60008484015250505050565b600061079d82610752565b6107a7818561075d565b93506107b7818560208601610768565b80840191505092915050565b60006107cf8284610792565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061081482610643565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610846576108456107da565b5b600182019050919050565b50565b600061086160008361075d565b915061086c82610851565b600082019050919050565b600061088282610854565b915081905091905056fea264697066735822122036692b46567a60a4f6844f8be0961cccba9ff2777bd37b4ea35791aba4c5159b64736f6c63430008120033000000000000000000000000000037bb05b2cef17c6469f4bcdb198826ce0000
608060405234801561001057600080fd5b50600436106100365760003560e01c8063caa5c23f1461003b578063cce3d5d314610057575b600080fd5b610055600480360381019061005091906105fa565b610073565b005b610071600480360381019061006c9190610679565b6101ca565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f890610703565b60405180910390fd5b60005b81518110156101c6578181815181106101205761011f610723565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1682828151811061015557610154610723565b5b60200260200101516020015160405161016e91906107c3565b6000604051808303816000865af19150503d80600081146101ab576040519150601f19603f3d011682016040523d82523d6000602084013e6101b0565b606091505b50505080806101be90610809565b915050610104565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024f90610703565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160405161029e90610877565b60006040518083038185875af1925050503d80600081146102db576040519150601f19603f3d011682016040523d82523d6000602084013e6102e0565b606091505b50505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610348826102ff565b810181811067ffffffffffffffff8211171561036757610366610310565b5b80604052505050565b600061037a6102e6565b9050610386828261033f565b919050565b600067ffffffffffffffff8211156103a6576103a5610310565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f1826103c6565b9050919050565b610401816103e6565b811461040c57600080fd5b50565b60008135905061041e816103f8565b92915050565b600080fd5b600067ffffffffffffffff82111561044457610443610310565b5b61044d826102ff565b9050602081019050919050565b82818337600083830152505050565b600061047c61047784610429565b610370565b90508281526020810184848401111561049857610497610424565b5b6104a384828561045a565b509392505050565b600082601f8301126104c0576104bf6102fa565b5b81356104d0848260208601610469565b91505092915050565b6000604082840312156104ef576104ee6103bc565b5b6104f96040610370565b905060006105098482850161040f565b600083015250602082013567ffffffffffffffff81111561052d5761052c6103c1565b5b610539848285016104ab565b60208301525092915050565b60006105586105538461038b565b610370565b9050808382526020820190506020840283018581111561057b5761057a6103b7565b5b835b818110156105c257803567ffffffffffffffff8111156105a05761059f6102fa565b5b8086016105ad89826104d9565b8552602085019450505060208101905061057d565b5050509392505050565b600082601f8301126105e1576105e06102fa565b5b81356105f1848260208601610545565b91505092915050565b6000602082840312156106105761060f6102f0565b5b600082013567ffffffffffffffff81111561062e5761062d6102f5565b5b61063a848285016105cc565b91505092915050565b6000819050919050565b61065681610643565b811461066157600080fd5b50565b6000813590506106738161064d565b92915050565b60006020828403121561068f5761068e6102f0565b5b600061069d84828501610664565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000600082015250565b60006106ed6017836106a6565b91506106f8826106b7565b602082019050919050565b6000602082019050818103600083015261071c816106e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561078657808201518184015260208101905061076b565b60008484015250505050565b600061079d82610752565b6107a7818561075d565b93506107b7818560208601610768565b80840191505092915050565b60006107cf8284610792565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061081482610643565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610846576108456107da565b5b600182019050919050565b50565b600061086160008361075d565b915061086c82610851565b600082019050919050565b600061088282610854565b915081905091905056fea264697066735822122036692b46567a60a4f6844f8be0961cccba9ff2777bd37b4ea35791aba4c5159b64736f6c63430008120033
1
20,291,116
f3e98b8c543ac8a697bb8e513e2d41108a4e7b9d86c8c0335b782e220534ae4d
87961c4d368c52b9177d038168eb7f537f3ece4ea66ffff4ca6b67b7922548aa
e90e278116574589fe37634739db2fbfcba4b2a2
0db20f3b52bfdb93ba14a9bc06ab523d2afd8ef6
aab2b3faafbd71725542336aae92e89d22deab6e
60a060405260118054600160a01b600160e01b031916613d0960a51b179055348015610029575f80fd5b506040516144e53803806144e583398101604081905261004891610445565b825f8151811061005a5761005a6105a8565b602002602001015183600181518110610075576100756105a8565b6020026020010151825f8151811061008f5761008f6105a8565b6020908102919091010151730a0f4321214bb6c7811dd8a71cf587bdaf03f0a06080526001600160a01b0381166100df57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100e8816102b7565b5060016100f58382610640565b5060026101028282610640565b505050815f81518110610117576101176105a8565b6020026020010151600781905550805f81518110610137576101376105a8565b602002602001015160105f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600181518110610177576101776105a8565b602002602001015160115f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550826002815181106101b7576101b76105a8565b6020026020010151600c90816101cd9190610640565b50826003815181106101e1576101e16105a8565b6020026020010151600d90816101f79190610640565b508260048151811061020b5761020b6105a8565b6020026020010151600e90816102219190610640565b5081600181518110610235576102356105a8565b6020026020010151600b8190555081600281518110610256576102566105a8565b602002602001015160098190555081600381518110610277576102776105a8565b6020026020010151600a8190555082600581518110610298576102986105a8565b6020026020010151600f90816102ae9190610640565b505050506106fa565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171561034257610342610306565b604052919050565b5f6001600160401b0382111561036257610362610306565b5060051b60200190565b5f82601f83011261037b575f80fd5b815161038e6103898261034a565b61031a565b8082825260208201915060208360051b8601019250858311156103af575f80fd5b602085015b838110156103cc5780518352602092830192016103b4565b5095945050505050565b5f82601f8301126103e5575f80fd5b81516103f36103898261034a565b8082825260208201915060208360051b860101925085831115610414575f80fd5b602085015b838110156103cc5780516001600160a01b0381168114610437575f80fd5b835260209283019201610419565b5f805f60608486031215610457575f80fd5b83516001600160401b0381111561046c575f80fd5b8401601f8101861361047c575f80fd5b805161048a6103898261034a565b8082825260208201915060208360051b8501019250888311156104ab575f80fd5b602084015b838110156105495780516001600160401b038111156104cd575f80fd5b8501603f81018b136104dd575f80fd5b60208101516001600160401b038111156104f9576104f9610306565b61050c601f8201601f191660200161031a565b8181526040838301018d1015610520575f80fd5b8160408401602083015e5f602083830101528086525050506020830192506020810190506104b0565b506020880151909650925050506001600160401b03811115610569575f80fd5b6105758682870161036c565b604086015190935090506001600160401b03811115610592575f80fd5b61059e868287016103d6565b9150509250925092565b634e487b7160e01b5f52603260045260245ffd5b600181811c908216806105d057607f821691505b6020821081036105ee57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561063b57805f5260205f20601f840160051c810160208510156106195750805b601f840160051c820191505b81811015610638575f8155600101610625565b50505b505050565b81516001600160401b0381111561065957610659610306565b61066d8161066784546105bc565b846105f4565b6020601f82116001811461069f575f83156106885750848201515b5f19600385901b1c1916600184901b178455610638565b5f84815260208120601f198516915b828110156106ce57878501518255602094850194600190920191016106ae565b50848210156106eb57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b608051613db06107355f395f81816104ed01528181610cdd01528181611a7401528181611ab101528181611c5801526121f70152613db05ff3fe60806040526004361061035b575f3560e01c806370a08231116101bd578063b0347814116100f2578063de8f50a111610092578063ebd7edaf1161006d578063ebd7edaf146109a5578063ec3e5f45146109b9578063eda47704146109f7578063f2fde38b14610a16575f80fd5b8063de8f50a114610948578063e0be9bf914610967578063e985e9c514610986575f80fd5b8063b88d4fde116100cd578063b88d4fde146108e2578063c1d88c4414610901578063c745e3ff14610915578063c87b56dd14610929575f80fd5b8063b03478141461089a578063b0f7a3ff146108b9578063b7b6ccd5146108ce575f80fd5b80638da5cb5b1161015d578063a1a0e7fc11610138578063a1a0e7fc14610812578063a22cb46514610831578063ad72e1a514610850578063aea305071461087b575f80fd5b80638da5cb5b146107cf57806395d89b41146107eb5780639ee74dd1146107ff575f80fd5b80637df04787116101985780637df047871461073557806381d12c581461076c5780638500a45d1461079b5780638cbc52d9146107b0575f80fd5b806370a08231146106e3578063715018a61461070257806378564b7414610716575f80fd5b80633ccfd60b1161029357806358fd416d11610233578063628ae0a31161020e578063628ae0a3146106875780636352211e1461069b5780636817c76c146106ba578063702de1e3146106cf575f80fd5b806358fd416d146106235780635bb4688d146106425780635cec1b7614610672575f80fd5b8063414f11451161026e578063414f11451461059f57806342842e0e146105be5780634c34e4dc146105dd5780634ca0ce4c146105fc575f80fd5b80633ccfd60b1461054d5780633f37dce2146105615780633f3e4c1114610580575f80fd5b80632ab4d052116102fe5780632f03012e116102d95780632f03012e146104b557806331b221cd146104dc57806333727c4d1461050f5780633c1c8e491461052e575f80fd5b80632ab4d052146104625780632cfb2080146104775780632ddfb80714610496575f80fd5b8063095ea7b311610339578063095ea7b3146103eb578063122d1bad1461040c57806318160ddd1461042057806323b872dd14610443575f80fd5b806301ffc9a71461035f57806306fdde0314610393578063081812fc146103b4575b5f80fd5b34801561036a575f80fd5b5061037e610379366004612b52565b610a35565b60405190151581526020015b60405180910390f35b34801561039e575f80fd5b506103a7610a86565b60405161038a9190612ba2565b3480156103bf575f80fd5b506103d36103ce366004612bb4565b610b16565b6040516001600160a01b03909116815260200161038a565b3480156103f6575f80fd5b5061040a610405366004612be1565b610b3d565b005b348015610417575f80fd5b506103a7610b4c565b34801561042b575f80fd5b5061043560085481565b60405190815260200161038a565b34801561044e575f80fd5b5061040a61045d366004612c09565b610bd8565b34801561046d575f80fd5b50610435600b5481565b348015610482575f80fd5b5061040a610491366004612c43565b610c66565b3480156104a1575f80fd5b5061040a6104b0366004612c69565b610c9b565b3480156104c0575f80fd5b506103d373c3287bdef03b925a7c7f54791edadcd88e632ccd81565b3480156104e7575f80fd5b506103d37f000000000000000000000000000000000000000000000000000000000000000081565b34801561051a575f80fd5b5061037e610529366004612bb4565b610cc5565b348015610539575f80fd5b506103a7610548366004612d40565b610d4e565b348015610558575f80fd5b5061040a610d7c565b34801561056c575f80fd5b5061040a61057b366004612dc5565b610d90565b34801561058b575f80fd5b5061040a61059a366004612bb4565b610e6c565b3480156105aa575f80fd5b5061040a6105b9366004612e2f565b610e79565b3480156105c9575f80fd5b5061040a6105d8366004612c09565b610e93565b3480156105e8575f80fd5b506011546103d3906001600160a01b031681565b348015610607575f80fd5b506103d3730a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b34801561062e575f80fd5b506103a761063d366004612bb4565b610ead565b34801561064d575f80fd5b5061066161065c366004612bb4565b6110ef565b60405161038a959493929190612e6d565b34801561067d575f80fd5b50610435600a5481565b348015610692575f80fd5b506103a76112b8565b3480156106a6575f80fd5b506103d36106b5366004612bb4565b6112c5565b3480156106c5575f80fd5b5061043560075481565b3480156106da575f80fd5b506104356112cf565b3480156106ee575f80fd5b506104356106fd366004612c69565b6112ea565b34801561070d575f80fd5b5061040a61132f565b348015610721575f80fd5b5061040a610730366004612e2f565b611340565b348015610740575f80fd5b5061043561074f366004612ec8565b805160208183018101805160148252928201919093012091525481565b348015610777575f80fd5b5061078b610786366004612bb4565b611355565b60405161038a9493929190612ef9565b3480156107a6575f80fd5b5061043560095481565b3480156107bb575f80fd5b506103a76107ca366004612f3c565b611493565b3480156107da575f80fd5b505f546001600160a01b03166103d3565b3480156107f6575f80fd5b506103a76114c7565b61043561080d366004612f7f565b6114d6565b34801561081d575f80fd5b5061040a61082c366004612e2f565b6118fa565b34801561083c575f80fd5b5061040a61084b36600461303f565b61190f565b34801561085b575f80fd5b5061043561086a366004612bb4565b60166020525f908152604090205481565b348015610886575f80fd5b5061040a610895366004613074565b61191a565b3480156108a5575f80fd5b5061040a6108b4366004613119565b611a69565b3480156108c4575f80fd5b50610435611b5f81565b3480156108d9575f80fd5b5061040a611bef565b3480156108ed575f80fd5b5061040a6108fc366004613190565b611c10565b34801561090c575f80fd5b50610435611c27565b348015610920575f80fd5b506103a7611cc8565b348015610934575f80fd5b506103a7610943366004612bb4565b611cd5565b348015610953575f80fd5b5061037e6109623660046131f3565b611d84565b348015610972575f80fd5b506010546103d3906001600160a01b031681565b348015610991575f80fd5b5061037e6109a036600461328f565b611ee9565b3480156109b0575f80fd5b506103a7611f16565b3480156109c4575f80fd5b506011546109df90600160a01b90046001600160401b031681565b6040516001600160401b03909116815260200161038a565b348015610a02575f80fd5b5061040a610a11366004612c69565b611f23565b348015610a21575f80fd5b5061040a610a30366004612c69565b611f4d565b5f6001600160e01b031982166380ac58cd60e01b1480610a6557506001600160e01b03198216635b5e139f60e01b145b80610a8057506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060018054610a95906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac1906132c0565b8015610b0c5780601f10610ae357610100808354040283529160200191610b0c565b820191905f5260205f20905b815481529060010190602001808311610aef57829003601f168201915b5050505050905090565b5f610b2082611f8a565b505f828152600560205260409020546001600160a01b0316610a80565b610b48828233611fc2565b5050565b600f8054610b59906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054610b85906132c0565b8015610bd05780601f10610ba757610100808354040283529160200191610bd0565b820191905f5260205f20905b815481529060010190602001808311610bb357829003601f168201915b505050505081565b6001600160a01b038216610c0657604051633250574960e11b81525f60048201526024015b60405180910390fd5b5f610c12838333611fcf565b9050836001600160a01b0316816001600160a01b031614610c60576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610bfd565b50505050565b610c6e6120c1565b601180546001600160401b03909216600160a01b0267ffffffffffffffff60a01b19909216919091179055565b610ca36120c1565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516333727c4d60e01b8152600481018290525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906333727c4d90602401602060405180830381865afa158015610d2a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a8091906132f8565b60605f8284604051602001610d6492919061332a565b60408051808303601f19018152919052949350505050565b610d846120c1565b610d8e33476120ed565b565b610d9e848484848888611d84565b610dea5760405162461bcd60e51b815260206004820152601960248201527f455243373030373a20696e76616c6964206169676344617461000000000000006044820152606401610bfd565b5f60148585604051610dfd92919061333b565b908152604051908190036020018120549150610e1c908490849061333b565b60405180910390208585604051610e3492919061333b565b6040519081900381209083907fd77aab0eeab3a3cbdac072fcdbc34709b18d6c4af91f7869c71cbbb13d71a6b9905f90a45050505050565b610e746120c1565b600b55565b610e816120c1565b600e610e8e82848361338e565b505050565b610e8e83838360405180602001604052805f815250611c10565b5f8181526012602052604081206003015460609103610fc2575f8281526012602090815260409182902091517f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e392610f0c9290916001830191016134b5565b60408051601f1981840301815290829052610f26916134df565b90815260200160405180910390208054610f3f906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6b906132c0565b8015610fb65780601f10610f8d57610100808354040283529160200191610fb6565b820191905f5260205f20905b815481529060010190602001808311610f9957829003601f168201915b50505050509050919050565b5f828152601260209081526040808320600381015491519192610fea926001830191016134b5565b60408051601f1981840301815290829052611008929160200161332a565b60408051601f1981840301815290829052611b5f5f52601560205291507f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e3906110529083906134df565b9081526020016040518091039020805461106b906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054611097906132c0565b80156110e25780601f106110b9576101008083540402835291602001916110e2565b820191905f5260205f20905b8154815290600101906020018083116110c557829003601f168201915b5050505050915050919050565b60126020525f9081526040902080548190611109906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054611135906132c0565b80156111805780601f1061115757610100808354040283529160200191611180565b820191905f5260205f20905b81548152906001019060200180831161116357829003601f168201915b505050505090806001018054611195906132c0565b80601f01602080910402602001604051908101604052809291908181526020018280546111c1906132c0565b801561120c5780601f106111e35761010080835404028352916020019161120c565b820191905f5260205f20905b8154815290600101906020018083116111ef57829003601f168201915b505050505090806002018054611221906132c0565b80601f016020809104026020016040519081016040528092919081815260200182805461124d906132c0565b80156112985780601f1061126f57610100808354040283529160200191611298565b820191905f5260205f20905b81548152906001019060200180831161127b57829003601f168201915b5050505060038301546004909301549192916001600160a01b0316905085565b600c8054610b59906132c0565b5f610a8082611f8a565b5f6007546112db611c27565b6112e591906134fe565b905090565b5f6001600160a01b038216611314576040516322718ad960e21b81525f6004820152602401610bfd565b506001600160a01b03165f9081526004602052604090205490565b6113376120c1565b610d8e5f612180565b6113486120c1565b600c610e8e82848361338e565b60136020525f90815260409020805460018201546002830180546001600160a01b03909316939192611386906132c0565b80601f01602080910402602001604051908101604052809291908181526020018280546113b2906132c0565b80156113fd5780601f106113d4576101008083540402835291602001916113fd565b820191905f5260205f20905b8154815290600101906020018083116113e057829003601f168201915b505050505090806003018054611412906132c0565b80601f016020809104026020016040519081016040528092919081815260200182805461143e906132c0565b80156114895780601f1061146057610100808354040283529160200191611489565b820191905f5260205f20905b81548152906001019060200180831161146c57829003601f168201915b5050505050905084565b601560209081525f9283526040909220815180830184018051928152908401929093019190912091528054610b59906132c0565b606060028054610a95906132c0565b5f6009545f141580156114ea575060095442115b6115295760405162461bcd60e51b815260206004820152601060248201526f14d85b19481b9bdd081cdd185c9d195960821b6044820152606401610bfd565b600a5415806115395750600a5442105b6115725760405162461bcd60e51b815260206004820152600a60248201526914d85b1948195b99195960b21b6044820152606401610bfd565b5f8888888860405160200161158a9493929190613511565b604051602081830303815290604052905060146115a78285610d4e565b6040516115b491906134df565b9081526020016040518091039020545f1461161c5760405162461bcd60e51b815260206004820152602260248201527f70726f6d707420616e6420736565642068617320616c7265616479206d696e74604482015261195960f21b6064820152608401610bfd565b6116246112cf565b3410156116735760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f7567682066756e6420746f206d696e74204e465400000000006044820152606401610bfd565b600b5415806116855750600b54600854105b6116d15760405162461bcd60e51b815260206004820152601860248201527f4d617820746f74616c20737570706c79207265616368656400000000000000006044820152606401610bfd565b6011546001600160a01b03161561170757601154600754611707916001600160a01b03169061170290600a90613550565b6120ed565b6010546001600160a01b03161561174457601054600754611744916001600160a01b031690600a9061173a906009613563565b6117029190613550565b6040518060a001604052808a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250505090825250604080516020601f8b0181900481028201810190925289815291810191908a908a90819084018382808284375f92019190915250505090825250604080516020601f8901819004810282018101909252878152918101919088908890819084018382808284375f92018290525093855250505060208083018790526001600160a01b038e16604093840152600854825260129052208151819061182a908261357a565b506020820151600182019061183f908261357a565b5060408201516002820190611854908261357a565b5060608201516003820155608090910151600490910180546001600160a01b0319166001600160a01b0390921691909117905561189181846121cf565b61189d8a600854612347565b60088054905f6118ac83613634565b919050555060085460146118c08386610d4e565b6040516118cd91906134df565b908152604051908190036020019020556008546118ec9060019061364c565b9a9950505050505050505050565b6119026120c1565b600d610e8e82848361338e565b610b48338383612360565b60405163c4be5cab60e01b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9063c4be5cab906119539089908990600401613687565b6020604051808303815f875af115801561196f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611993919061369a565b5f888152601660205260409081902082905551630901e0f960e31b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9163480f07c8916119dd9190889088906004016136b1565b5f604051808303815f87803b1580156119f4575f80fd5b505af1158015611a06573d5f803e3d5ffd5b505050508585604051611a1a92919061333b565b6040518091039020877f65deac95b53ba76b9cdc6cf446af81731e1218c91eaf9811a95d28bde23b893e86868686604051611a5894939291906136ca565b60405180910390a350505050505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168114611ae65760405163432e033760e11b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015282166024820152604401610bfd565b5f86815260136020526040902080546001600160a01b0316611b3f5760405162461bcd60e51b815260206004820152601260248201527172657175657374206e6f742065786973747360701b6044820152606401610bfd565b611b5f5f526015602052604051869086907f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e390611b809060028601906136f0565b90815260200160405180910390209182611b9b92919061338e565b507faf2b2381ddcb18a2b18a7826186fd216acdd9c852a8c7a9a49e7eab127f96ccf8782600101548360020189898989604051611bde97969594939291906136fb565b60405180910390a150505050505050565b611bf76120c1565b6009545f03611c065742600955565b42600a555f600955565b611c1b848484610bd8565b610c60848484846123fe565b601154604051620e1d8d60e41b8152611b5f6004820152600160a01b9091046001600160401b031660248201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169062e1d8d090604401602060405180830381865afa158015611ca4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112e5919061369a565b600d8054610b59906132c0565b5f818152601260205260408120600381015460609291611d58916002820191906001820190611d0390612524565b5f88815260126020526040902060040154611d26906001600160a01b0316612628565b611d2f89610ead565b604051602001611d44969594939291906137ae565b604051602081830303815290604052612761565b90505f81604051602001611d6c9190613a3e565b60408051601f19818403018152919052949350505050565b5f8060148888604051611d9892919061333b565b9081526040805160209281900383018120545f8181526016909452918320546317861f8760e01b8252600482015290925073c3287bdef03b925a7c7f54791edadcd88e632ccd906317861f87906024015f60405180830381865afa158015611e02573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611e299190810190613a6f565b5f83815260166020526040908190205490516333727c4d60e01b815291925073c3287bdef03b925a7c7f54791edadcd88e632ccd916333727c4d91611e749160040190815260200190565b602060405180830381865afa158015611e8f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611eb391906132f8565b8015611edc57508686604051611eca92919061333b565b60405180910390208180519060200120145b9998505050505050505050565b6001600160a01b039182165f90815260066020908152604080832093909416825291909152205460ff1690565b600e8054610b59906132c0565b611f2b6120c1565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b611f556120c1565b6001600160a01b038116611f7e57604051631e4fbdf760e01b81525f6004820152602401610bfd565b611f8781612180565b50565b5f818152600360205260408120546001600160a01b031680610a8057604051637e27328960e01b815260048101849052602401610bfd565b610e8e83838360016128c3565b5f828152600360205260408120546001600160a01b0390811690831615611ffb57611ffb8184866129c7565b6001600160a01b03811615612035576120165f855f806128c3565b6001600160a01b0381165f90815260046020526040902080545f190190555b6001600160a01b03851615612063576001600160a01b0385165f908152600460205260409020805460010190555b5f8481526003602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b5f546001600160a01b03163314610d8e5760405163118cdaa760e01b8152336004820152602401610bfd565b804710156121105760405163cd78605960e01b8152306004820152602401610bfd565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114612159576040519150601f19603f3d011682016040523d82523d5f602084013e61215e565b606091505b5050905080610e8e57604051630a12f52160e11b815260040160405180910390fd5b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f81836040516020016121e392919061332a565b60405160208183030381529060405290505f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635b953806600754600a6122316112cf565b61223c90600b613563565b6122469190613550565b612250919061364c565b611b5f8530601160149054906101000a90046001600160401b03166040518663ffffffff1660e01b815260040161228a9493929190613ae3565b60206040518083038185885af11580156122a6573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906122cb919061369a565b5f818152601360205260409020909150600281016122e9848261357a565b5080546001600160a01b031916339081178255611b5f600183018190556040517fa0faead83d70148ae18b694377f9bef079251342ab90e14af0f9ef68b891269f926123389286928a90613b33565b60405180910390a15050505050565b610b48828260405180602001604052805f815250612a2b565b6001600160a01b03821661239257604051630b61174360e31b81526001600160a01b0383166004820152602401610bfd565b6001600160a01b038381165f81815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b15610c6057604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290612440903390889087908790600401613b69565b6020604051808303815f875af192505050801561247a575060408051601f3d908101601f1916820190925261247791810190613b9b565b60015b6124e1573d8080156124a7576040519150601f19603f3d011682016040523d82523d5f602084013e6124ac565b606091505b5080515f036124d957604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461251d57604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b5050505050565b6060815f0361254a5750506040805180820190915260018152600360fc1b602082015290565b815f5b8115612573578061255d81613634565b915061256c9050600a83613550565b915061254d565b5f816001600160401b0381111561258c5761258c612c82565b6040519080825280601f01601f1916602001820160405280156125b6576020820181803683370190505b5090505b8415612620576125cb60018361364c565b91506125d8600a86613bb6565b6125e39060306134fe565b60f81b8183815181106125f8576125f8613bc9565b60200101906001600160f81b03191690815f1a905350612619600a86613550565b94506125ba565b949350505050565b60408051602880825260608281019093525f91906020820181803683370190505090505f5b601481101561275a575f61266282601361364c565b61266d906008613563565b612678906002613cc0565b61268b906001600160a01b038716613550565b60f81b90505f60108260f81c6126a19190613ccb565b60f81b90505f8160f81c60106126b79190613cec565b8360f81c6126c59190613d08565b60f81b90506126d382612a41565b856126df866002613563565b815181106126ef576126ef613bc9565b60200101906001600160f81b03191690815f1a90535061270e81612a41565b8561271a866002613563565b6127259060016134fe565b8151811061273557612735613bc9565b60200101906001600160f81b03191690815f1a905350506001909201915061264d9050565b5092915050565b80516060905f81900361278357505060408051602081019091525f8152919050565b5f60036127918360026134fe565b61279b9190613550565b6127a6906004613563565b90505f6127b48260206134fe565b6001600160401b038111156127cb576127cb612c82565b6040519080825280601f01601f1916602001820160405280156127f5576020820181803683370190505b5090505f604051806060016040528060408152602001613d3b60409139905060018101602083015f5b8681101561287f576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b83526004909201910161281e565b50600386066001811461289957600281146128aa576128b5565b613d3d60f01b6001198301526128b5565b603d60f81b5f198301525b505050918152949350505050565b80806128d757506001600160a01b03821615155b15612998575f6128e684611f8a565b90506001600160a01b038316158015906129125750826001600160a01b0316816001600160a01b031614155b801561292557506129238184611ee9565b155b1561294e5760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610bfd565b81156129965783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260056020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6129d2838383612a7b565b610e8e576001600160a01b038316612a0057604051637e27328960e01b815260048101829052602401610bfd565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610bfd565b612a358383612adc565b610e8e5f8484846123fe565b5f600a60f883901c1015612a6757612a5e60f883901c6030613d21565b60f81b92915050565b612a5e60f883901c6057613d21565b919050565b5f6001600160a01b038316158015906126205750826001600160a01b0316846001600160a01b03161480612ab45750612ab48484611ee9565b806126205750505f908152600560205260409020546001600160a01b03908116911614919050565b6001600160a01b038216612b0557604051633250574960e11b81525f6004820152602401610bfd565b5f612b1183835f611fcf565b90506001600160a01b03811615610e8e576040516339e3563760e11b81525f6004820152602401610bfd565b6001600160e01b031981168114611f87575f80fd5b5f60208284031215612b62575f80fd5b8135612b6d81612b3d565b9392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f612b6d6020830184612b74565b5f60208284031215612bc4575f80fd5b5035919050565b80356001600160a01b0381168114612a76575f80fd5b5f8060408385031215612bf2575f80fd5b612bfb83612bcb565b946020939093013593505050565b5f805f60608486031215612c1b575f80fd5b612c2484612bcb565b9250612c3260208501612bcb565b929592945050506040919091013590565b5f60208284031215612c53575f80fd5b81356001600160401b0381168114612b6d575f80fd5b5f60208284031215612c79575f80fd5b612b6d82612bcb565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715612cbe57612cbe612c82565b604052919050565b5f6001600160401b03821115612cde57612cde612c82565b50601f01601f191660200190565b5f82601f830112612cfb575f80fd5b8135602083015f612d13612d0e84612cc6565b612c96565b9050828152858383011115612d26575f80fd5b828260208301375f92810160200192909252509392505050565b5f8060408385031215612d51575f80fd5b82356001600160401b03811115612d66575f80fd5b612d7285828601612cec565b95602094909401359450505050565b5f8083601f840112612d91575f80fd5b5081356001600160401b03811115612da7575f80fd5b602083019150836020828501011115612dbe575f80fd5b9250929050565b5f805f8060408587031215612dd8575f80fd5b84356001600160401b03811115612ded575f80fd5b612df987828801612d81565b90955093505060208501356001600160401b03811115612e17575f80fd5b612e2387828801612d81565b95989497509550505050565b5f8060208385031215612e40575f80fd5b82356001600160401b03811115612e55575f80fd5b612e6185828601612d81565b90969095509350505050565b60a081525f612e7f60a0830188612b74565b8281036020840152612e918188612b74565b90508281036040840152612ea58187612b74565b606084019590955250506001600160a01b03919091166080909101529392505050565b5f60208284031215612ed8575f80fd5b81356001600160401b03811115612eed575f80fd5b61262084828501612cec565b60018060a01b0385168152836020820152608060408201525f612f1f6080830185612b74565b8281036060840152612f318185612b74565b979650505050505050565b5f8060408385031215612f4d575f80fd5b8235915060208301356001600160401b03811115612f69575f80fd5b612f7585828601612cec565b9150509250929050565b5f805f805f805f8060a0898b031215612f96575f80fd5b612f9f89612bcb565b975060208901356001600160401b03811115612fb9575f80fd5b612fc58b828c01612d81565b90985096505060408901356001600160401b03811115612fe3575f80fd5b612fef8b828c01612d81565b90965094505060608901356001600160401b0381111561300d575f80fd5b6130198b828c01612d81565b999c989b50969995989497949560800135949350505050565b8015158114611f87575f80fd5b5f8060408385031215613050575f80fd5b61305983612bcb565b9150602083013561306981613032565b809150509250929050565b5f805f805f805f6080888a03121561308a575f80fd5b8735965060208801356001600160401b038111156130a6575f80fd5b6130b28a828b01612d81565b90975095505060408801356001600160401b038111156130d0575f80fd5b6130dc8a828b01612d81565b90955093505060608801356001600160401b038111156130fa575f80fd5b6131068a828b01612d81565b989b979a50959850939692959293505050565b5f805f805f6060868803121561312d575f80fd5b8535945060208601356001600160401b03811115613149575f80fd5b61315588828901612d81565b90955093505060408601356001600160401b03811115613173575f80fd5b61317f88828901612d81565b969995985093965092949392505050565b5f805f80608085870312156131a3575f80fd5b6131ac85612bcb565b93506131ba60208601612bcb565b92506040850135915060608501356001600160401b038111156131db575f80fd5b6131e787828801612cec565b91505092959194509250565b5f805f805f8060608789031215613208575f80fd5b86356001600160401b0381111561321d575f80fd5b61322989828a01612d81565b90975095505060208701356001600160401b03811115613247575f80fd5b61325389828a01612d81565b90955093505060408701356001600160401b03811115613271575f80fd5b61327d89828a01612d81565b979a9699509497509295939492505050565b5f80604083850312156132a0575f80fd5b6132a983612bcb565b91506132b760208401612bcb565b90509250929050565b600181811c908216806132d457607f821691505b6020821081036132f257634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215613308575f80fd5b8151612b6d81613032565b5f81518060208401855e5f93019283525090919050565b8281525f6126206020830184613313565b818382375f9101908152919050565b601f821115610e8e57805f5260205f20601f840160051c8101602085101561336f5750805b601f840160051c820191505b8181101561251d575f815560010161337b565b6001600160401b038311156133a5576133a5612c82565b6133b9836133b383546132c0565b8361334a565b5f601f8411600181146133ea575f85156133d35750838201355b5f19600387901b1c1916600186901b17835561251d565b5f83815260208120601f198716915b8281101561341957868501358255602094850194600190920191016133f9565b5086821015613435575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f8154613453816132c0565b60018216801561346a576001811461347f576134ac565b60ff19831686528115158202860193506134ac565b845f5260205f205f5b838110156134a457815488820152600190910190602001613488565b505081860193505b50505092915050565b5f6134c08285613447565b622d2d2d60e81b81526134d66003820185613447565b95945050505050565b5f612b6d8284613313565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610a8057610a806134ea565b838582375f848201622d2d2d60e81b8152838560038301375f93016003019283525090949350505050565b634e487b7160e01b5f52601260045260245ffd5b5f8261355e5761355e61353c565b500490565b8082028115828204841417610a8057610a806134ea565b81516001600160401b0381111561359357613593612c82565b6135a7816135a184546132c0565b8461334a565b6020601f8211600181146135d9575f83156135c25750848201515b5f19600385901b1c1916600184901b17845561251d565b5f84815260208120601f198516915b8281101561360857878501518255602094850194600190920191016135e8565b508482101561362557868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f60018201613645576136456134ea565b5060010190565b81810381811115610a8057610a806134ea565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b602081525f61262060208301848661365f565b5f602082840312156136aa575f80fd5b5051919050565b838152604060208201525f6134d660408301848661365f565b604081525f6136dd60408301868861365f565b8281036020840152612f3181858761365f565b5f612b6d8284613447565b87815286602082015260a060408201525f808754613718816132c0565b8060a0860152600182165f8114613736576001811461375257613783565b60ff19831660c087015260c082151560051b8701019350613783565b8a5f5260205f205f5b8381101561377a57815488820160c0015260019091019060200161375b565b870160c0019450505b505050828103606084015261379981878961365f565b905082810360808401526118ec81858761365f565b683d913730b6b2911d1160b91b81525f6137cb6009830189613447565b7f222c202261747472696275746573223a205b7b2274726169745f74797065223a81527f2022706f7369746976655f70726f6d7074222c202276616c7565223a202200006020820152613821603e820189613447565b7f227d2c207b2274726169745f74797065223a20226e656761746976655f70726f81526f36b83a111610113b30b63ab2911d101160811b6020820152905061386c6030820188613447565b7f227d2c207b2274726169745f74797065223a202273656564222c202276616c7581526432911d101160d91b602082015290506138ac6025820187613313565b7f227d2c207b2274726169745f74797065223a2022617574686f72222c202276618152680d8eaca4474404460f60bb1b602082015290506138f06029820186613313565b7f227d2c207b2274726169745f74797065223a20226d6f64656c222c202276616c81527f7565223a2022537461626c6520446966667573696f6e227d5d2c20226465736360208201527f72697074696f6e223a2022537461626c6520446966667573696f6e206973206160408201527f206c6174656e7420746578742d746f2d696d61676520646966667573696f6e2060608201527f6d6f64656c2063617061626c65206f662067656e65726174696e672070686f7460808201527f6f2d7265616c697374696320696d6167657320676976656e20616e792074657860a08201527f7420696e7075742e222c2022696d616765223a202268747470733a2f2f67617460c08201527f657761792e70696e6174612e636c6f75642f697066732f00000000000000000060e0820152905060f781016118ec613a308287613313565b61227d60f01b815260020190565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081525f612b6d601d830184613313565b5f60208284031215613a7f575f80fd5b81516001600160401b03811115613a94575f80fd5b8201601f81018413613aa4575f80fd5b8051613ab2612d0e82612cc6565b818152856020838501011115613ac6575f80fd5b8160208401602083015e5f91810160200191909152949350505050565b84815260a060208201525f613afb60a0830186612b74565b6001600160a01b03949094166040830152506001600160401b039190911660608201528082036080909101525f815260200192915050565b84815260018060a01b0384166020820152826040820152608060608201525f613b5f6080830184612b74565b9695505050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90613b5f90830184612b74565b5f60208284031215613bab575f80fd5b8151612b6d81612b3d565b5f82613bc457613bc461353c565b500690565b634e487b7160e01b5f52603260045260245ffd5b6001815b6001841115613c1857808504811115613bfc57613bfc6134ea565b6001841615613c0a57908102905b60019390931c928002613be1565b935093915050565b5f82613c2e57506001610a80565b81613c3a57505f610a80565b8160018114613c505760028114613c5a57613c76565b6001915050610a80565b60ff841115613c6b57613c6b6134ea565b50506001821b610a80565b5060208310610133831016604e8410600b8410161715613c99575081810a610a80565b613ca55f198484613bdd565b805f1904821115613cb857613cb86134ea565b029392505050565b5f612b6d8383613c20565b5f60ff831680613cdd57613cdd61353c565b8060ff84160491505092915050565b60ff818116838216029081169081811461275a5761275a6134ea565b60ff8281168282160390811115610a8057610a806134ea565b60ff8181168382160190811115610a8057610a806134ea56fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220aff7a61b300fa2c725d72029241f4a226edc4a3406524cc217685fb8c760ed9864736f6c634300081a00330000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000008756e69766572736500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035556450000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e516d51377a43595235764670717358414b583578664d7462483137646d476e7150616b3536417a5945356e6e6669000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e516d65686e6945584c4357555371665373517874573633576f437a555a31465967456a35714d4c555751714e6b4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000257961796f694d69785f7632352e7361666574656e736f7273205b636132386161346134345d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010696e2074686520756e6976657273652c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000b5e620f48000000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000669141ed00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000e90e278116574589fe37634739db2fbfcba4b2a20000000000000000000000009e35a4c1894697eb93bc781c0c5581c4e97b82a2
60806040526004361061035b575f3560e01c806370a08231116101bd578063b0347814116100f2578063de8f50a111610092578063ebd7edaf1161006d578063ebd7edaf146109a5578063ec3e5f45146109b9578063eda47704146109f7578063f2fde38b14610a16575f80fd5b8063de8f50a114610948578063e0be9bf914610967578063e985e9c514610986575f80fd5b8063b88d4fde116100cd578063b88d4fde146108e2578063c1d88c4414610901578063c745e3ff14610915578063c87b56dd14610929575f80fd5b8063b03478141461089a578063b0f7a3ff146108b9578063b7b6ccd5146108ce575f80fd5b80638da5cb5b1161015d578063a1a0e7fc11610138578063a1a0e7fc14610812578063a22cb46514610831578063ad72e1a514610850578063aea305071461087b575f80fd5b80638da5cb5b146107cf57806395d89b41146107eb5780639ee74dd1146107ff575f80fd5b80637df04787116101985780637df047871461073557806381d12c581461076c5780638500a45d1461079b5780638cbc52d9146107b0575f80fd5b806370a08231146106e3578063715018a61461070257806378564b7414610716575f80fd5b80633ccfd60b1161029357806358fd416d11610233578063628ae0a31161020e578063628ae0a3146106875780636352211e1461069b5780636817c76c146106ba578063702de1e3146106cf575f80fd5b806358fd416d146106235780635bb4688d146106425780635cec1b7614610672575f80fd5b8063414f11451161026e578063414f11451461059f57806342842e0e146105be5780634c34e4dc146105dd5780634ca0ce4c146105fc575f80fd5b80633ccfd60b1461054d5780633f37dce2146105615780633f3e4c1114610580575f80fd5b80632ab4d052116102fe5780632f03012e116102d95780632f03012e146104b557806331b221cd146104dc57806333727c4d1461050f5780633c1c8e491461052e575f80fd5b80632ab4d052146104625780632cfb2080146104775780632ddfb80714610496575f80fd5b8063095ea7b311610339578063095ea7b3146103eb578063122d1bad1461040c57806318160ddd1461042057806323b872dd14610443575f80fd5b806301ffc9a71461035f57806306fdde0314610393578063081812fc146103b4575b5f80fd5b34801561036a575f80fd5b5061037e610379366004612b52565b610a35565b60405190151581526020015b60405180910390f35b34801561039e575f80fd5b506103a7610a86565b60405161038a9190612ba2565b3480156103bf575f80fd5b506103d36103ce366004612bb4565b610b16565b6040516001600160a01b03909116815260200161038a565b3480156103f6575f80fd5b5061040a610405366004612be1565b610b3d565b005b348015610417575f80fd5b506103a7610b4c565b34801561042b575f80fd5b5061043560085481565b60405190815260200161038a565b34801561044e575f80fd5b5061040a61045d366004612c09565b610bd8565b34801561046d575f80fd5b50610435600b5481565b348015610482575f80fd5b5061040a610491366004612c43565b610c66565b3480156104a1575f80fd5b5061040a6104b0366004612c69565b610c9b565b3480156104c0575f80fd5b506103d373c3287bdef03b925a7c7f54791edadcd88e632ccd81565b3480156104e7575f80fd5b506103d37f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b34801561051a575f80fd5b5061037e610529366004612bb4565b610cc5565b348015610539575f80fd5b506103a7610548366004612d40565b610d4e565b348015610558575f80fd5b5061040a610d7c565b34801561056c575f80fd5b5061040a61057b366004612dc5565b610d90565b34801561058b575f80fd5b5061040a61059a366004612bb4565b610e6c565b3480156105aa575f80fd5b5061040a6105b9366004612e2f565b610e79565b3480156105c9575f80fd5b5061040a6105d8366004612c09565b610e93565b3480156105e8575f80fd5b506011546103d3906001600160a01b031681565b348015610607575f80fd5b506103d3730a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b34801561062e575f80fd5b506103a761063d366004612bb4565b610ead565b34801561064d575f80fd5b5061066161065c366004612bb4565b6110ef565b60405161038a959493929190612e6d565b34801561067d575f80fd5b50610435600a5481565b348015610692575f80fd5b506103a76112b8565b3480156106a6575f80fd5b506103d36106b5366004612bb4565b6112c5565b3480156106c5575f80fd5b5061043560075481565b3480156106da575f80fd5b506104356112cf565b3480156106ee575f80fd5b506104356106fd366004612c69565b6112ea565b34801561070d575f80fd5b5061040a61132f565b348015610721575f80fd5b5061040a610730366004612e2f565b611340565b348015610740575f80fd5b5061043561074f366004612ec8565b805160208183018101805160148252928201919093012091525481565b348015610777575f80fd5b5061078b610786366004612bb4565b611355565b60405161038a9493929190612ef9565b3480156107a6575f80fd5b5061043560095481565b3480156107bb575f80fd5b506103a76107ca366004612f3c565b611493565b3480156107da575f80fd5b505f546001600160a01b03166103d3565b3480156107f6575f80fd5b506103a76114c7565b61043561080d366004612f7f565b6114d6565b34801561081d575f80fd5b5061040a61082c366004612e2f565b6118fa565b34801561083c575f80fd5b5061040a61084b36600461303f565b61190f565b34801561085b575f80fd5b5061043561086a366004612bb4565b60166020525f908152604090205481565b348015610886575f80fd5b5061040a610895366004613074565b61191a565b3480156108a5575f80fd5b5061040a6108b4366004613119565b611a69565b3480156108c4575f80fd5b50610435611b5f81565b3480156108d9575f80fd5b5061040a611bef565b3480156108ed575f80fd5b5061040a6108fc366004613190565b611c10565b34801561090c575f80fd5b50610435611c27565b348015610920575f80fd5b506103a7611cc8565b348015610934575f80fd5b506103a7610943366004612bb4565b611cd5565b348015610953575f80fd5b5061037e6109623660046131f3565b611d84565b348015610972575f80fd5b506010546103d3906001600160a01b031681565b348015610991575f80fd5b5061037e6109a036600461328f565b611ee9565b3480156109b0575f80fd5b506103a7611f16565b3480156109c4575f80fd5b506011546109df90600160a01b90046001600160401b031681565b6040516001600160401b03909116815260200161038a565b348015610a02575f80fd5b5061040a610a11366004612c69565b611f23565b348015610a21575f80fd5b5061040a610a30366004612c69565b611f4d565b5f6001600160e01b031982166380ac58cd60e01b1480610a6557506001600160e01b03198216635b5e139f60e01b145b80610a8057506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060018054610a95906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac1906132c0565b8015610b0c5780601f10610ae357610100808354040283529160200191610b0c565b820191905f5260205f20905b815481529060010190602001808311610aef57829003601f168201915b5050505050905090565b5f610b2082611f8a565b505f828152600560205260409020546001600160a01b0316610a80565b610b48828233611fc2565b5050565b600f8054610b59906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054610b85906132c0565b8015610bd05780601f10610ba757610100808354040283529160200191610bd0565b820191905f5260205f20905b815481529060010190602001808311610bb357829003601f168201915b505050505081565b6001600160a01b038216610c0657604051633250574960e11b81525f60048201526024015b60405180910390fd5b5f610c12838333611fcf565b9050836001600160a01b0316816001600160a01b031614610c60576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610bfd565b50505050565b610c6e6120c1565b601180546001600160401b03909216600160a01b0267ffffffffffffffff60a01b19909216919091179055565b610ca36120c1565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516333727c4d60e01b8152600481018290525f907f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a06001600160a01b0316906333727c4d90602401602060405180830381865afa158015610d2a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a8091906132f8565b60605f8284604051602001610d6492919061332a565b60408051808303601f19018152919052949350505050565b610d846120c1565b610d8e33476120ed565b565b610d9e848484848888611d84565b610dea5760405162461bcd60e51b815260206004820152601960248201527f455243373030373a20696e76616c6964206169676344617461000000000000006044820152606401610bfd565b5f60148585604051610dfd92919061333b565b908152604051908190036020018120549150610e1c908490849061333b565b60405180910390208585604051610e3492919061333b565b6040519081900381209083907fd77aab0eeab3a3cbdac072fcdbc34709b18d6c4af91f7869c71cbbb13d71a6b9905f90a45050505050565b610e746120c1565b600b55565b610e816120c1565b600e610e8e82848361338e565b505050565b610e8e83838360405180602001604052805f815250611c10565b5f8181526012602052604081206003015460609103610fc2575f8281526012602090815260409182902091517f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e392610f0c9290916001830191016134b5565b60408051601f1981840301815290829052610f26916134df565b90815260200160405180910390208054610f3f906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6b906132c0565b8015610fb65780601f10610f8d57610100808354040283529160200191610fb6565b820191905f5260205f20905b815481529060010190602001808311610f9957829003601f168201915b50505050509050919050565b5f828152601260209081526040808320600381015491519192610fea926001830191016134b5565b60408051601f1981840301815290829052611008929160200161332a565b60408051601f1981840301815290829052611b5f5f52601560205291507f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e3906110529083906134df565b9081526020016040518091039020805461106b906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054611097906132c0565b80156110e25780601f106110b9576101008083540402835291602001916110e2565b820191905f5260205f20905b8154815290600101906020018083116110c557829003601f168201915b5050505050915050919050565b60126020525f9081526040902080548190611109906132c0565b80601f0160208091040260200160405190810160405280929190818152602001828054611135906132c0565b80156111805780601f1061115757610100808354040283529160200191611180565b820191905f5260205f20905b81548152906001019060200180831161116357829003601f168201915b505050505090806001018054611195906132c0565b80601f01602080910402602001604051908101604052809291908181526020018280546111c1906132c0565b801561120c5780601f106111e35761010080835404028352916020019161120c565b820191905f5260205f20905b8154815290600101906020018083116111ef57829003601f168201915b505050505090806002018054611221906132c0565b80601f016020809104026020016040519081016040528092919081815260200182805461124d906132c0565b80156112985780601f1061126f57610100808354040283529160200191611298565b820191905f5260205f20905b81548152906001019060200180831161127b57829003601f168201915b5050505060038301546004909301549192916001600160a01b0316905085565b600c8054610b59906132c0565b5f610a8082611f8a565b5f6007546112db611c27565b6112e591906134fe565b905090565b5f6001600160a01b038216611314576040516322718ad960e21b81525f6004820152602401610bfd565b506001600160a01b03165f9081526004602052604090205490565b6113376120c1565b610d8e5f612180565b6113486120c1565b600c610e8e82848361338e565b60136020525f90815260409020805460018201546002830180546001600160a01b03909316939192611386906132c0565b80601f01602080910402602001604051908101604052809291908181526020018280546113b2906132c0565b80156113fd5780601f106113d4576101008083540402835291602001916113fd565b820191905f5260205f20905b8154815290600101906020018083116113e057829003601f168201915b505050505090806003018054611412906132c0565b80601f016020809104026020016040519081016040528092919081815260200182805461143e906132c0565b80156114895780601f1061146057610100808354040283529160200191611489565b820191905f5260205f20905b81548152906001019060200180831161146c57829003601f168201915b5050505050905084565b601560209081525f9283526040909220815180830184018051928152908401929093019190912091528054610b59906132c0565b606060028054610a95906132c0565b5f6009545f141580156114ea575060095442115b6115295760405162461bcd60e51b815260206004820152601060248201526f14d85b19481b9bdd081cdd185c9d195960821b6044820152606401610bfd565b600a5415806115395750600a5442105b6115725760405162461bcd60e51b815260206004820152600a60248201526914d85b1948195b99195960b21b6044820152606401610bfd565b5f8888888860405160200161158a9493929190613511565b604051602081830303815290604052905060146115a78285610d4e565b6040516115b491906134df565b9081526020016040518091039020545f1461161c5760405162461bcd60e51b815260206004820152602260248201527f70726f6d707420616e6420736565642068617320616c7265616479206d696e74604482015261195960f21b6064820152608401610bfd565b6116246112cf565b3410156116735760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f7567682066756e6420746f206d696e74204e465400000000006044820152606401610bfd565b600b5415806116855750600b54600854105b6116d15760405162461bcd60e51b815260206004820152601860248201527f4d617820746f74616c20737570706c79207265616368656400000000000000006044820152606401610bfd565b6011546001600160a01b03161561170757601154600754611707916001600160a01b03169061170290600a90613550565b6120ed565b6010546001600160a01b03161561174457601054600754611744916001600160a01b031690600a9061173a906009613563565b6117029190613550565b6040518060a001604052808a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250505090825250604080516020601f8b0181900481028201810190925289815291810191908a908a90819084018382808284375f92019190915250505090825250604080516020601f8901819004810282018101909252878152918101919088908890819084018382808284375f92018290525093855250505060208083018790526001600160a01b038e16604093840152600854825260129052208151819061182a908261357a565b506020820151600182019061183f908261357a565b5060408201516002820190611854908261357a565b5060608201516003820155608090910151600490910180546001600160a01b0319166001600160a01b0390921691909117905561189181846121cf565b61189d8a600854612347565b60088054905f6118ac83613634565b919050555060085460146118c08386610d4e565b6040516118cd91906134df565b908152604051908190036020019020556008546118ec9060019061364c565b9a9950505050505050505050565b6119026120c1565b600d610e8e82848361338e565b610b48338383612360565b60405163c4be5cab60e01b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9063c4be5cab906119539089908990600401613687565b6020604051808303815f875af115801561196f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611993919061369a565b5f888152601660205260409081902082905551630901e0f960e31b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9163480f07c8916119dd9190889088906004016136b1565b5f604051808303815f87803b1580156119f4575f80fd5b505af1158015611a06573d5f803e3d5ffd5b505050508585604051611a1a92919061333b565b6040518091039020877f65deac95b53ba76b9cdc6cf446af81731e1218c91eaf9811a95d28bde23b893e86868686604051611a5894939291906136ca565b60405180910390a350505050505050565b336001600160a01b037f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a0168114611ae65760405163432e033760e11b81526001600160a01b037f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a08116600483015282166024820152604401610bfd565b5f86815260136020526040902080546001600160a01b0316611b3f5760405162461bcd60e51b815260206004820152601260248201527172657175657374206e6f742065786973747360701b6044820152606401610bfd565b611b5f5f526015602052604051869086907f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e390611b809060028601906136f0565b90815260200160405180910390209182611b9b92919061338e565b507faf2b2381ddcb18a2b18a7826186fd216acdd9c852a8c7a9a49e7eab127f96ccf8782600101548360020189898989604051611bde97969594939291906136fb565b60405180910390a150505050505050565b611bf76120c1565b6009545f03611c065742600955565b42600a555f600955565b611c1b848484610bd8565b610c60848484846123fe565b601154604051620e1d8d60e41b8152611b5f6004820152600160a01b9091046001600160401b031660248201525f907f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a06001600160a01b03169062e1d8d090604401602060405180830381865afa158015611ca4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112e5919061369a565b600d8054610b59906132c0565b5f818152601260205260408120600381015460609291611d58916002820191906001820190611d0390612524565b5f88815260126020526040902060040154611d26906001600160a01b0316612628565b611d2f89610ead565b604051602001611d44969594939291906137ae565b604051602081830303815290604052612761565b90505f81604051602001611d6c9190613a3e565b60408051601f19818403018152919052949350505050565b5f8060148888604051611d9892919061333b565b9081526040805160209281900383018120545f8181526016909452918320546317861f8760e01b8252600482015290925073c3287bdef03b925a7c7f54791edadcd88e632ccd906317861f87906024015f60405180830381865afa158015611e02573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611e299190810190613a6f565b5f83815260166020526040908190205490516333727c4d60e01b815291925073c3287bdef03b925a7c7f54791edadcd88e632ccd916333727c4d91611e749160040190815260200190565b602060405180830381865afa158015611e8f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611eb391906132f8565b8015611edc57508686604051611eca92919061333b565b60405180910390208180519060200120145b9998505050505050505050565b6001600160a01b039182165f90815260066020908152604080832093909416825291909152205460ff1690565b600e8054610b59906132c0565b611f2b6120c1565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b611f556120c1565b6001600160a01b038116611f7e57604051631e4fbdf760e01b81525f6004820152602401610bfd565b611f8781612180565b50565b5f818152600360205260408120546001600160a01b031680610a8057604051637e27328960e01b815260048101849052602401610bfd565b610e8e83838360016128c3565b5f828152600360205260408120546001600160a01b0390811690831615611ffb57611ffb8184866129c7565b6001600160a01b03811615612035576120165f855f806128c3565b6001600160a01b0381165f90815260046020526040902080545f190190555b6001600160a01b03851615612063576001600160a01b0385165f908152600460205260409020805460010190555b5f8481526003602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b5f546001600160a01b03163314610d8e5760405163118cdaa760e01b8152336004820152602401610bfd565b804710156121105760405163cd78605960e01b8152306004820152602401610bfd565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114612159576040519150601f19603f3d011682016040523d82523d5f602084013e61215e565b606091505b5050905080610e8e57604051630a12f52160e11b815260040160405180910390fd5b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f81836040516020016121e392919061332a565b60405160208183030381529060405290505f7f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a06001600160a01b0316635b953806600754600a6122316112cf565b61223c90600b613563565b6122469190613550565b612250919061364c565b611b5f8530601160149054906101000a90046001600160401b03166040518663ffffffff1660e01b815260040161228a9493929190613ae3565b60206040518083038185885af11580156122a6573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906122cb919061369a565b5f818152601360205260409020909150600281016122e9848261357a565b5080546001600160a01b031916339081178255611b5f600183018190556040517fa0faead83d70148ae18b694377f9bef079251342ab90e14af0f9ef68b891269f926123389286928a90613b33565b60405180910390a15050505050565b610b48828260405180602001604052805f815250612a2b565b6001600160a01b03821661239257604051630b61174360e31b81526001600160a01b0383166004820152602401610bfd565b6001600160a01b038381165f81815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b15610c6057604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290612440903390889087908790600401613b69565b6020604051808303815f875af192505050801561247a575060408051601f3d908101601f1916820190925261247791810190613b9b565b60015b6124e1573d8080156124a7576040519150601f19603f3d011682016040523d82523d5f602084013e6124ac565b606091505b5080515f036124d957604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461251d57604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b5050505050565b6060815f0361254a5750506040805180820190915260018152600360fc1b602082015290565b815f5b8115612573578061255d81613634565b915061256c9050600a83613550565b915061254d565b5f816001600160401b0381111561258c5761258c612c82565b6040519080825280601f01601f1916602001820160405280156125b6576020820181803683370190505b5090505b8415612620576125cb60018361364c565b91506125d8600a86613bb6565b6125e39060306134fe565b60f81b8183815181106125f8576125f8613bc9565b60200101906001600160f81b03191690815f1a905350612619600a86613550565b94506125ba565b949350505050565b60408051602880825260608281019093525f91906020820181803683370190505090505f5b601481101561275a575f61266282601361364c565b61266d906008613563565b612678906002613cc0565b61268b906001600160a01b038716613550565b60f81b90505f60108260f81c6126a19190613ccb565b60f81b90505f8160f81c60106126b79190613cec565b8360f81c6126c59190613d08565b60f81b90506126d382612a41565b856126df866002613563565b815181106126ef576126ef613bc9565b60200101906001600160f81b03191690815f1a90535061270e81612a41565b8561271a866002613563565b6127259060016134fe565b8151811061273557612735613bc9565b60200101906001600160f81b03191690815f1a905350506001909201915061264d9050565b5092915050565b80516060905f81900361278357505060408051602081019091525f8152919050565b5f60036127918360026134fe565b61279b9190613550565b6127a6906004613563565b90505f6127b48260206134fe565b6001600160401b038111156127cb576127cb612c82565b6040519080825280601f01601f1916602001820160405280156127f5576020820181803683370190505b5090505f604051806060016040528060408152602001613d3b60409139905060018101602083015f5b8681101561287f576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b83526004909201910161281e565b50600386066001811461289957600281146128aa576128b5565b613d3d60f01b6001198301526128b5565b603d60f81b5f198301525b505050918152949350505050565b80806128d757506001600160a01b03821615155b15612998575f6128e684611f8a565b90506001600160a01b038316158015906129125750826001600160a01b0316816001600160a01b031614155b801561292557506129238184611ee9565b155b1561294e5760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610bfd565b81156129965783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260056020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6129d2838383612a7b565b610e8e576001600160a01b038316612a0057604051637e27328960e01b815260048101829052602401610bfd565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610bfd565b612a358383612adc565b610e8e5f8484846123fe565b5f600a60f883901c1015612a6757612a5e60f883901c6030613d21565b60f81b92915050565b612a5e60f883901c6057613d21565b919050565b5f6001600160a01b038316158015906126205750826001600160a01b0316846001600160a01b03161480612ab45750612ab48484611ee9565b806126205750505f908152600560205260409020546001600160a01b03908116911614919050565b6001600160a01b038216612b0557604051633250574960e11b81525f6004820152602401610bfd565b5f612b1183835f611fcf565b90506001600160a01b03811615610e8e576040516339e3563760e11b81525f6004820152602401610bfd565b6001600160e01b031981168114611f87575f80fd5b5f60208284031215612b62575f80fd5b8135612b6d81612b3d565b9392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f612b6d6020830184612b74565b5f60208284031215612bc4575f80fd5b5035919050565b80356001600160a01b0381168114612a76575f80fd5b5f8060408385031215612bf2575f80fd5b612bfb83612bcb565b946020939093013593505050565b5f805f60608486031215612c1b575f80fd5b612c2484612bcb565b9250612c3260208501612bcb565b929592945050506040919091013590565b5f60208284031215612c53575f80fd5b81356001600160401b0381168114612b6d575f80fd5b5f60208284031215612c79575f80fd5b612b6d82612bcb565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715612cbe57612cbe612c82565b604052919050565b5f6001600160401b03821115612cde57612cde612c82565b50601f01601f191660200190565b5f82601f830112612cfb575f80fd5b8135602083015f612d13612d0e84612cc6565b612c96565b9050828152858383011115612d26575f80fd5b828260208301375f92810160200192909252509392505050565b5f8060408385031215612d51575f80fd5b82356001600160401b03811115612d66575f80fd5b612d7285828601612cec565b95602094909401359450505050565b5f8083601f840112612d91575f80fd5b5081356001600160401b03811115612da7575f80fd5b602083019150836020828501011115612dbe575f80fd5b9250929050565b5f805f8060408587031215612dd8575f80fd5b84356001600160401b03811115612ded575f80fd5b612df987828801612d81565b90955093505060208501356001600160401b03811115612e17575f80fd5b612e2387828801612d81565b95989497509550505050565b5f8060208385031215612e40575f80fd5b82356001600160401b03811115612e55575f80fd5b612e6185828601612d81565b90969095509350505050565b60a081525f612e7f60a0830188612b74565b8281036020840152612e918188612b74565b90508281036040840152612ea58187612b74565b606084019590955250506001600160a01b03919091166080909101529392505050565b5f60208284031215612ed8575f80fd5b81356001600160401b03811115612eed575f80fd5b61262084828501612cec565b60018060a01b0385168152836020820152608060408201525f612f1f6080830185612b74565b8281036060840152612f318185612b74565b979650505050505050565b5f8060408385031215612f4d575f80fd5b8235915060208301356001600160401b03811115612f69575f80fd5b612f7585828601612cec565b9150509250929050565b5f805f805f805f8060a0898b031215612f96575f80fd5b612f9f89612bcb565b975060208901356001600160401b03811115612fb9575f80fd5b612fc58b828c01612d81565b90985096505060408901356001600160401b03811115612fe3575f80fd5b612fef8b828c01612d81565b90965094505060608901356001600160401b0381111561300d575f80fd5b6130198b828c01612d81565b999c989b50969995989497949560800135949350505050565b8015158114611f87575f80fd5b5f8060408385031215613050575f80fd5b61305983612bcb565b9150602083013561306981613032565b809150509250929050565b5f805f805f805f6080888a03121561308a575f80fd5b8735965060208801356001600160401b038111156130a6575f80fd5b6130b28a828b01612d81565b90975095505060408801356001600160401b038111156130d0575f80fd5b6130dc8a828b01612d81565b90955093505060608801356001600160401b038111156130fa575f80fd5b6131068a828b01612d81565b989b979a50959850939692959293505050565b5f805f805f6060868803121561312d575f80fd5b8535945060208601356001600160401b03811115613149575f80fd5b61315588828901612d81565b90955093505060408601356001600160401b03811115613173575f80fd5b61317f88828901612d81565b969995985093965092949392505050565b5f805f80608085870312156131a3575f80fd5b6131ac85612bcb565b93506131ba60208601612bcb565b92506040850135915060608501356001600160401b038111156131db575f80fd5b6131e787828801612cec565b91505092959194509250565b5f805f805f8060608789031215613208575f80fd5b86356001600160401b0381111561321d575f80fd5b61322989828a01612d81565b90975095505060208701356001600160401b03811115613247575f80fd5b61325389828a01612d81565b90955093505060408701356001600160401b03811115613271575f80fd5b61327d89828a01612d81565b979a9699509497509295939492505050565b5f80604083850312156132a0575f80fd5b6132a983612bcb565b91506132b760208401612bcb565b90509250929050565b600181811c908216806132d457607f821691505b6020821081036132f257634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215613308575f80fd5b8151612b6d81613032565b5f81518060208401855e5f93019283525090919050565b8281525f6126206020830184613313565b818382375f9101908152919050565b601f821115610e8e57805f5260205f20601f840160051c8101602085101561336f5750805b601f840160051c820191505b8181101561251d575f815560010161337b565b6001600160401b038311156133a5576133a5612c82565b6133b9836133b383546132c0565b8361334a565b5f601f8411600181146133ea575f85156133d35750838201355b5f19600387901b1c1916600186901b17835561251d565b5f83815260208120601f198716915b8281101561341957868501358255602094850194600190920191016133f9565b5086821015613435575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f8154613453816132c0565b60018216801561346a576001811461347f576134ac565b60ff19831686528115158202860193506134ac565b845f5260205f205f5b838110156134a457815488820152600190910190602001613488565b505081860193505b50505092915050565b5f6134c08285613447565b622d2d2d60e81b81526134d66003820185613447565b95945050505050565b5f612b6d8284613313565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610a8057610a806134ea565b838582375f848201622d2d2d60e81b8152838560038301375f93016003019283525090949350505050565b634e487b7160e01b5f52601260045260245ffd5b5f8261355e5761355e61353c565b500490565b8082028115828204841417610a8057610a806134ea565b81516001600160401b0381111561359357613593612c82565b6135a7816135a184546132c0565b8461334a565b6020601f8211600181146135d9575f83156135c25750848201515b5f19600385901b1c1916600184901b17845561251d565b5f84815260208120601f198516915b8281101561360857878501518255602094850194600190920191016135e8565b508482101561362557868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f60018201613645576136456134ea565b5060010190565b81810381811115610a8057610a806134ea565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b602081525f61262060208301848661365f565b5f602082840312156136aa575f80fd5b5051919050565b838152604060208201525f6134d660408301848661365f565b604081525f6136dd60408301868861365f565b8281036020840152612f3181858761365f565b5f612b6d8284613447565b87815286602082015260a060408201525f808754613718816132c0565b8060a0860152600182165f8114613736576001811461375257613783565b60ff19831660c087015260c082151560051b8701019350613783565b8a5f5260205f205f5b8381101561377a57815488820160c0015260019091019060200161375b565b870160c0019450505b505050828103606084015261379981878961365f565b905082810360808401526118ec81858761365f565b683d913730b6b2911d1160b91b81525f6137cb6009830189613447565b7f222c202261747472696275746573223a205b7b2274726169745f74797065223a81527f2022706f7369746976655f70726f6d7074222c202276616c7565223a202200006020820152613821603e820189613447565b7f227d2c207b2274726169745f74797065223a20226e656761746976655f70726f81526f36b83a111610113b30b63ab2911d101160811b6020820152905061386c6030820188613447565b7f227d2c207b2274726169745f74797065223a202273656564222c202276616c7581526432911d101160d91b602082015290506138ac6025820187613313565b7f227d2c207b2274726169745f74797065223a2022617574686f72222c202276618152680d8eaca4474404460f60bb1b602082015290506138f06029820186613313565b7f227d2c207b2274726169745f74797065223a20226d6f64656c222c202276616c81527f7565223a2022537461626c6520446966667573696f6e227d5d2c20226465736360208201527f72697074696f6e223a2022537461626c6520446966667573696f6e206973206160408201527f206c6174656e7420746578742d746f2d696d61676520646966667573696f6e2060608201527f6d6f64656c2063617061626c65206f662067656e65726174696e672070686f7460808201527f6f2d7265616c697374696320696d6167657320676976656e20616e792074657860a08201527f7420696e7075742e222c2022696d616765223a202268747470733a2f2f67617460c08201527f657761792e70696e6174612e636c6f75642f697066732f00000000000000000060e0820152905060f781016118ec613a308287613313565b61227d60f01b815260020190565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081525f612b6d601d830184613313565b5f60208284031215613a7f575f80fd5b81516001600160401b03811115613a94575f80fd5b8201601f81018413613aa4575f80fd5b8051613ab2612d0e82612cc6565b818152856020838501011115613ac6575f80fd5b8160208401602083015e5f91810160200191909152949350505050565b84815260a060208201525f613afb60a0830186612b74565b6001600160a01b03949094166040830152506001600160401b039190911660608201528082036080909101525f815260200192915050565b84815260018060a01b0384166020820152826040820152608060608201525f613b5f6080830184612b74565b9695505050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90613b5f90830184612b74565b5f60208284031215613bab575f80fd5b8151612b6d81612b3d565b5f82613bc457613bc461353c565b500690565b634e487b7160e01b5f52603260045260245ffd5b6001815b6001841115613c1857808504811115613bfc57613bfc6134ea565b6001841615613c0a57908102905b60019390931c928002613be1565b935093915050565b5f82613c2e57506001610a80565b81613c3a57505f610a80565b8160018114613c505760028114613c5a57613c76565b6001915050610a80565b60ff841115613c6b57613c6b6134ea565b50506001821b610a80565b5060208310610133831016604e8410600b8410161715613c99575081810a610a80565b613ca55f198484613bdd565b805f1904821115613cb857613cb86134ea565b029392505050565b5f612b6d8383613c20565b5f60ff831680613cdd57613cdd61353c565b8060ff84160491505092915050565b60ff818116838216029081169081811461275a5761275a6134ea565b60ff8281168282160390811115610a8057610a806134ea565b60ff8181168382160190811115610a8057610a806134ea56fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220aff7a61b300fa2c725d72029241f4a226edc4a3406524cc217685fb8c760ed9864736f6c634300081a0033
1
20,291,117
beac91f787202a63b6fffc3bb161bf250c060cd566f3153950bfe856b2e44b3e
9d6d264f0fd5335156dbc5a42bc1e5e94ee166dcf06dc645435c3e87f33e445d
a7d770a5c4276a4d85caba7bea9a1fcbd3672db7
ba9f42e902447a771ee43d102f01b8eb0920dc8f
32df48942d3f320f7bcc5ac547468ceb39256d3e
608060405234801561001057600080fd5b5060405161050038038061050083398101604081905261002f9161036b565b60405147906000906001600160a01b0389169083908381818185875af1925050503d806000811461007c576040519150601f19603f3d011682016040523d82523d6000602084013e610081565b606091505b50509050806100bb5760405162461bcd60e51b8152602060048201526002602482015261229960f11b604482015260640160405180910390fd5b604080516001600160601b031960608a811b821660208401526001600160e81b031960e88a901b16603484015289901b1660378201528151808203602b018152604b82018352600b60f81b606b8301526000606c83018190528351808403604d0181526002606d850181815260cd86019096529294909391929091608d015b606081526020019060019003908161013a57905050604080516001600160a01b038e16602082015290810187905290915060600160405160208183030381529060405281600081518110610190576101906103f0565b602002602001018190525085600160ff1b888560006040516020016101b995949392919061044c565b604051602081830303815290604052816001815181106101db576101db6103f0565b60209081029190910101526040516324856bc360e01b81526001600160a01b038c16906324856bc390610214908590859060040161048d565b600060405180830381600087803b15801561022e57600080fd5b505af192505050801561023f575060015b61034757604051600160fa1b602082015260009060210160408051808303601f190181526001808452838301909252925060009190816020015b60608152602001906001900390816102795790505060408051600060208201526001600160a01b038b169181019190915260608101899052909150608001604051602081830303815290604052816000815181106102d9576102d96103f0565b60209081029190910101526040516324856bc360e01b81526001600160a01b038e16906324856bc390610312908590859060040161048d565b600060405180830381600087803b15801561032c57600080fd5b505af1158015610340573d6000803e3d6000fd5b5050505050505b856001600160a01b0316ff5b6001600160a01b038116811461036857600080fd5b50565b60008060008060008060c0878903121561038457600080fd5b865161038f81610353565b60208801519096506103a081610353565b60408801519095506103b181610353565b606088015190945062ffffff811681146103ca57600080fd5b608088015160a089015191945092506103e281610353565b809150509295509295509295565b634e487b7160e01b600052603260045260246000fd5b6000815180845260005b8181101561042c57602081850181015186830182015201610410565b506000602082860101526020601f19601f83011685010191505092915050565b60018060a01b038616815284602082015283604082015260a06060820152600061047960a0830185610406565b905082151560808301529695505050505050565b6040815260006104a06040830185610406565b6020838203818501528185518084528284019150828160051b85010183880160005b838110156104f057601f198784030185526104de838351610406565b948601949250908501906001016104c2565b5090999850505050505050505056fe000000000000000000000000ef1c6e67703c7bd7107eed8303fbe6ec2554bf6b000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000000000000000000000000000000000002337a7d00000000000000000000000008b27e4db3b82dbb70363eb66ea1017783f0cec5b
1
20,291,122
e2670e90efb4b48ad4308134901e1b061b0db8d3bb9b60e5606bda1ee956d5a5
94fe525603658da6550fc38912f82ba5e785a4e62f22130de70e6b5b1018c89d
7a4e9e8f760569b51a96607ea1b76ce632b7c6bc
5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f
cb1c1f130d01fc72e4f1d81a9ee51304d2266e94
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,291,123
c6604d84c1547e893cb42a3256bf005d1b6d62d76883059a3ca90176d3563d97
900711d64afd91302da3995c9bdc55c38297c40d0cef8c2f78ff21cda3609c2a
b974c3566eeb320c98c84bd34e3911ae50056042
5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f
3960402f761f8c41bb9e8670ec6642e799a660b2
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,291,126
25e60e746b8816914a4d1f3cff939503714a22e266dfdceb9c8c85c10b095310
e514f134eb66e4a429c4f691c0fc87987b848af1698d364dc31103d5b9a36d51
9980fedf494f722887dd5d7eaee55efe354789c6
9980fedf494f722887dd5d7eaee55efe354789c6
64c9441537425a01d7ea1e6590be1fefd5985bf2
60a06040523060805234801561001457600080fd5b506080516140ba61004c60003960008181610b9d01528181610bdd015281816111b0015281816111f0015261142c01526140ba6000f3fe6080604052600436106102185760003560e01c806301ffc9a71461021d578063081812fc14610252578063083118d51461027f57806312064c34146102a157806314d140b0146102dc57806318160ddd146102fd5780631b13ee8a14610312578063248a9ca3146103325780632f2ff15d14610352578063318cd6731461037457806336568abe146103875780633659cfe6146103a757806338d322ef146103c75780633eb76b9c146103e7578063410a1db11461040757806349dcc204146104275780634f1ef286146104625780635142d5e31461047557806352d1902d1461049557806352e62a43146104aa578063544ffc9c146104ca5780635bbb21771461053f5780635c975abb1461056c5780636352211e146105845780636927850a146105a4578063696c81bb146105ba5780636d1daa28146105da5780636dc0ae22146105fa57806370a082311461061a57806375b238fc1461063a5780637a26db171461065c5780637f66dea11461069257806382d837a1146106b35780638462151c146106d357806391d1485414610700578063926d7d7f1461072057806399a2557a14610742578063a217fddf14610762578063b09de27814610777578063b6699d0e1461078a578063c23dc68f146107aa578063c4ae3168146107d7578063c8506277146107ec578063c87b56dd1461084f578063d547741f1461086f578063db7817f91461088f578063e985e9c5146108af575b600080fd5b34801561022957600080fd5b5061023d61023836600461325f565b6108cf565b60405190151581526020015b60405180910390f35b34801561025e57600080fd5b5061027261026d366004613289565b610906565b60405161024991906132a2565b34801561028b57600080fd5b50610294610976565b6040516102499190613306565b3480156102ad57600080fd5b506102ce6102bc36600461332e565b60066020526000908152604090205481565b604051908152602001610249565b3480156102e857600080fd5b5061013654610272906001600160a01b031681565b34801561030957600080fd5b506102ce610a05565b34801561031e57600080fd5b506102ce61032d36600461334b565b610a79565b34801561033e57600080fd5b506102ce61034d366004613289565b610aa2565b34801561035e57600080fd5b5061037261036d366004613377565b610ab7565b005b6103726103823660046133b9565b610ad8565b34801561039357600080fd5b506103726103a2366004613377565b610b10565b3480156103b357600080fd5b506103726103c236600461332e565b610b93565b3480156103d357600080fd5b506103726103e236600461334b565b610c5b565b3480156103f357600080fd5b50610372610402366004613289565b610d28565b34801561041357600080fd5b5061037261042236600461332e565b611089565b34801561043357600080fd5b506104476104423660046133e5565b611120565b60408051825181526020928301519281019290925201610249565b61037261047036600461349c565b6111a6565b34801561048157600080fd5b5061037261049036600461352e565b61125b565b3480156104a157600080fd5b506102ce61141f565b3480156104b657600080fd5b506103726104c536600461358a565b6114cd565b3480156104d657600080fd5b506105156104e5366004613289565b600260205260009081526040902080546001909101546001600160801b0380831692600160801b90048116911683565b604080516001600160801b0394851681529284166020840152921691810191909152606001610249565b34801561054b57600080fd5b5061055f61055a3660046135d8565b61174a565b60405161024991906136a4565b34801561057857600080fd5b50603a5460ff1661023d565b34801561059057600080fd5b5061027261059f366004613289565b6117c1565b3480156105b057600080fd5b506102ce60075481565b3480156105c657600080fd5b506103726105d53660046136f2565b6117f4565b3480156105e657600080fd5b506103726105f536600461370d565b61185d565b34801561060657600080fd5b50600354610272906001600160a01b031681565b34801561062657600080fd5b506102ce61063536600461332e565b6118b9565b34801561064657600080fd5b506102ce60008051602061406583398151915281565b34801561066857600080fd5b506101365461067f90600160a01b900461ffff1681565b60405161ffff9091168152602001610249565b34801561069e57600080fd5b5061013454610272906001600160a01b031681565b3480156106bf57600080fd5b506102ce6106ce366004613289565b61192c565b3480156106df57600080fd5b506106f36106ee36600461332e565b61195f565b6040516102499190613729565b34801561070c57600080fd5b5061023d61071b366004613377565b6119d6565b34801561072c57600080fd5b506102ce600080516020613fb283398151915281565b34801561074e57600080fd5b506106f361075d366004613761565b611a01565b34801561076e57600080fd5b506102ce600081565b610372610785366004613796565b611a8b565b34801561079657600080fd5b506102ce6107a5366004613289565b611bcb565b3480156107b657600080fd5b506107ca6107c5366004613289565b611bfe565b6040516102499190613819565b3480156107e357600080fd5b50610372611c8c565b3480156107f857600080fd5b5061080c610807366004613289565b611cbf565b604051610249919081516001600160801b039081168252602080840151821690830152604080840151821690830152606092830151169181019190915260800190565b34801561085b57600080fd5b5061029461086a366004613289565b611db2565b34801561087b57600080fd5b5061037261088a366004613377565b611e25565b34801561089b57600080fd5b506102ce6108aa366004613289565b611e41565b3480156108bb57600080fd5b5061023d6108ca366004613827565b611e4e565b60006001600160e01b03198216637965db0b60e01b148061090057506301ffc9a760e01b6001600160e01b03198316145b92915050565b6101355460405163020604bf60e21b8152600481018390526000916001600160a01b03169063081812fc906024015b602060405180830381865afa158015610952573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109009190613855565b610137805461098490613872565b80601f01602080910402602001604051908101604052809291908181526020018280546109b090613872565b80156109fd5780601f106109d2576101008083540402835291602001916109fd565b820191906000526020600020905b8154815290600101906020018083116109e057829003601f168201915b505050505081565b61013554604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015610a50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7491906138a6565b905090565b6001600160a01b0382166000908152600460205260408120610a9b9083611ec6565b9392505050565b6000908152609e602052604090206001015490565b610ac082610aa2565b610ac981611fe1565b610ad38383611feb565b505050565b610ae0612071565b6000610aeb836120b9565b9050600080610af98561217b565b91509150610b0983838387612339565b5050505050565b6001600160a01b0381163314610b855760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610b8f828261264c565b5050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610bdb5760405162461bcd60e51b8152600401610b7c906138bf565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610c0d6126b3565b6001600160a01b031614610c335760405162461bcd60e51b8152600401610b7c906138f9565b610c3c816126cf565b60408051600080825260208201909252610c58918391906126e7565b50565b600080516020614065833981519152610c7381611fe1565b6101345460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb90610ca69086908690600401613933565b6020604051808303816000875af1158015610cc5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce9919061395c565b507f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d58383604051610d1b929190613933565b60405180910390a1505050565b6000818152600260205260408120600181015481549192916001600160801b0391821691610d629180821691600160801b9091041661398d565b610d6c919061398d565b6001600160801b031611610db75760405162461bcd60e51b81526020600482015260126024820152711b9bc81d9bdd195cc8195e1c1c995cdcd95960721b6044820152606401610b7c565b600354604051632d63f69360e01b8152600481018490526000916001600160a01b031690632d63f69390602401602060405180830381865afa158015610e01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2591906138a6565b90506000610e3282611e41565b90506000600360009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610e8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eaf9190613855565b6001600160a01b0316633a46b1a830856040518363ffffffff1660e01b8152600401610edc929190613933565b602060405180830381865afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d91906138a6565b8454909150600090610f54908490610f4590600160801b90046001600160801b0316856139b4565b610f4f91906139e1565b612852565b8554909150600090610f75908590610f45906001600160801b0316866139b4565b6001870154909150600090610f99908690610f45906001600160801b0316876139b4565b600089815260026020818152604080842084815560010180546001600160801b03199081169091558151608089811b83169482019490945289841b821660308201529286901b16908201529293509160500160408051601f198184030181529190526003549091506001600160a01b0316635f398a148b846110196128bf565b856040518563ffffffff1660e01b81526004016110399493929190613a03565b6020604051808303816000875af1158015611058573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107c91906138a6565b5050505050505050505050565b6000805160206140658339815191526110a181611fe1565b6001600160a01b0382166110c85760405163d92e233d60e01b815260040160405180910390fd5b61013680546001600160a01b0319166001600160a01b0384161790556040517f1defc7e59eeac6c8cb243873ba35cd0ac8c57fe81e330b6ab84c23c63c1f007d906111149084906132a2565b60405180910390a15050565b60408051808201825260008082526020820152610135549151631277308160e21b8152600481018590526024810184905290916001600160a01b0316906349dcc204906044016040805180830381865afa158015611182573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b9190613a37565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036111ee5760405162461bcd60e51b8152600401610b7c906138bf565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166112206126b3565b6001600160a01b0316146112465760405162461bcd60e51b8152600401610b7c906138f9565b61124f826126cf565b610b8f828260016126e7565b600054610100900460ff161580801561127b5750600054600160ff909116105b8061129c575061128a306128df565b15801561129c575060005460ff166001145b6112ff5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610b7c565b6000805460ff191660011790558015611322576000805461ff0019166101001790555b61133f7312163980a1ec6f5c955a19793914192d01c872686128ee565b61013580546001600160a01b0319166001600160a01b0387161790556113696001621e8480612926565b610136805461ffff60a01b191660af60a01b179055611389600085611feb565b6113a160008051602061406583398151915285611feb565b61013680546001600160a01b038086166001600160a01b0319928316179092556101348054928516929091169190911790558015610b09576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114ba5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608401610b7c565b50600080516020613ff283398151915290565b600354604051632d63f69360e01b8152600481018490526000916115419133916001600160a01b031690632d63f69390602401602060405180830381865afa15801561151d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032d91906138a6565b90506000811161157f5760405162461bcd60e51b81526020600482015260096024820152681b9bc81dd95a59da1d60ba1b6044820152606401610b7c565b600083815260016020908152604080832033845290915290205460ff16156115d95760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e481d9bdd1959609a1b6044820152606401610b7c565b6000838152600160208181526040808420338552909152909120805460ff1916909117905560ff821661165f5761160f81612852565b600084815260026020526040812080549091906116369084906001600160801b031661398d565b92506101000a8154816001600160801b0302191690836001600160801b03160217905550505050565b60001960ff8316016116a25761167481612852565b60008481526002602052604090208054601090611636908490600160801b90046001600160801b031661398d565b60011960ff8316016116e1576116b781612852565b600084815260026020526040812060010180549091906116369084906001600160801b031661398d565b60405162461bcd60e51b815260206004820152603860248201527f696e76616c696420737570706f72742076616c75652c206d75737420626520696044820152776e636c7564656420696e20566f74655479706520656e756d60401b6064820152608401610b7c565b61013554604051635bbb217760e01b81526060916001600160a01b031690635bbb21779061177c908590600401613729565b600060405180830381865afa158015611799573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109009190810190613aff565b610135546040516331a9108f60e11b8152600481018390526000916001600160a01b031690636352211e90602401610935565b60008051602061406583398151915261180c81611fe1565b610136805461ffff60a01b1916600160a01b61ffff8516908102919091179091556040519081527f4638b9d191c13f7c818328022e9a587f4050f58d4714724cc187da6307c8f51a90602001611114565b60008051602061406583398151915261187581611fe1565b61187f8383612926565b6040805161ffff85168152602081018490527f2350f7c37c954a84e89df0b239e6b79e60b0b0466691f95df03c1a7a6469de089101610d1b565b610135546040516370a0823160e01b81526000916001600160a01b0316906370a08231906118eb9085906004016132a2565b602060405180830381865afa158015611908573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090091906138a6565b610135546040516382d837a160e01b8152600481018390526000916001600160a01b0316906382d837a1906024016118eb565b61013554604051632118854760e21b81526060916001600160a01b031690638462151c906119919085906004016132a2565b600060405180830381865afa1580156119ae573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109009190810190613b8f565b6000918252609e602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61013554604051634cd12abd60e11b81526001600160a01b038581166004830152602482018590526044820184905260609216906399a2557a90606401600060405180830381865afa158015611a5b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611a839190810190613b8f565b949350505050565b611a93612071565b610135546000906001600160a01b0316636352211e85858481611ab857611ab8613c14565b905060200201356040518263ffffffff1660e01b8152600401611add91815260200190565b602060405180830381865afa158015611afa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1e9190613855565b905060008060005b85811015611bb657836001600160a01b0316611b59888884818110611b4d57611b4d613c14565b905060200201356120b9565b6001600160a01b031614611b805760405163ea65cfc760e01b815260040160405180910390fd5b600080611ba4898985818110611b9857611b98613c14565b9050602002013561217b565b95019493909301925050600101611b26565b50611bc383838387612339565b505050505050565b61013554604051635b34ce8760e11b8152600481018390526000916001600160a01b03169063b6699d0e906024016118eb565b60408051608081018252600080825260208201819052818301819052606082015261013554915163c23dc68f60e01b81526004810184905290916001600160a01b03169063c23dc68f90602401608060405180830381865afa158015611c68573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109009190613c2a565b600080516020614065833981519152611ca481611fe1565b603a5460ff1615611cb757610c58612965565b610c586129b1565b604080516080810182526000808252602082018190529181018290526060810191909152600082815261013860209081526040808320815160808101835281546001600160801b03808216808452600160801b92839004821696840196909652600190930154808416948301949094529092041660608201529103610900576101355460405163c850627760e01b8152600481018590526001600160a01b039091169063c850627790602401608060405180830381865afa158015611d88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b9190613c5d565b50919050565b6101355460405163c87b56dd60e01b8152600481018390526060916001600160a01b03169063c87b56dd90602401600060405180830381865afa158015611dfd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109009190810190613cbc565b611e2e82610aa2565b611e3781611fe1565b610ad3838361264c565b6000610900600583611ec6565b6101355460405163e985e9c560e01b81526001600160a01b0384811660048301528381166024830152600092169063e985e9c590604401602060405180830381865afa158015611ea2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b919061395c565b6000438210611f175760405162461bcd60e51b815260206004820181905260248201527f436865636b706f696e74733a20626c6f636b206e6f7420796574206d696e65646044820152606401610b7c565b6000611f22836129ee565b84549091506000816005811115611f80576000611f3e84612a53565b611f489085613d32565b60008981526020902090915081015463ffffffff9081169086161015611f7057809150611f7e565b611f7b816001613d45565b92505b505b6000611f8e88868585612b3b565b90508015611fc957611fb388611fa5600184613d32565b600091825260209091200190565b54600160201b90046001600160e01b0316611fcc565b60005b6001600160e01b031698975050505050505050565b610c588133612b99565b611ff582826119d6565b610b8f576000828152609e602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561202d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b603a5460ff16156120b75760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b7c565b565b610135546040516331a9108f60e11b8152600481018390526000916001600160a01b031690636352211e90602401602060405180830381865afa158015612104573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121289190613855565b90506001600160a01b03811633148015906121585750612156600080516020613fb2833981519152336119d6565b155b15612176576040516348f5c3ed60e01b815260040160405180910390fd5b919050565b60008181526101396020526040812054819060ff16156121ae57604051634bc54ec360e11b815260040160405180910390fd5b60006121b984612bf2565b805461013554604051635b34ce8760e11b815260048101889052929350600160801b9091046001600160801b0316916001600160a01b039091169063b6699d0e90602401602060405180830381865afa15801561221a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223e91906138a6565b6122489190613d32565b81546001600160801b03908116600160801b810280821785559295506122719286921617613d32565b61013654604051626fc27160e51b815260048101879052602481018390529193506001600160a01b031690630df84e2090604401600060405180830381600087803b1580156122bf57600080fd5b505af11580156122d3573d6000803e3d6000fd5b50505060008581526101396020908152604091829020805460ff1916600117905581518781529081018690529081018490527f5bd8c92d7587f9cf8e315fbc1bc708d32bb8c94c4d9dad1f6f6307ece02a1853915060600160405180910390a150915091565b61013454610135546040516370a0823160e01b81526000926001600160a01b03908116926370a082319261237392909116906004016132a2565b602060405180830381865afa158015612390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b491906138a6565b9050801561242257610135546040516338d322ef60e01b81526001600160a01b03909116906338d322ef906123ef9030908590600401613933565b600060405180830381600087803b15801561240957600080fd5b505af115801561241d573d6000803e3d6000fd5b505050505b6101365461ffff600160a01b9091048116908316036124b7576101345460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061246e9088908890600401613933565b6020604051808303816000875af115801561248d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124b1919061395c565b506125d1565b610134546001600160a01b039081169063695ef6bf903490309086908a16604080516060810182523381526000602082015261013780548d93830191906124fd90613872565b80601f016020809104026020016040519081016040528092919081815260200182805461252990613872565b80156125765780601f1061254b57610100808354040283529160200191612576565b820191906000526020600020905b81548152906001019060200180831161255957829003601f168201915b50505050508152506040518763ffffffff1660e01b815260040161259e959493929190613d58565b6000604051808303818588803b1580156125b757600080fd5b505af11580156125cb573d6000803e3d6000fd5b50505050505b610134546101365460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb92612609929116908790600401613933565b6020604051808303816000875af1158015612628573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bc3919061395c565b61265682826119d6565b15610b8f576000828152609e602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600080516020613ff2833981519152546001600160a01b031690565b600080516020614065833981519152610b8f81611fe1565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561271a57610ad383612c50565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612774575060408051601f3d908101601f19168201909252612771918101906138a6565b60015b6127d75760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610b7c565b600080516020613ff283398151915281146128465760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610b7c565b50610ad3838383612cea565b60006001600160801b038211156128bb5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610b7c565b5090565b60606040518060600160405280602c8152602001614012602c9139905090565b6001600160a01b03163b151590565b600054610100900460ff166129155760405162461bcd60e51b8152600401610b7c90613dbf565b61291e81612d15565b610c58612d5e565b6040516001600160f01b031960f084901b166020820152602281018290526042016040516020818303038152906040526101379081610ad39190613e50565b61296d612e30565b603a805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516129a791906132a2565b60405180910390a1565b6129b9612071565b603a805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861299a3390565b600063ffffffff8211156128bb5760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608401610b7c565b600081600003612a6557506000919050565b60006001612a7284612e79565b901c6001901b90506001818481612a8b57612a8b6139cb565b048201901c90506001818481612aa357612aa36139cb565b048201901c90506001818481612abb57612abb6139cb565b048201901c90506001818481612ad357612ad36139cb565b048201901c90506001818481612aeb57612aeb6139cb565b048201901c90506001818481612b0357612b036139cb565b048201901c90506001818481612b1b57612b1b6139cb565b048201901c9050610a9b81828581612b3557612b356139cb565b04612f0d565b60005b81831015612b91576000612b528484612f23565b60008781526020902090915063ffffffff86169082015463ffffffff161115612b7d57809250612b8b565b612b88816001613d45565b93505b50612b3e565b509392505050565b612ba382826119d6565b610b8f57612bb081612f3e565b612bbb836020612f50565b604051602001612bcc929190613f0f565b60408051601f198184030181529082905262461bcd60e51b8252610b7c91600401613306565b600080612bfe83611cbf565b600093845261013860209081526040948590208251918301516001600160801b03928316600160801b918416820217825595830151606090930151928216929091169094021760018401555090919050565b612c59816128df565b612cbb5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610b7c565b600080516020613ff283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612cf3836130eb565b600082511180612d005750805b15610ad357612d0f838361312b565b50505050565b600054610100900460ff16612d3c5760405162461bcd60e51b8152600401610b7c90613dbf565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600360009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015612db3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dd79190613855565b6001600160a01b0316635c19a95c306040518263ffffffff1660e01b8152600401612e0291906132a2565b600060405180830381600087803b158015612e1c57600080fd5b505af1158015612d0f573d6000803e3d6000fd5b603a5460ff166120b75760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b7c565b600080608083901c15612e8e57608092831c92015b604083901c15612ea057604092831c92015b602083901c15612eb257602092831c92015b601083901c15612ec457601092831c92015b600883901c15612ed657600892831c92015b600483901c15612ee857600492831c92015b600283901c15612efa57600292831c92015b600183901c156109005760010192915050565b6000818310612f1c5781610a9b565b5090919050565b6000612f3260028484186139e1565b610a9b90848416613d45565b60606109006001600160a01b03831660145b60606000612f5f8360026139b4565b612f6a906002613d45565b6001600160401b03811115612f8157612f81613407565b6040519080825280601f01601f191660200182016040528015612fab576020820181803683370190505b509050600360fc1b81600081518110612fc657612fc6613c14565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612ff557612ff5613c14565b60200101906001600160f81b031916908160001a90535060006130198460026139b4565b613024906001613d45565b90505b600181111561309c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061305857613058613c14565b1a60f81b82828151811061306e5761306e613c14565b60200101906001600160f81b031916908160001a90535060049490941c9361309581613f7e565b9050613027565b508315610a9b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b7c565b6130f481612c50565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610a9b838360405180606001604052806027815260200161403e602791396060600080856001600160a01b0316856040516131689190613f95565b600060405180830381855af49150503d80600081146131a3576040519150601f19603f3d011682016040523d82523d6000602084013e6131a8565b606091505b50915091506131b9868383876131c3565b9695505050505050565b60608315613230578251600003613229576131dd856128df565b6132295760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b7c565b5081611a83565b611a8383838151156132455781518083602001fd5b8060405162461bcd60e51b8152600401610b7c9190613306565b60006020828403121561327157600080fd5b81356001600160e01b031981168114610a9b57600080fd5b60006020828403121561329b57600080fd5b5035919050565b6001600160a01b0391909116815260200190565b60005b838110156132d15781810151838201526020016132b9565b50506000910152565b600081518084526132f28160208601602086016132b6565b601f01601f19169290920160200192915050565b602081526000610a9b60208301846132da565b6001600160a01b0381168114610c5857600080fd5b60006020828403121561334057600080fd5b8135610a9b81613319565b6000806040838503121561335e57600080fd5b823561336981613319565b946020939093013593505050565b6000806040838503121561338a57600080fd5b82359150602083013561339c81613319565b809150509250929050565b803561ffff8116811461217657600080fd5b600080604083850312156133cc57600080fd5b823591506133dc602084016133a7565b90509250929050565b600080604083850312156133f857600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b038111828210171561343f5761343f613407565b60405290565b604051601f8201601f191681016001600160401b038111828210171561346d5761346d613407565b604052919050565b60006001600160401b0382111561348e5761348e613407565b50601f01601f191660200190565b600080604083850312156134af57600080fd5b82356134ba81613319565b915060208301356001600160401b038111156134d557600080fd5b8301601f810185136134e657600080fd5b80356134f96134f482613475565b613445565b81815286602083850101111561350e57600080fd5b816020840160208301376000602083830101528093505050509250929050565b6000806000806080858703121561354457600080fd5b843561354f81613319565b9350602085013561355f81613319565b9250604085013561356f81613319565b9150606085013561357f81613319565b939692955090935050565b6000806040838503121561359d57600080fd5b82359150602083013560ff8116811461339c57600080fd5b60006001600160401b038211156135ce576135ce613407565b5060051b60200190565b600060208083850312156135eb57600080fd5b82356001600160401b0381111561360157600080fd5b8301601f8101851361361257600080fd5b80356136206134f4826135b5565b81815260059190911b8201830190838101908783111561363f57600080fd5b928401925b8284101561365d57833582529284019290840190613644565b979650505050505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b818110156136e6576136d3838551613668565b92840192608092909201916001016136c0565b50909695505050505050565b60006020828403121561370457600080fd5b610a9b826133a7565b6000806040838503121561372057600080fd5b613369836133a7565b6020808252825182820181905260009190848201906040850190845b818110156136e657835183529284019291840191600101613745565b60008060006060848603121561377657600080fd5b833561378181613319565b95602085013595506040909401359392505050565b6000806000604084860312156137ab57600080fd5b83356001600160401b03808211156137c257600080fd5b818601915086601f8301126137d657600080fd5b8135818111156137e557600080fd5b8760208260051b85010111156137fa57600080fd5b60209283019550935061381091860190506133a7565b90509250925092565b608081016109008284613668565b6000806040838503121561383a57600080fd5b823561384581613319565b9150602083013561339c81613319565b60006020828403121561386757600080fd5b8151610a9b81613319565b600181811c9082168061388657607f821691505b602082108103611dac57634e487b7160e01b600052602260045260246000fd5b6000602082840312156138b857600080fd5b5051919050565b6020808252602c90820152600080516020613fd283398151915260408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c90820152600080516020613fd283398151915260408201526b6163746976652070726f787960a01b606082015260800190565b6001600160a01b03929092168252602082015260400190565b8051801515811461217657600080fd5b60006020828403121561396e57600080fd5b610a9b8261394c565b634e487b7160e01b600052601160045260246000fd5b6001600160801b038181168382160190808211156139ad576139ad613977565b5092915050565b808202811582820484141761090057610900613977565b634e487b7160e01b600052601260045260246000fd5b6000826139fe57634e487b7160e01b600052601260045260246000fd5b500490565b84815260ff84166020820152608060408201526000613a2560808301856132da565b828103606084015261365d81856132da565b600060408284031215613a4957600080fd5b604080519081016001600160401b0381118282101715613a6b57613a6b613407565b604052825181526020928301519281019290925250919050565b600060808284031215613a9757600080fd5b613a9f61341d565b90508151613aac81613319565b815260208201516001600160401b0381168114613ac857600080fd5b6020820152613ad96040830161394c565b6040820152606082015162ffffff81168114613af457600080fd5b606082015292915050565b60006020808385031215613b1257600080fd5b82516001600160401b03811115613b2857600080fd5b8301601f81018513613b3957600080fd5b8051613b476134f4826135b5565b81815260079190911b82018301908381019087831115613b6657600080fd5b928401925b8284101561365d57613b7d8885613a85565b82528482019150608084019350613b6b565b60006020808385031215613ba257600080fd5b82516001600160401b03811115613bb857600080fd5b8301601f81018513613bc957600080fd5b8051613bd76134f4826135b5565b81815260059190911b82018301908381019087831115613bf657600080fd5b928401925b8284101561365d57835182529284019290840190613bfb565b634e487b7160e01b600052603260045260246000fd5b600060808284031215613c3c57600080fd5b610a9b8383613a85565b80516001600160801b038116811461217657600080fd5b600060808284031215613c6f57600080fd5b613c7761341d565b613c8083613c46565b8152613c8e60208401613c46565b6020820152613c9f60408401613c46565b6040820152613cb060608401613c46565b60608201529392505050565b600060208284031215613cce57600080fd5b81516001600160401b03811115613ce457600080fd5b8201601f81018413613cf557600080fd5b8051613d036134f482613475565b818152856020838501011115613d1857600080fd5b613d298260208301602086016132b6565b95945050505050565b8181038181111561090057610900613977565b8082018082111561090057610900613977565b600060018060a01b03808816835261ffff8716602084015285604084015284606084015260a060808401528084511660a08401528060208501511660c0840152506040830151606060e0840152613db36101008401826132da565b98975050505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b601f821115610ad357600081815260208120601f850160051c81016020861015613e315750805b601f850160051c820191505b81811015611bc357828155600101613e3d565b81516001600160401b03811115613e6957613e69613407565b613e7d81613e778454613872565b84613e0a565b602080601f831160018114613eb25760008415613e9a5750858301515b600019600386901b1c1916600185901b178555611bc3565b600085815260208120601f198616915b82811015613ee157888601518255948401946001909101908401613ec2565b5085821015613eff5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351613f418160178501602088016132b6565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613f728160288401602088016132b6565b01602801949350505050565b600081613f8d57613f8d613977565b506000190190565b60008251613fa78184602087016132b6565b919091019291505056fee2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc446756e6374696f6e206d7573742062652063616c6c6564207468726f75676820360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc726f6c6c65642d757020766f74652066726f6d20676f7665726e616e636520746f6b656e20686f6c64657273416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a26469706673582212205e9708da92b87328f508ab50aec04b57ebe9e7499bd6f24964f0a481c97dc91564736f6c63430008130033
6080604052600436106102185760003560e01c806301ffc9a71461021d578063081812fc14610252578063083118d51461027f57806312064c34146102a157806314d140b0146102dc57806318160ddd146102fd5780631b13ee8a14610312578063248a9ca3146103325780632f2ff15d14610352578063318cd6731461037457806336568abe146103875780633659cfe6146103a757806338d322ef146103c75780633eb76b9c146103e7578063410a1db11461040757806349dcc204146104275780634f1ef286146104625780635142d5e31461047557806352d1902d1461049557806352e62a43146104aa578063544ffc9c146104ca5780635bbb21771461053f5780635c975abb1461056c5780636352211e146105845780636927850a146105a4578063696c81bb146105ba5780636d1daa28146105da5780636dc0ae22146105fa57806370a082311461061a57806375b238fc1461063a5780637a26db171461065c5780637f66dea11461069257806382d837a1146106b35780638462151c146106d357806391d1485414610700578063926d7d7f1461072057806399a2557a14610742578063a217fddf14610762578063b09de27814610777578063b6699d0e1461078a578063c23dc68f146107aa578063c4ae3168146107d7578063c8506277146107ec578063c87b56dd1461084f578063d547741f1461086f578063db7817f91461088f578063e985e9c5146108af575b600080fd5b34801561022957600080fd5b5061023d61023836600461325f565b6108cf565b60405190151581526020015b60405180910390f35b34801561025e57600080fd5b5061027261026d366004613289565b610906565b60405161024991906132a2565b34801561028b57600080fd5b50610294610976565b6040516102499190613306565b3480156102ad57600080fd5b506102ce6102bc36600461332e565b60066020526000908152604090205481565b604051908152602001610249565b3480156102e857600080fd5b5061013654610272906001600160a01b031681565b34801561030957600080fd5b506102ce610a05565b34801561031e57600080fd5b506102ce61032d36600461334b565b610a79565b34801561033e57600080fd5b506102ce61034d366004613289565b610aa2565b34801561035e57600080fd5b5061037261036d366004613377565b610ab7565b005b6103726103823660046133b9565b610ad8565b34801561039357600080fd5b506103726103a2366004613377565b610b10565b3480156103b357600080fd5b506103726103c236600461332e565b610b93565b3480156103d357600080fd5b506103726103e236600461334b565b610c5b565b3480156103f357600080fd5b50610372610402366004613289565b610d28565b34801561041357600080fd5b5061037261042236600461332e565b611089565b34801561043357600080fd5b506104476104423660046133e5565b611120565b60408051825181526020928301519281019290925201610249565b61037261047036600461349c565b6111a6565b34801561048157600080fd5b5061037261049036600461352e565b61125b565b3480156104a157600080fd5b506102ce61141f565b3480156104b657600080fd5b506103726104c536600461358a565b6114cd565b3480156104d657600080fd5b506105156104e5366004613289565b600260205260009081526040902080546001909101546001600160801b0380831692600160801b90048116911683565b604080516001600160801b0394851681529284166020840152921691810191909152606001610249565b34801561054b57600080fd5b5061055f61055a3660046135d8565b61174a565b60405161024991906136a4565b34801561057857600080fd5b50603a5460ff1661023d565b34801561059057600080fd5b5061027261059f366004613289565b6117c1565b3480156105b057600080fd5b506102ce60075481565b3480156105c657600080fd5b506103726105d53660046136f2565b6117f4565b3480156105e657600080fd5b506103726105f536600461370d565b61185d565b34801561060657600080fd5b50600354610272906001600160a01b031681565b34801561062657600080fd5b506102ce61063536600461332e565b6118b9565b34801561064657600080fd5b506102ce60008051602061406583398151915281565b34801561066857600080fd5b506101365461067f90600160a01b900461ffff1681565b60405161ffff9091168152602001610249565b34801561069e57600080fd5b5061013454610272906001600160a01b031681565b3480156106bf57600080fd5b506102ce6106ce366004613289565b61192c565b3480156106df57600080fd5b506106f36106ee36600461332e565b61195f565b6040516102499190613729565b34801561070c57600080fd5b5061023d61071b366004613377565b6119d6565b34801561072c57600080fd5b506102ce600080516020613fb283398151915281565b34801561074e57600080fd5b506106f361075d366004613761565b611a01565b34801561076e57600080fd5b506102ce600081565b610372610785366004613796565b611a8b565b34801561079657600080fd5b506102ce6107a5366004613289565b611bcb565b3480156107b657600080fd5b506107ca6107c5366004613289565b611bfe565b6040516102499190613819565b3480156107e357600080fd5b50610372611c8c565b3480156107f857600080fd5b5061080c610807366004613289565b611cbf565b604051610249919081516001600160801b039081168252602080840151821690830152604080840151821690830152606092830151169181019190915260800190565b34801561085b57600080fd5b5061029461086a366004613289565b611db2565b34801561087b57600080fd5b5061037261088a366004613377565b611e25565b34801561089b57600080fd5b506102ce6108aa366004613289565b611e41565b3480156108bb57600080fd5b5061023d6108ca366004613827565b611e4e565b60006001600160e01b03198216637965db0b60e01b148061090057506301ffc9a760e01b6001600160e01b03198316145b92915050565b6101355460405163020604bf60e21b8152600481018390526000916001600160a01b03169063081812fc906024015b602060405180830381865afa158015610952573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109009190613855565b610137805461098490613872565b80601f01602080910402602001604051908101604052809291908181526020018280546109b090613872565b80156109fd5780601f106109d2576101008083540402835291602001916109fd565b820191906000526020600020905b8154815290600101906020018083116109e057829003601f168201915b505050505081565b61013554604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015610a50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7491906138a6565b905090565b6001600160a01b0382166000908152600460205260408120610a9b9083611ec6565b9392505050565b6000908152609e602052604090206001015490565b610ac082610aa2565b610ac981611fe1565b610ad38383611feb565b505050565b610ae0612071565b6000610aeb836120b9565b9050600080610af98561217b565b91509150610b0983838387612339565b5050505050565b6001600160a01b0381163314610b855760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610b8f828261264c565b5050565b6001600160a01b037f00000000000000000000000064c9441537425a01d7ea1e6590be1fefd5985bf2163003610bdb5760405162461bcd60e51b8152600401610b7c906138bf565b7f00000000000000000000000064c9441537425a01d7ea1e6590be1fefd5985bf26001600160a01b0316610c0d6126b3565b6001600160a01b031614610c335760405162461bcd60e51b8152600401610b7c906138f9565b610c3c816126cf565b60408051600080825260208201909252610c58918391906126e7565b50565b600080516020614065833981519152610c7381611fe1565b6101345460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb90610ca69086908690600401613933565b6020604051808303816000875af1158015610cc5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce9919061395c565b507f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d58383604051610d1b929190613933565b60405180910390a1505050565b6000818152600260205260408120600181015481549192916001600160801b0391821691610d629180821691600160801b9091041661398d565b610d6c919061398d565b6001600160801b031611610db75760405162461bcd60e51b81526020600482015260126024820152711b9bc81d9bdd195cc8195e1c1c995cdcd95960721b6044820152606401610b7c565b600354604051632d63f69360e01b8152600481018490526000916001600160a01b031690632d63f69390602401602060405180830381865afa158015610e01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2591906138a6565b90506000610e3282611e41565b90506000600360009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610e8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eaf9190613855565b6001600160a01b0316633a46b1a830856040518363ffffffff1660e01b8152600401610edc929190613933565b602060405180830381865afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d91906138a6565b8454909150600090610f54908490610f4590600160801b90046001600160801b0316856139b4565b610f4f91906139e1565b612852565b8554909150600090610f75908590610f45906001600160801b0316866139b4565b6001870154909150600090610f99908690610f45906001600160801b0316876139b4565b600089815260026020818152604080842084815560010180546001600160801b03199081169091558151608089811b83169482019490945289841b821660308201529286901b16908201529293509160500160408051601f198184030181529190526003549091506001600160a01b0316635f398a148b846110196128bf565b856040518563ffffffff1660e01b81526004016110399493929190613a03565b6020604051808303816000875af1158015611058573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107c91906138a6565b5050505050505050505050565b6000805160206140658339815191526110a181611fe1565b6001600160a01b0382166110c85760405163d92e233d60e01b815260040160405180910390fd5b61013680546001600160a01b0319166001600160a01b0384161790556040517f1defc7e59eeac6c8cb243873ba35cd0ac8c57fe81e330b6ab84c23c63c1f007d906111149084906132a2565b60405180910390a15050565b60408051808201825260008082526020820152610135549151631277308160e21b8152600481018590526024810184905290916001600160a01b0316906349dcc204906044016040805180830381865afa158015611182573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b9190613a37565b6001600160a01b037f00000000000000000000000064c9441537425a01d7ea1e6590be1fefd5985bf21630036111ee5760405162461bcd60e51b8152600401610b7c906138bf565b7f00000000000000000000000064c9441537425a01d7ea1e6590be1fefd5985bf26001600160a01b03166112206126b3565b6001600160a01b0316146112465760405162461bcd60e51b8152600401610b7c906138f9565b61124f826126cf565b610b8f828260016126e7565b600054610100900460ff161580801561127b5750600054600160ff909116105b8061129c575061128a306128df565b15801561129c575060005460ff166001145b6112ff5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610b7c565b6000805460ff191660011790558015611322576000805461ff0019166101001790555b61133f7312163980a1ec6f5c955a19793914192d01c872686128ee565b61013580546001600160a01b0319166001600160a01b0387161790556113696001621e8480612926565b610136805461ffff60a01b191660af60a01b179055611389600085611feb565b6113a160008051602061406583398151915285611feb565b61013680546001600160a01b038086166001600160a01b0319928316179092556101348054928516929091169190911790558015610b09576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b6000306001600160a01b037f00000000000000000000000064c9441537425a01d7ea1e6590be1fefd5985bf216146114ba5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608401610b7c565b50600080516020613ff283398151915290565b600354604051632d63f69360e01b8152600481018490526000916115419133916001600160a01b031690632d63f69390602401602060405180830381865afa15801561151d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032d91906138a6565b90506000811161157f5760405162461bcd60e51b81526020600482015260096024820152681b9bc81dd95a59da1d60ba1b6044820152606401610b7c565b600083815260016020908152604080832033845290915290205460ff16156115d95760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e481d9bdd1959609a1b6044820152606401610b7c565b6000838152600160208181526040808420338552909152909120805460ff1916909117905560ff821661165f5761160f81612852565b600084815260026020526040812080549091906116369084906001600160801b031661398d565b92506101000a8154816001600160801b0302191690836001600160801b03160217905550505050565b60001960ff8316016116a25761167481612852565b60008481526002602052604090208054601090611636908490600160801b90046001600160801b031661398d565b60011960ff8316016116e1576116b781612852565b600084815260026020526040812060010180549091906116369084906001600160801b031661398d565b60405162461bcd60e51b815260206004820152603860248201527f696e76616c696420737570706f72742076616c75652c206d75737420626520696044820152776e636c7564656420696e20566f74655479706520656e756d60401b6064820152608401610b7c565b61013554604051635bbb217760e01b81526060916001600160a01b031690635bbb21779061177c908590600401613729565b600060405180830381865afa158015611799573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109009190810190613aff565b610135546040516331a9108f60e11b8152600481018390526000916001600160a01b031690636352211e90602401610935565b60008051602061406583398151915261180c81611fe1565b610136805461ffff60a01b1916600160a01b61ffff8516908102919091179091556040519081527f4638b9d191c13f7c818328022e9a587f4050f58d4714724cc187da6307c8f51a90602001611114565b60008051602061406583398151915261187581611fe1565b61187f8383612926565b6040805161ffff85168152602081018490527f2350f7c37c954a84e89df0b239e6b79e60b0b0466691f95df03c1a7a6469de089101610d1b565b610135546040516370a0823160e01b81526000916001600160a01b0316906370a08231906118eb9085906004016132a2565b602060405180830381865afa158015611908573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090091906138a6565b610135546040516382d837a160e01b8152600481018390526000916001600160a01b0316906382d837a1906024016118eb565b61013554604051632118854760e21b81526060916001600160a01b031690638462151c906119919085906004016132a2565b600060405180830381865afa1580156119ae573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109009190810190613b8f565b6000918252609e602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61013554604051634cd12abd60e11b81526001600160a01b038581166004830152602482018590526044820184905260609216906399a2557a90606401600060405180830381865afa158015611a5b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611a839190810190613b8f565b949350505050565b611a93612071565b610135546000906001600160a01b0316636352211e85858481611ab857611ab8613c14565b905060200201356040518263ffffffff1660e01b8152600401611add91815260200190565b602060405180830381865afa158015611afa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1e9190613855565b905060008060005b85811015611bb657836001600160a01b0316611b59888884818110611b4d57611b4d613c14565b905060200201356120b9565b6001600160a01b031614611b805760405163ea65cfc760e01b815260040160405180910390fd5b600080611ba4898985818110611b9857611b98613c14565b9050602002013561217b565b95019493909301925050600101611b26565b50611bc383838387612339565b505050505050565b61013554604051635b34ce8760e11b8152600481018390526000916001600160a01b03169063b6699d0e906024016118eb565b60408051608081018252600080825260208201819052818301819052606082015261013554915163c23dc68f60e01b81526004810184905290916001600160a01b03169063c23dc68f90602401608060405180830381865afa158015611c68573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109009190613c2a565b600080516020614065833981519152611ca481611fe1565b603a5460ff1615611cb757610c58612965565b610c586129b1565b604080516080810182526000808252602082018190529181018290526060810191909152600082815261013860209081526040808320815160808101835281546001600160801b03808216808452600160801b92839004821696840196909652600190930154808416948301949094529092041660608201529103610900576101355460405163c850627760e01b8152600481018590526001600160a01b039091169063c850627790602401608060405180830381865afa158015611d88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b9190613c5d565b50919050565b6101355460405163c87b56dd60e01b8152600481018390526060916001600160a01b03169063c87b56dd90602401600060405180830381865afa158015611dfd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109009190810190613cbc565b611e2e82610aa2565b611e3781611fe1565b610ad3838361264c565b6000610900600583611ec6565b6101355460405163e985e9c560e01b81526001600160a01b0384811660048301528381166024830152600092169063e985e9c590604401602060405180830381865afa158015611ea2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b919061395c565b6000438210611f175760405162461bcd60e51b815260206004820181905260248201527f436865636b706f696e74733a20626c6f636b206e6f7420796574206d696e65646044820152606401610b7c565b6000611f22836129ee565b84549091506000816005811115611f80576000611f3e84612a53565b611f489085613d32565b60008981526020902090915081015463ffffffff9081169086161015611f7057809150611f7e565b611f7b816001613d45565b92505b505b6000611f8e88868585612b3b565b90508015611fc957611fb388611fa5600184613d32565b600091825260209091200190565b54600160201b90046001600160e01b0316611fcc565b60005b6001600160e01b031698975050505050505050565b610c588133612b99565b611ff582826119d6565b610b8f576000828152609e602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561202d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b603a5460ff16156120b75760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b7c565b565b610135546040516331a9108f60e11b8152600481018390526000916001600160a01b031690636352211e90602401602060405180830381865afa158015612104573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121289190613855565b90506001600160a01b03811633148015906121585750612156600080516020613fb2833981519152336119d6565b155b15612176576040516348f5c3ed60e01b815260040160405180910390fd5b919050565b60008181526101396020526040812054819060ff16156121ae57604051634bc54ec360e11b815260040160405180910390fd5b60006121b984612bf2565b805461013554604051635b34ce8760e11b815260048101889052929350600160801b9091046001600160801b0316916001600160a01b039091169063b6699d0e90602401602060405180830381865afa15801561221a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223e91906138a6565b6122489190613d32565b81546001600160801b03908116600160801b810280821785559295506122719286921617613d32565b61013654604051626fc27160e51b815260048101879052602481018390529193506001600160a01b031690630df84e2090604401600060405180830381600087803b1580156122bf57600080fd5b505af11580156122d3573d6000803e3d6000fd5b50505060008581526101396020908152604091829020805460ff1916600117905581518781529081018690529081018490527f5bd8c92d7587f9cf8e315fbc1bc708d32bb8c94c4d9dad1f6f6307ece02a1853915060600160405180910390a150915091565b61013454610135546040516370a0823160e01b81526000926001600160a01b03908116926370a082319261237392909116906004016132a2565b602060405180830381865afa158015612390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b491906138a6565b9050801561242257610135546040516338d322ef60e01b81526001600160a01b03909116906338d322ef906123ef9030908590600401613933565b600060405180830381600087803b15801561240957600080fd5b505af115801561241d573d6000803e3d6000fd5b505050505b6101365461ffff600160a01b9091048116908316036124b7576101345460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061246e9088908890600401613933565b6020604051808303816000875af115801561248d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124b1919061395c565b506125d1565b610134546001600160a01b039081169063695ef6bf903490309086908a16604080516060810182523381526000602082015261013780548d93830191906124fd90613872565b80601f016020809104026020016040519081016040528092919081815260200182805461252990613872565b80156125765780601f1061254b57610100808354040283529160200191612576565b820191906000526020600020905b81548152906001019060200180831161255957829003601f168201915b50505050508152506040518763ffffffff1660e01b815260040161259e959493929190613d58565b6000604051808303818588803b1580156125b757600080fd5b505af11580156125cb573d6000803e3d6000fd5b50505050505b610134546101365460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb92612609929116908790600401613933565b6020604051808303816000875af1158015612628573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bc3919061395c565b61265682826119d6565b15610b8f576000828152609e602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600080516020613ff2833981519152546001600160a01b031690565b600080516020614065833981519152610b8f81611fe1565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561271a57610ad383612c50565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612774575060408051601f3d908101601f19168201909252612771918101906138a6565b60015b6127d75760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610b7c565b600080516020613ff283398151915281146128465760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610b7c565b50610ad3838383612cea565b60006001600160801b038211156128bb5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610b7c565b5090565b60606040518060600160405280602c8152602001614012602c9139905090565b6001600160a01b03163b151590565b600054610100900460ff166129155760405162461bcd60e51b8152600401610b7c90613dbf565b61291e81612d15565b610c58612d5e565b6040516001600160f01b031960f084901b166020820152602281018290526042016040516020818303038152906040526101379081610ad39190613e50565b61296d612e30565b603a805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516129a791906132a2565b60405180910390a1565b6129b9612071565b603a805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861299a3390565b600063ffffffff8211156128bb5760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608401610b7c565b600081600003612a6557506000919050565b60006001612a7284612e79565b901c6001901b90506001818481612a8b57612a8b6139cb565b048201901c90506001818481612aa357612aa36139cb565b048201901c90506001818481612abb57612abb6139cb565b048201901c90506001818481612ad357612ad36139cb565b048201901c90506001818481612aeb57612aeb6139cb565b048201901c90506001818481612b0357612b036139cb565b048201901c90506001818481612b1b57612b1b6139cb565b048201901c9050610a9b81828581612b3557612b356139cb565b04612f0d565b60005b81831015612b91576000612b528484612f23565b60008781526020902090915063ffffffff86169082015463ffffffff161115612b7d57809250612b8b565b612b88816001613d45565b93505b50612b3e565b509392505050565b612ba382826119d6565b610b8f57612bb081612f3e565b612bbb836020612f50565b604051602001612bcc929190613f0f565b60408051601f198184030181529082905262461bcd60e51b8252610b7c91600401613306565b600080612bfe83611cbf565b600093845261013860209081526040948590208251918301516001600160801b03928316600160801b918416820217825595830151606090930151928216929091169094021760018401555090919050565b612c59816128df565b612cbb5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610b7c565b600080516020613ff283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612cf3836130eb565b600082511180612d005750805b15610ad357612d0f838361312b565b50505050565b600054610100900460ff16612d3c5760405162461bcd60e51b8152600401610b7c90613dbf565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600360009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015612db3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dd79190613855565b6001600160a01b0316635c19a95c306040518263ffffffff1660e01b8152600401612e0291906132a2565b600060405180830381600087803b158015612e1c57600080fd5b505af1158015612d0f573d6000803e3d6000fd5b603a5460ff166120b75760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b7c565b600080608083901c15612e8e57608092831c92015b604083901c15612ea057604092831c92015b602083901c15612eb257602092831c92015b601083901c15612ec457601092831c92015b600883901c15612ed657600892831c92015b600483901c15612ee857600492831c92015b600283901c15612efa57600292831c92015b600183901c156109005760010192915050565b6000818310612f1c5781610a9b565b5090919050565b6000612f3260028484186139e1565b610a9b90848416613d45565b60606109006001600160a01b03831660145b60606000612f5f8360026139b4565b612f6a906002613d45565b6001600160401b03811115612f8157612f81613407565b6040519080825280601f01601f191660200182016040528015612fab576020820181803683370190505b509050600360fc1b81600081518110612fc657612fc6613c14565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612ff557612ff5613c14565b60200101906001600160f81b031916908160001a90535060006130198460026139b4565b613024906001613d45565b90505b600181111561309c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061305857613058613c14565b1a60f81b82828151811061306e5761306e613c14565b60200101906001600160f81b031916908160001a90535060049490941c9361309581613f7e565b9050613027565b508315610a9b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b7c565b6130f481612c50565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610a9b838360405180606001604052806027815260200161403e602791396060600080856001600160a01b0316856040516131689190613f95565b600060405180830381855af49150503d80600081146131a3576040519150601f19603f3d011682016040523d82523d6000602084013e6131a8565b606091505b50915091506131b9868383876131c3565b9695505050505050565b60608315613230578251600003613229576131dd856128df565b6132295760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b7c565b5081611a83565b611a8383838151156132455781518083602001fd5b8060405162461bcd60e51b8152600401610b7c9190613306565b60006020828403121561327157600080fd5b81356001600160e01b031981168114610a9b57600080fd5b60006020828403121561329b57600080fd5b5035919050565b6001600160a01b0391909116815260200190565b60005b838110156132d15781810151838201526020016132b9565b50506000910152565b600081518084526132f28160208601602086016132b6565b601f01601f19169290920160200192915050565b602081526000610a9b60208301846132da565b6001600160a01b0381168114610c5857600080fd5b60006020828403121561334057600080fd5b8135610a9b81613319565b6000806040838503121561335e57600080fd5b823561336981613319565b946020939093013593505050565b6000806040838503121561338a57600080fd5b82359150602083013561339c81613319565b809150509250929050565b803561ffff8116811461217657600080fd5b600080604083850312156133cc57600080fd5b823591506133dc602084016133a7565b90509250929050565b600080604083850312156133f857600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b038111828210171561343f5761343f613407565b60405290565b604051601f8201601f191681016001600160401b038111828210171561346d5761346d613407565b604052919050565b60006001600160401b0382111561348e5761348e613407565b50601f01601f191660200190565b600080604083850312156134af57600080fd5b82356134ba81613319565b915060208301356001600160401b038111156134d557600080fd5b8301601f810185136134e657600080fd5b80356134f96134f482613475565b613445565b81815286602083850101111561350e57600080fd5b816020840160208301376000602083830101528093505050509250929050565b6000806000806080858703121561354457600080fd5b843561354f81613319565b9350602085013561355f81613319565b9250604085013561356f81613319565b9150606085013561357f81613319565b939692955090935050565b6000806040838503121561359d57600080fd5b82359150602083013560ff8116811461339c57600080fd5b60006001600160401b038211156135ce576135ce613407565b5060051b60200190565b600060208083850312156135eb57600080fd5b82356001600160401b0381111561360157600080fd5b8301601f8101851361361257600080fd5b80356136206134f4826135b5565b81815260059190911b8201830190838101908783111561363f57600080fd5b928401925b8284101561365d57833582529284019290840190613644565b979650505050505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b818110156136e6576136d3838551613668565b92840192608092909201916001016136c0565b50909695505050505050565b60006020828403121561370457600080fd5b610a9b826133a7565b6000806040838503121561372057600080fd5b613369836133a7565b6020808252825182820181905260009190848201906040850190845b818110156136e657835183529284019291840191600101613745565b60008060006060848603121561377657600080fd5b833561378181613319565b95602085013595506040909401359392505050565b6000806000604084860312156137ab57600080fd5b83356001600160401b03808211156137c257600080fd5b818601915086601f8301126137d657600080fd5b8135818111156137e557600080fd5b8760208260051b85010111156137fa57600080fd5b60209283019550935061381091860190506133a7565b90509250925092565b608081016109008284613668565b6000806040838503121561383a57600080fd5b823561384581613319565b9150602083013561339c81613319565b60006020828403121561386757600080fd5b8151610a9b81613319565b600181811c9082168061388657607f821691505b602082108103611dac57634e487b7160e01b600052602260045260246000fd5b6000602082840312156138b857600080fd5b5051919050565b6020808252602c90820152600080516020613fd283398151915260408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c90820152600080516020613fd283398151915260408201526b6163746976652070726f787960a01b606082015260800190565b6001600160a01b03929092168252602082015260400190565b8051801515811461217657600080fd5b60006020828403121561396e57600080fd5b610a9b8261394c565b634e487b7160e01b600052601160045260246000fd5b6001600160801b038181168382160190808211156139ad576139ad613977565b5092915050565b808202811582820484141761090057610900613977565b634e487b7160e01b600052601260045260246000fd5b6000826139fe57634e487b7160e01b600052601260045260246000fd5b500490565b84815260ff84166020820152608060408201526000613a2560808301856132da565b828103606084015261365d81856132da565b600060408284031215613a4957600080fd5b604080519081016001600160401b0381118282101715613a6b57613a6b613407565b604052825181526020928301519281019290925250919050565b600060808284031215613a9757600080fd5b613a9f61341d565b90508151613aac81613319565b815260208201516001600160401b0381168114613ac857600080fd5b6020820152613ad96040830161394c565b6040820152606082015162ffffff81168114613af457600080fd5b606082015292915050565b60006020808385031215613b1257600080fd5b82516001600160401b03811115613b2857600080fd5b8301601f81018513613b3957600080fd5b8051613b476134f4826135b5565b81815260079190911b82018301908381019087831115613b6657600080fd5b928401925b8284101561365d57613b7d8885613a85565b82528482019150608084019350613b6b565b60006020808385031215613ba257600080fd5b82516001600160401b03811115613bb857600080fd5b8301601f81018513613bc957600080fd5b8051613bd76134f4826135b5565b81815260059190911b82018301908381019087831115613bf657600080fd5b928401925b8284101561365d57835182529284019290840190613bfb565b634e487b7160e01b600052603260045260246000fd5b600060808284031215613c3c57600080fd5b610a9b8383613a85565b80516001600160801b038116811461217657600080fd5b600060808284031215613c6f57600080fd5b613c7761341d565b613c8083613c46565b8152613c8e60208401613c46565b6020820152613c9f60408401613c46565b6040820152613cb060608401613c46565b60608201529392505050565b600060208284031215613cce57600080fd5b81516001600160401b03811115613ce457600080fd5b8201601f81018413613cf557600080fd5b8051613d036134f482613475565b818152856020838501011115613d1857600080fd5b613d298260208301602086016132b6565b95945050505050565b8181038181111561090057610900613977565b8082018082111561090057610900613977565b600060018060a01b03808816835261ffff8716602084015285604084015284606084015260a060808401528084511660a08401528060208501511660c0840152506040830151606060e0840152613db36101008401826132da565b98975050505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b601f821115610ad357600081815260208120601f850160051c81016020861015613e315750805b601f850160051c820191505b81811015611bc357828155600101613e3d565b81516001600160401b03811115613e6957613e69613407565b613e7d81613e778454613872565b84613e0a565b602080601f831160018114613eb25760008415613e9a5750858301515b600019600386901b1c1916600185901b178555611bc3565b600085815260208120601f198616915b82811015613ee157888601518255948401946001909101908401613ec2565b5085821015613eff5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351613f418160178501602088016132b6565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613f728160288401602088016132b6565b01602801949350505050565b600081613f8d57613f8d613977565b506000190190565b60008251613fa78184602087016132b6565b919091019291505056fee2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc446756e6374696f6e206d7573742062652063616c6c6564207468726f75676820360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc726f6c6c65642d757020766f74652066726f6d20676f7665726e616e636520746f6b656e20686f6c64657273416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a26469706673582212205e9708da92b87328f508ab50aec04b57ebe9e7499bd6f24964f0a481c97dc91564736f6c63430008130033
1
20,291,130
35c8d44692ea939f65b374d467d9061dd99188fd7afea83a78187d1d29285ef7
f923c5d3317b0d936723d5ba46f55fc6c9db180231605435ee2d738fcced019e
a0069523092d67f78c2ae0d2f3db1dfb39b5b937
a0069523092d67f78c2ae0d2f3db1dfb39b5b937
8de8c83352ea9309e98b87055d6dc89cf510b3df
608060405234801561000f575f80fd5b506040518060400160405280600c81526020016b26b7bab73a30b4b71024191960a11b8152506040518060400160405280600381526020016224191960e91b815250816003908161006091906102a4565b50600461006d82826102a4565b50505061009f336100826100a460201b60201c565b61008d90600a610457565b61009a90620f424061046c565b6100a9565b610496565b601290565b6001600160a01b0382166100d75760405163ec442f0560e01b81525f60048201526024015b60405180910390fd5b6100e25f83836100e6565b5050565b6001600160a01b038316610110578060025f8282546101059190610483565b909155506101809050565b6001600160a01b0383165f90815260208190526040902054818110156101625760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016100ce565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b03821661019c576002805482900390556101ba565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516101ff91815260200190565b60405180910390a3505050565b634e487b7160e01b5f52604160045260245ffd5b600181811c9082168061023457607f821691505b60208210810361025257634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561029f57805f5260205f20601f840160051c8101602085101561027d5750805b601f840160051c820191505b8181101561029c575f8155600101610289565b50505b505050565b81516001600160401b038111156102bd576102bd61020c565b6102d1816102cb8454610220565b84610258565b6020601f821160018114610303575f83156102ec5750848201515b5f19600385901b1c1916600184901b17845561029c565b5f84815260208120601f198516915b828110156103325787850151825560209485019460019092019101610312565b508482101561034f57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b634e487b7160e01b5f52601160045260245ffd5b6001815b60018411156103ad578085048111156103915761039161035e565b600184161561039f57908102905b60019390931c928002610376565b935093915050565b5f826103c357506001610451565b816103cf57505f610451565b81600181146103e557600281146103ef5761040b565b6001915050610451565b60ff8411156104005761040061035e565b50506001821b610451565b5060208310610133831016604e8410600b841016171561042e575081810a610451565b61043a5f198484610372565b805f190482111561044d5761044d61035e565b0290505b92915050565b5f61046560ff8416836103b5565b9392505050565b80820281158282048414176104515761045161035e565b808201808211156104515761045161035e565b6106e3806104a35f395ff3fe608060405234801561000f575f80fd5b5060043610610090575f3560e01c8063313ce56711610063578063313ce567146100fa57806370a082311461010957806395d89b4114610131578063a9059cbb14610139578063dd62ed3e1461014c575f80fd5b806306fdde0314610094578063095ea7b3146100b257806318160ddd146100d557806323b872dd146100e7575b5f80fd5b61009c610184565b6040516100a99190610553565b60405180910390f35b6100c56100c03660046105a3565b610214565b60405190151581526020016100a9565b6002545b6040519081526020016100a9565b6100c56100f53660046105cb565b61022d565b604051601281526020016100a9565b6100d9610117366004610605565b6001600160a01b03165f9081526020819052604090205490565b61009c610250565b6100c56101473660046105a3565b61025f565b6100d961015a366004610625565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b60606003805461019390610656565b80601f01602080910402602001604051908101604052809291908181526020018280546101bf90610656565b801561020a5780601f106101e15761010080835404028352916020019161020a565b820191905f5260205f20905b8154815290600101906020018083116101ed57829003601f168201915b5050505050905090565b5f3361022181858561026c565b60019150505b92915050565b5f3361023a85828561027e565b6102458585856102fe565b506001949350505050565b60606004805461019390610656565b5f336102218185856102fe565b610279838383600161035b565b505050565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f1981146102f857818110156102ea57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064015b60405180910390fd5b6102f884848484035f61035b565b50505050565b6001600160a01b03831661032757604051634b637e8f60e11b81525f60048201526024016102e1565b6001600160a01b0382166103505760405163ec442f0560e01b81525f60048201526024016102e1565b61027983838361042d565b6001600160a01b0384166103845760405163e602df0560e01b81525f60048201526024016102e1565b6001600160a01b0383166103ad57604051634a1406b160e11b81525f60048201526024016102e1565b6001600160a01b038085165f90815260016020908152604080832093871683529290522082905580156102f857826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161041f91815260200190565b60405180910390a350505050565b6001600160a01b038316610457578060025f82825461044c919061068e565b909155506104c79050565b6001600160a01b0383165f90815260208190526040902054818110156104a95760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016102e1565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166104e357600280548290039055610501565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161054691815260200190565b60405180910390a3505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b038116811461059e575f80fd5b919050565b5f80604083850312156105b4575f80fd5b6105bd83610588565b946020939093013593505050565b5f805f606084860312156105dd575f80fd5b6105e684610588565b92506105f460208501610588565b929592945050506040919091013590565b5f60208284031215610615575f80fd5b61061e82610588565b9392505050565b5f8060408385031215610636575f80fd5b61063f83610588565b915061064d60208401610588565b90509250929050565b600181811c9082168061066a57607f821691505b60208210810361068857634e487b7160e01b5f52602260045260245ffd5b50919050565b8082018082111561022757634e487b7160e01b5f52601160045260245ffdfea26469706673582212200803f9a48c1246b3c591db15169a4fe12993b4cc344b83e753c7430d28a70ffa64736f6c634300081a0033
608060405234801561000f575f80fd5b5060043610610090575f3560e01c8063313ce56711610063578063313ce567146100fa57806370a082311461010957806395d89b4114610131578063a9059cbb14610139578063dd62ed3e1461014c575f80fd5b806306fdde0314610094578063095ea7b3146100b257806318160ddd146100d557806323b872dd146100e7575b5f80fd5b61009c610184565b6040516100a99190610553565b60405180910390f35b6100c56100c03660046105a3565b610214565b60405190151581526020016100a9565b6002545b6040519081526020016100a9565b6100c56100f53660046105cb565b61022d565b604051601281526020016100a9565b6100d9610117366004610605565b6001600160a01b03165f9081526020819052604090205490565b61009c610250565b6100c56101473660046105a3565b61025f565b6100d961015a366004610625565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b60606003805461019390610656565b80601f01602080910402602001604051908101604052809291908181526020018280546101bf90610656565b801561020a5780601f106101e15761010080835404028352916020019161020a565b820191905f5260205f20905b8154815290600101906020018083116101ed57829003601f168201915b5050505050905090565b5f3361022181858561026c565b60019150505b92915050565b5f3361023a85828561027e565b6102458585856102fe565b506001949350505050565b60606004805461019390610656565b5f336102218185856102fe565b610279838383600161035b565b505050565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f1981146102f857818110156102ea57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064015b60405180910390fd5b6102f884848484035f61035b565b50505050565b6001600160a01b03831661032757604051634b637e8f60e11b81525f60048201526024016102e1565b6001600160a01b0382166103505760405163ec442f0560e01b81525f60048201526024016102e1565b61027983838361042d565b6001600160a01b0384166103845760405163e602df0560e01b81525f60048201526024016102e1565b6001600160a01b0383166103ad57604051634a1406b160e11b81525f60048201526024016102e1565b6001600160a01b038085165f90815260016020908152604080832093871683529290522082905580156102f857826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161041f91815260200190565b60405180910390a350505050565b6001600160a01b038316610457578060025f82825461044c919061068e565b909155506104c79050565b6001600160a01b0383165f90815260208190526040902054818110156104a95760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016102e1565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166104e357600280548290039055610501565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161054691815260200190565b60405180910390a3505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b038116811461059e575f80fd5b919050565b5f80604083850312156105b4575f80fd5b6105bd83610588565b946020939093013593505050565b5f805f606084860312156105dd575f80fd5b6105e684610588565b92506105f460208501610588565b929592945050506040919091013590565b5f60208284031215610615575f80fd5b61061e82610588565b9392505050565b5f8060408385031215610636575f80fd5b61063f83610588565b915061064d60208401610588565b90509250929050565b600181811c9082168061066a57607f821691505b60208210810361068857634e487b7160e01b5f52602260045260245ffd5b50919050565b8082018082111561022757634e487b7160e01b5f52601160045260245ffdfea26469706673582212200803f9a48c1246b3c591db15169a4fe12993b4cc344b83e753c7430d28a70ffa64736f6c634300081a0033
{{ "language": "Solidity", "sources": { "h22.sol": { "content": "// SPDX-License-Identifier: MIT\r\n\r\n/*\r\n /\\\r\n /\\ //\\\\\r\n /\\ //\\\\///\\\\\\ /\\\r\n //\\\\ ///\\////\\\\\\\\ /\\ //\\\\\r\n /\\ / ^ \\/^ ^/^ ^ ^ \\/^ \\/ ^ \\\r\n / ^\\ /\\ / ^ / ^/ ^ ^ ^ ^\\ ^/ ^^ \\\r\n /^ \\ / ^\\/ ^ ^ ^ / ^ ^ ^ \\/ ^ ^ \\ *\r\n / ^ ^ \\/^ ^\\ ^ ^ ^ ^ ^ ^ ____ ^ ^ \\ /|\\\r\n / ^ ^ ^ \\ ^ _\\___________________| |_____^ ^ \\ /||o\\\r\n / ^^ ^ ^ ^\\ /______________________________\\ ^ ^ \\ /|o|||\\\r\n / ^ ^^ ^ ^ /________________________________\\ ^ /|||||o|\\\r\n /^ ^ ^ ^^ ^ ||___|___||||||||||||___|__||| /||o||||||\\ \r\n / ^ ^ ^ ^ ||___|___||||||||||||___|__||| | | \r\n/ ^ ^ ^ ^ ^ ^ ||||||||||||||||||||||||||||||oooooooooo| |ooooooo \r\nooooooooooooooooooooooooooooooooooooooooooooooooooooooooo\r\n\r\ntelegram: https://t.me/h22eth\r\n\r\n*/\r\n\r\npragma solidity ^0.8.20;\r\n\r\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\r\n\r\ncontract H22 is ERC20 {\r\n constructor() ERC20(\"Mountain H22\", \"H22\") {\r\n _mint(msg.sender, 1000000 * 10 ** decimals());\r\n }\r\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/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/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/token/ERC20/extensions/IERC20Metadata.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 \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\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 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" } }, "settings": { "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } } }}
1
20,291,130
35c8d44692ea939f65b374d467d9061dd99188fd7afea83a78187d1d29285ef7
9b86ef51df360a42b2b8023f531d2c5b4302b2359fa21a154c5c1a56dc7f9784
d1ae7f25ace194df69eef015a37c5eb9ed6b8733
d1ae7f25ace194df69eef015a37c5eb9ed6b8733
b7d5632d9654686e5f00a1beef329638e6088d1e
61014080604052346200054b5760e081620027dc80380380916200002482856200066d565b8339810103126200054b576200003a8162000691565b90620000496020820162000691565b620000576040830162000691565b91620000666060820162000691565b9060808101519260c060a08301519201519560805260a0526200008984620007c4565b8060c052600052600060205260406000209260018060a01b038516938460018060a01b031982541617905560036020526040600020556040519360208560048163313ce56760e01b978882525afa948515620005725760009562000642575b50620001119060c0516000526001602052604060002060ff8019971687825416179055620006f3565b6200011c82620007c4565b8060e05260005260036020526040600020556000602052602060406000209260018060a01b038316938460018060a01b031982541617905560046040518095819382525afa8015620005725762000198926000916200060c575b5060e051600052600160205260ff6040600020911684825416179055620006f3565b60a0516040805163f6c0092760e01b8152600481019490945290839060249082906001600160a01b03165afa9081156200057257600091620005b7575b6001600160a01b038216610120819052620002309350620001f683620007c4565b8061010052600052600060205260406000209060018060a01b031982541617905560016020526012604060002091825416179055620006f3565b60a0516101205160405163038fff2d60e41b81526001600160a01b0392831692909160209183916004918391165afa801562000572576000906200057e575b60009150602460405180948193631f29a8cd60e31b835260048301525afa90811562000572576000916200043b575b5060005b81518110156200033657600581901b820160200151600280549092916001600160a01b031690680100000000000000008110156200032057600181018085558110156200030a5760019360005260206000200190838060a01b031982541617905501620002a2565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b604051611fd290816200080a8239608051818181610238015281816102f9015281816103fc0152818161052b0152818161059c0152610ab8015260a051818181610374015281816108e20152818161096a01528181610b7801528181610c090152818161119501528181611228015281816115a70152611638015260c0518181816119750152611d87015260e0518181816103b001528181611e5701528181611ea901528181611ed20152611f050152610100518181816119af01528181611de30152611e800152610120518181816106a901528181610f38015281816110d90152818161114d015281816112a1015281816114320152818161155f01526118b60152f35b3d9150816000823e6200044f82826200066d565b60608183810103126200054b578051916001600160401b0383116200054b57808201601f8484010112156200054b57828201516200048d81620006c1565b936200049d60405195866200066d565b81855260208086019260051b82860101019083850182116200054b578401602001915b818310620005505750505060208201516001600160401b0381116200054b578201818301601f820112156200054b578051916020806200050085620006c1565b6200050f60405191826200066d565b858152019360051b830101930183116200054b57602001905b8282106200053a57505050386200029e565b815181526020918201910162000528565b600080fd5b82516001600160a01b03811681036200054b57815260209283019201620004c0565b6040513d6000823e3d90fd5b506020813d602011620005ae575b816200059b602093836200066d565b810103126200054b57600090516200026f565b3d91506200058c565b90506040823d60401162000603575b81620005d5604093836200066d565b810103126200054b5760036020620005ed8462000691565b93015110156200054b57620002309190620001d5565b3d9150620005c6565b62000633915060203d6020116200063a575b6200062a81836200066d565b810190620006a6565b3862000176565b503d6200061e565b62000111919550620006659060203d6020116200063a576200062a81836200066d565b9490620000e8565b601f909101601f19168101906001600160401b038211908210176200032057604052565b51906001600160a01b03821682036200054b57565b908160209103126200054b575160ff811681036200054b5790565b6001600160401b038111620003205760051b60200190565b908160209103126200054b575180151581036200054b5790565b60805160405163095ea7b360e01b8082526001600160a01b039283166004830152600019602483018190526020949093929083169185826044816000875af1801562000572578694604493600092620007a2575b5060a051169360405196879586948552600485015260248401525af18015620005725762000773575050565b816200079792903d106200079a575b6200078e81836200066d565b810190620006d9565b50565b503d62000782565b620007bc90873d89116200079a576200078e81836200066d565b503862000747565b604051606091821b6001600160601b03191660208201908152600060348084019190915282529181016001600160401b0381118282101762000320576040525190209056fe608080604052600436101561001d575b50361561001b57600080fd5b005b600090813560e01c9081630242d7121461199857508063088b699e1461195d578063150b7a02146118da57806316f0115b1461188957806319b88edb1461186c5780633f47e6621461183f5780633fc20d4f146103d357806349bfcca1146103985780637e7701e31461034757806391ac7e651461031d578063a6ec335f146102cc578063cf35bdd014610261578063e92ebd3a1461020d578063f23a6e611461010c5763f8fdeb680361000f57346101095760206003193601126101095773ffffffffffffffffffffffffffffffffffffffff60406020926004358152808452205416604051908152f35b80fd5b50346101095760a0600319360112610109576101266119d2565b5061012f6119f5565b5060843567ffffffffffffffff80821161020957366023830112156102095781600401359081116101da5760405161018f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160182611abf565b81815236602483850101116101d657816024602094018483013701015260206040517ff23a6e61000000000000000000000000000000000000000000000000000000008152f35b8380fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8280fd5b50346101095761021c36611a18565b505050505073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001633036101095780fd5b5034610109576020600319360112610109576004356002548110156102c85773ffffffffffffffffffffffffffffffffffffffff906002602093527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace015416604051908152f35b5080fd5b5034610109578060031936011261010957602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346101095760206003193601126101095760406020916004358152600383522054604051908152f35b5034610109578060031936011261010957602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b503461010957806003193601126101095760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b5034610109576103e236611a18565b91905073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016330361183b578385528460205261051160807f010000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff60408920541617604051602081019182526020815261048281611aa3565b5190519060208110611829575b506040519061049d82611a57565b81526020810188815260408083018a8152606084018781528585018c905291517f739653ba00000000000000000000000000000000000000000000000000000000815284516004820152925160248401525160448301525160648201526080909101516084820152918290819060a4820190565b03818973ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165af180156117fe57611809575b506040517f8fec800900000000000000000000000000000000000000000000000000000000815260208160048173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa80156117fe5786906117c6575b6105d6915082611b22565b9084865260016020526105fa60ff6040882054166105f48484611b2c565b90611f39565b905082018092116113a2579061060f91611b2c565b83855260016020526106288160ff604088205416611f39565b50936106348482611d85565b81875260036020526040872054958588526040882054966002549760038410159889610e0a5760018503610ea357505050604051907f38fff2d000000000000000000000000000000000000000000000000000000000825260208260048173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa918215610e98578992610e64575b508389528860205273ffffffffffffffffffffffffffffffffffffffff60408a20541690878a5273ffffffffffffffffffffffffffffffffffffffff60408b2054166040519283602081011067ffffffffffffffff6020860111176101da57602084016040528b8452604051948560c081011067ffffffffffffffff60c0880111176101da5760c0860160405285528b602086015260408501526060840152608083015260a082015260405161078e81611a73565b30815288602082015230604082015288606082015261012c42014211610e3757604051917f52bbbe2900000000000000000000000000000000000000000000000000000000835260e06004840152805160e484015260208101516002811015610e0a57602092606061086660a08795869561010487015273ffffffffffffffffffffffffffffffffffffffff60408201511661012487015273ffffffffffffffffffffffffffffffffffffffff84820151166101448701526080810151610164870152015160c06101848601526101a4850190611c9c565b9173ffffffffffffffffffffffffffffffffffffffff8151166024850152858101511515604485015273ffffffffffffffffffffffffffffffffffffffff60408201511660648501520151151560848301528860a483015261012c420160c483015203818b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165af1908115610dff578891610dc8575b505b8588526001602052604088205460ff16600060128203610cb8575050955b868511610c8e57610c61578592919060018103610b3f57506040805191825260208201929092529081019190915260608101919091527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166080820152600160a08201527f976ffbca84869d39bddd7057048dffc33e97641e3c7fe06fd7fc2b039c17b6e59060c090a15b825281602052610a9e608073ffffffffffffffffffffffffffffffffffffffff6040852054166040516020810191825260208152610a0f81611aa3565b5190519060208110610b2d575b5060405190610a2a82611a57565b81526020810185815260408083018781526060840187815285850189905291517f739653ba00000000000000000000000000000000000000000000000000000000815284516004820152925160248401525160448301525160648201526080909101516084820152918290819060a4820190565b03818673ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165af18015610b225760209350610af2575b50604051908152f35b610b139060803d608011610b1b575b610b0b8183611abf565b810190611b00565b505050610ae9565b503d610b01565b6040513d85823e3d90fd5b6000199060200360031b1b1638610a1c565b610bd45760408051918252602082019290925290810191909152606081019190915273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166080820152600160a08201527f884d9201fa8b7681d1481b193805aec6deb56538f54e2abef3286e2c5bf28ff3908060c081015b0390a16109d2565b50604080518581526020810192909252810185905260608101929092525073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166080820152600160a08201527f2e0d08763feb8b33376106fd02b993cd22509e7a3381381573d3c80818c27509908060c08101610bcc565b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b60046040517f66516a6e000000000000000000000000000000000000000000000000000000008152fd5b6012821015610d1f575060120360ff8111610cf05760ff610cd99116611f2b565b90818102918183041490151715610cf05795610932565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee90989298019060ff8211610d9b5750610d5f60ff610d669216611f2b565b8098611b22565b96610932575b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526011600452fd5b90506020813d602011610df7575b81610de360209383611abf565b81010312610df2575138610912565b600080fd5b3d9150610dd6565b6040513d8a823e3d90fd5b60248b7f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b6024897f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b9091506020813d602011610e90575b81610e8060209383611abf565b81010312610df2575190386106d9565b3d9150610e73565b6040513d8b823e3d90fd5b909592919980979499509794979589156000146113cf5750610ec7610ece91611b51565b998a611ba0565b528751806000198101116113a257600019610ee99101611b51565b95855b8751811015611006576040517f82687a5600000000000000000000000000000000000000000000000000000000815260208160048173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa908115610dff578891610fd4575b50811015610f905780610f7e6001925b8c611ba0565b51610f89828b611ba0565b5201610eec565b60018101808211610fa75790610f7e600192610f78565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b90506020813d602011610ffe575b81610fef60209383611abf565b81010312610df2575138610f68565b3d9150610fe2565b509295611067611035919992959893969960405192839160016020840152606060408401526080830190611c68565b886060830152037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282611abf565b6040519161107483611a73565b61107c611be3565b83526020830152604082015287606082015287604051917f70a0823100000000000000000000000000000000000000000000000000000000835230600484015260208360248173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa92831561132b57829361136b575b506040517f38fff2d000000000000000000000000000000000000000000000000000000000815260208160048173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa908115610b22578391611336575b5073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163b156102095761120e91839160405193849283927fb95cac280000000000000000000000000000000000000000000000000000000084526004840152306024840152306044840152608060648401526084830190611cfa565b03818373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165af1801561132b57611313575b5050604051907f70a0823100000000000000000000000000000000000000000000000000000000825230600483015260208260248173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa8015610e985789906112df575b6112da9250611b2c565b610914565b506020823d60201161130b575b816112f960209383611abf565b81010312610df2576112da91516112d0565b3d91506112ec565b61131c90611a8f565b611327578738611255565b8780fd5b6040513d84823e3d90fd5b9250506020823d602011611363575b8161135260209383611abf565b81010312610df2578991513861117d565b3d9150611345565b915091506020813d60201161139a575b8161138860209383611abf565b81010312610df2578890519138611109565b3d915061137b565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b929598939699506113e290979497611b51565b91866113ee8285611ba0565b526040517f82687a5600000000000000000000000000000000000000000000000000000000815260208160048173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa9081156117bb578b91611785575b50811015611744575b604051918a6020840152604083015260608201526060815261148c81611a73565b6040519161149983611a73565b6114a1611be3565b8352602083015260408201528760608201528588528760205273ffffffffffffffffffffffffffffffffffffffff604089205416604051917f70a08231000000000000000000000000000000000000000000000000000000008352306004840152602083602481855afa9283156116cd578a9361170c575b5089604051917f38fff2d000000000000000000000000000000000000000000000000000000000835260208360048173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa92831561132b5782936116d8575b5073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163b156102c85761161e9260405193849283927f8bdb39130000000000000000000000000000000000000000000000000000000084526004840152306024840152306044840152608060648401526084830190611cfa565b03818373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165af180156116cd576116b4575b50906020602492604051938480927f70a082310000000000000000000000000000000000000000000000000000000082523060048301525afa8015610e985789906112df576112da9250611b2c565b60249291996116c4602092611a8f565b99919250611665565b6040513d8c823e3d90fd5b9092506020813d602011611704575b816116f460209383611abf565b810103126102c85751913861158f565b3d91506116e7565b9092506020813d60201161173c575b8161172860209383611abf565b8101031261173857519138611519565b8980fd5b3d915061171b565b80600019810111611758576000190161146b565b60248a7f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b90506020813d6020116117b3575b816117a060209383611abf565b810103126117af575138611462565b8a80fd5b3d9150611793565b6040513d8d823e3d90fd5b506020813d6020116117f6575b816117e060209383611abf565b810103126117f2576105d690516105cb565b8580fd5b3d91506117d3565b6040513d88823e3d90fd5b6118219060803d608011610b1b57610b0b8183611abf565b505050610558565b6000199060200360031b1b163861048f565b8480fd5b50346101095760206003193601126101095760ff6040602092600435815260018452205416604051908152f35b503461010957602060031936011261010957602090604051908152f35b5034610109578060031936011261010957602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5034610109576080600319360112610109576118f46119d2565b506118fd6119f5565b5060643567ffffffffffffffff808211610209573660238301121561020957816004013590811161020957369101602401116101095760206040517f150b7a02000000000000000000000000000000000000000000000000000000008152f35b503461010957806003193601126101095760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b9050346102c857816003193601126102c8576020907f00000000000000000000000000000000000000000000000000000000000000008152f35b6004359073ffffffffffffffffffffffffffffffffffffffff82168203610df257565b6024359073ffffffffffffffffffffffffffffffffffffffff82168203610df257565b60031960a0910112610df25760043590602435906044359060643573ffffffffffffffffffffffffffffffffffffffff81168103610df2579060843590565b60a0810190811067ffffffffffffffff8211176101da57604052565b6080810190811067ffffffffffffffff8211176101da57604052565b67ffffffffffffffff81116101da57604052565b6040810190811067ffffffffffffffff8211176101da57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176101da57604052565b9190826080910312610df2578151916020810151916060604083015192015190565b8115610d6c570490565b91908203918211610cf057565b67ffffffffffffffff81116101da5760051b60200190565b90611b5b82611b39565b611b686040519182611abf565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0611b968294611b39565b0190602036910137565b8051821015611bb45760209160051b010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60405190600254808352826020918282019060026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace936000905b828210611c3857505050611c3692500383611abf565b565b855473ffffffffffffffffffffffffffffffffffffffff1684526001958601958895509381019390910190611c20565b90815180825260208080930193019160005b828110611c88575050505090565b835185529381019392810192600101611c7a565b919082519283825260005b848110611ce65750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b602081830181015184830182015201611ca7565b9060808101825160808352805180925260a083019160208092019060005b818110611d5b57505050611d50611d3e6060938385948801519087830390880152611c68565b60408601518582036040870152611c9c565b930151151591015290565b825173ffffffffffffffffffffffffffffffffffffffff1685529383019391830191600101611d18565b7f000000000000000000000000000000000000000000000000000000000000000091908281148080611f02575b8015611ecf575b15611dc75750505050600190565b8015611ea6575b80611e7d575b15611de157505050600090565b7f0000000000000000000000000000000000000000000000000000000000000000149182611e40575b505015611e1657600290565b60046040517fd9dd971c000000000000000000000000000000000000000000000000000000008152fd5b811491508115611e53575b503880611e0a565b90507f00000000000000000000000000000000000000000000000000000000000000001438611e4b565b507f00000000000000000000000000000000000000000000000000000000000000008214611dd4565b507f00000000000000000000000000000000000000000000000000000000000000008114611dce565b507f000000000000000000000000000000000000000000000000000000000000000082148015611db95750838314611db9565b507f00000000000000000000000000000000000000000000000000000000000000008314611db2565b604d8111610cf057600a0a90565b60ff1660128103611f4b575090600090565b80601210600014611fa3577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee0160ff8111610cf05760ff611f8c9116611f2b565b90818102918183041490151715610cf05790600090565b60129291920360ff8111610cf05760ff611fbd9116611f2b565b611fc78184611b22565b928115610d6c5706905600000000000000000000000010597c960343213b947674e103c15b41c9f94f22000000000000000000000000ba12222222228d8ba445958a75a0704d566bf2c8000000000000000000000000bf5495efe5db9ce00f80364c8b423567e58d2110000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002596192bb6e41802428ac943d2f1476c1af25cc0e000000000000000000000659
608080604052600436101561001d575b50361561001b57600080fd5b005b600090813560e01c9081630242d7121461199857508063088b699e1461195d578063150b7a02146118da57806316f0115b1461188957806319b88edb1461186c5780633f47e6621461183f5780633fc20d4f146103d357806349bfcca1146103985780637e7701e31461034757806391ac7e651461031d578063a6ec335f146102cc578063cf35bdd014610261578063e92ebd3a1461020d578063f23a6e611461010c5763f8fdeb680361000f57346101095760206003193601126101095773ffffffffffffffffffffffffffffffffffffffff60406020926004358152808452205416604051908152f35b80fd5b50346101095760a0600319360112610109576101266119d2565b5061012f6119f5565b5060843567ffffffffffffffff80821161020957366023830112156102095781600401359081116101da5760405161018f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160182611abf565b81815236602483850101116101d657816024602094018483013701015260206040517ff23a6e61000000000000000000000000000000000000000000000000000000008152f35b8380fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8280fd5b50346101095761021c36611a18565b505050505073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000010597c960343213b947674e103c15b41c9f94f221633036101095780fd5b5034610109576020600319360112610109576004356002548110156102c85773ffffffffffffffffffffffffffffffffffffffff906002602093527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace015416604051908152f35b5080fd5b5034610109578060031936011261010957602060405173ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000010597c960343213b947674e103c15b41c9f94f22168152f35b50346101095760206003193601126101095760406020916004358152600383522054604051908152f35b5034610109578060031936011261010957602060405173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ba12222222228d8ba445958a75a0704d566bf2c8168152f35b503461010957806003193601126101095760206040517f0f46498815660c285e81f4c96af30b3f9fc2c23c902034b65fa5de9511bebdce8152f35b5034610109576103e236611a18565b91905073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000010597c960343213b947674e103c15b41c9f94f2216330361183b578385528460205261051160807f010000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff60408920541617604051602081019182526020815261048281611aa3565b5190519060208110611829575b506040519061049d82611a57565b81526020810188815260408083018a8152606084018781528585018c905291517f739653ba00000000000000000000000000000000000000000000000000000000815284516004820152925160248401525160448301525160648201526080909101516084820152918290819060a4820190565b03818973ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000010597c960343213b947674e103c15b41c9f94f22165af180156117fe57611809575b506040517f8fec800900000000000000000000000000000000000000000000000000000000815260208160048173ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000010597c960343213b947674e103c15b41c9f94f22165afa80156117fe5786906117c6575b6105d6915082611b22565b9084865260016020526105fa60ff6040882054166105f48484611b2c565b90611f39565b905082018092116113a2579061060f91611b2c565b83855260016020526106288160ff604088205416611f39565b50936106348482611d85565b81875260036020526040872054958588526040882054966002549760038410159889610e0a5760018503610ea357505050604051907f38fff2d000000000000000000000000000000000000000000000000000000000825260208260048173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000596192bb6e41802428ac943d2f1476c1af25cc0e165afa918215610e98578992610e64575b508389528860205273ffffffffffffffffffffffffffffffffffffffff60408a20541690878a5273ffffffffffffffffffffffffffffffffffffffff60408b2054166040519283602081011067ffffffffffffffff6020860111176101da57602084016040528b8452604051948560c081011067ffffffffffffffff60c0880111176101da5760c0860160405285528b602086015260408501526060840152608083015260a082015260405161078e81611a73565b30815288602082015230604082015288606082015261012c42014211610e3757604051917f52bbbe2900000000000000000000000000000000000000000000000000000000835260e06004840152805160e484015260208101516002811015610e0a57602092606061086660a08795869561010487015273ffffffffffffffffffffffffffffffffffffffff60408201511661012487015273ffffffffffffffffffffffffffffffffffffffff84820151166101448701526080810151610164870152015160c06101848601526101a4850190611c9c565b9173ffffffffffffffffffffffffffffffffffffffff8151166024850152858101511515604485015273ffffffffffffffffffffffffffffffffffffffff60408201511660648501520151151560848301528860a483015261012c420160c483015203818b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ba12222222228d8ba445958a75a0704d566bf2c8165af1908115610dff578891610dc8575b505b8588526001602052604088205460ff16600060128203610cb8575050955b868511610c8e57610c61578592919060018103610b3f57506040805191825260208201929092529081019190915260608101919091527f000000000000000000000000ba12222222228d8ba445958a75a0704d566bf2c873ffffffffffffffffffffffffffffffffffffffff166080820152600160a08201527f976ffbca84869d39bddd7057048dffc33e97641e3c7fe06fd7fc2b039c17b6e59060c090a15b825281602052610a9e608073ffffffffffffffffffffffffffffffffffffffff6040852054166040516020810191825260208152610a0f81611aa3565b5190519060208110610b2d575b5060405190610a2a82611a57565b81526020810185815260408083018781526060840187815285850189905291517f739653ba00000000000000000000000000000000000000000000000000000000815284516004820152925160248401525160448301525160648201526080909101516084820152918290819060a4820190565b03818673ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000010597c960343213b947674e103c15b41c9f94f22165af18015610b225760209350610af2575b50604051908152f35b610b139060803d608011610b1b575b610b0b8183611abf565b810190611b00565b505050610ae9565b503d610b01565b6040513d85823e3d90fd5b6000199060200360031b1b1638610a1c565b610bd45760408051918252602082019290925290810191909152606081019190915273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ba12222222228d8ba445958a75a0704d566bf2c8166080820152600160a08201527f884d9201fa8b7681d1481b193805aec6deb56538f54e2abef3286e2c5bf28ff3908060c081015b0390a16109d2565b50604080518581526020810192909252810185905260608101929092525073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ba12222222228d8ba445958a75a0704d566bf2c8166080820152600160a08201527f2e0d08763feb8b33376106fd02b993cd22509e7a3381381573d3c80818c27509908060c08101610bcc565b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b60046040517f66516a6e000000000000000000000000000000000000000000000000000000008152fd5b6012821015610d1f575060120360ff8111610cf05760ff610cd99116611f2b565b90818102918183041490151715610cf05795610932565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee90989298019060ff8211610d9b5750610d5f60ff610d669216611f2b565b8098611b22565b96610932575b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526011600452fd5b90506020813d602011610df7575b81610de360209383611abf565b81010312610df2575138610912565b600080fd5b3d9150610dd6565b6040513d8a823e3d90fd5b60248b7f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b6024897f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b9091506020813d602011610e90575b81610e8060209383611abf565b81010312610df2575190386106d9565b3d9150610e73565b6040513d8b823e3d90fd5b909592919980979499509794979589156000146113cf5750610ec7610ece91611b51565b998a611ba0565b528751806000198101116113a257600019610ee99101611b51565b95855b8751811015611006576040517f82687a5600000000000000000000000000000000000000000000000000000000815260208160048173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000596192bb6e41802428ac943d2f1476c1af25cc0e165afa908115610dff578891610fd4575b50811015610f905780610f7e6001925b8c611ba0565b51610f89828b611ba0565b5201610eec565b60018101808211610fa75790610f7e600192610f78565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b90506020813d602011610ffe575b81610fef60209383611abf565b81010312610df2575138610f68565b3d9150610fe2565b509295611067611035919992959893969960405192839160016020840152606060408401526080830190611c68565b886060830152037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282611abf565b6040519161107483611a73565b61107c611be3565b83526020830152604082015287606082015287604051917f70a0823100000000000000000000000000000000000000000000000000000000835230600484015260208360248173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000596192bb6e41802428ac943d2f1476c1af25cc0e165afa92831561132b57829361136b575b506040517f38fff2d000000000000000000000000000000000000000000000000000000000815260208160048173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000596192bb6e41802428ac943d2f1476c1af25cc0e165afa908115610b22578391611336575b5073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ba12222222228d8ba445958a75a0704d566bf2c8163b156102095761120e91839160405193849283927fb95cac280000000000000000000000000000000000000000000000000000000084526004840152306024840152306044840152608060648401526084830190611cfa565b03818373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ba12222222228d8ba445958a75a0704d566bf2c8165af1801561132b57611313575b5050604051907f70a0823100000000000000000000000000000000000000000000000000000000825230600483015260208260248173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000596192bb6e41802428ac943d2f1476c1af25cc0e165afa8015610e985789906112df575b6112da9250611b2c565b610914565b506020823d60201161130b575b816112f960209383611abf565b81010312610df2576112da91516112d0565b3d91506112ec565b61131c90611a8f565b611327578738611255565b8780fd5b6040513d84823e3d90fd5b9250506020823d602011611363575b8161135260209383611abf565b81010312610df2578991513861117d565b3d9150611345565b915091506020813d60201161139a575b8161138860209383611abf565b81010312610df2578890519138611109565b3d915061137b565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b929598939699506113e290979497611b51565b91866113ee8285611ba0565b526040517f82687a5600000000000000000000000000000000000000000000000000000000815260208160048173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000596192bb6e41802428ac943d2f1476c1af25cc0e165afa9081156117bb578b91611785575b50811015611744575b604051918a6020840152604083015260608201526060815261148c81611a73565b6040519161149983611a73565b6114a1611be3565b8352602083015260408201528760608201528588528760205273ffffffffffffffffffffffffffffffffffffffff604089205416604051917f70a08231000000000000000000000000000000000000000000000000000000008352306004840152602083602481855afa9283156116cd578a9361170c575b5089604051917f38fff2d000000000000000000000000000000000000000000000000000000000835260208360048173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000596192bb6e41802428ac943d2f1476c1af25cc0e165afa92831561132b5782936116d8575b5073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ba12222222228d8ba445958a75a0704d566bf2c8163b156102c85761161e9260405193849283927f8bdb39130000000000000000000000000000000000000000000000000000000084526004840152306024840152306044840152608060648401526084830190611cfa565b03818373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ba12222222228d8ba445958a75a0704d566bf2c8165af180156116cd576116b4575b50906020602492604051938480927f70a082310000000000000000000000000000000000000000000000000000000082523060048301525afa8015610e985789906112df576112da9250611b2c565b60249291996116c4602092611a8f565b99919250611665565b6040513d8c823e3d90fd5b9092506020813d602011611704575b816116f460209383611abf565b810103126102c85751913861158f565b3d91506116e7565b9092506020813d60201161173c575b8161172860209383611abf565b8101031261173857519138611519565b8980fd5b3d915061171b565b80600019810111611758576000190161146b565b60248a7f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b90506020813d6020116117b3575b816117a060209383611abf565b810103126117af575138611462565b8a80fd5b3d9150611793565b6040513d8d823e3d90fd5b506020813d6020116117f6575b816117e060209383611abf565b810103126117f2576105d690516105cb565b8580fd5b3d91506117d3565b6040513d88823e3d90fd5b6118219060803d608011610b1b57610b0b8183611abf565b505050610558565b6000199060200360031b1b163861048f565b8480fd5b50346101095760206003193601126101095760ff6040602092600435815260018452205416604051908152f35b503461010957602060031936011261010957602090604051908152f35b5034610109578060031936011261010957602060405173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000596192bb6e41802428ac943d2f1476c1af25cc0e168152f35b5034610109576080600319360112610109576118f46119d2565b506118fd6119f5565b5060643567ffffffffffffffff808211610209573660238301121561020957816004013590811161020957369101602401116101095760206040517f150b7a02000000000000000000000000000000000000000000000000000000008152f35b503461010957806003193601126101095760206040517f7e96a921cddcdcf36c97db3aca2753d79be11e503413fe688fa63ca2838a4b928152f35b9050346102c857816003193601126102c8576020907f85ad7698013953cc81f5aa394623b6d630ce67fab1182bd7758d9a22a23a60688152f35b6004359073ffffffffffffffffffffffffffffffffffffffff82168203610df257565b6024359073ffffffffffffffffffffffffffffffffffffffff82168203610df257565b60031960a0910112610df25760043590602435906044359060643573ffffffffffffffffffffffffffffffffffffffff81168103610df2579060843590565b60a0810190811067ffffffffffffffff8211176101da57604052565b6080810190811067ffffffffffffffff8211176101da57604052565b67ffffffffffffffff81116101da57604052565b6040810190811067ffffffffffffffff8211176101da57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176101da57604052565b9190826080910312610df2578151916020810151916060604083015192015190565b8115610d6c570490565b91908203918211610cf057565b67ffffffffffffffff81116101da5760051b60200190565b90611b5b82611b39565b611b686040519182611abf565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0611b968294611b39565b0190602036910137565b8051821015611bb45760209160051b010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60405190600254808352826020918282019060026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace936000905b828210611c3857505050611c3692500383611abf565b565b855473ffffffffffffffffffffffffffffffffffffffff1684526001958601958895509381019390910190611c20565b90815180825260208080930193019160005b828110611c88575050505090565b835185529381019392810192600101611c7a565b919082519283825260005b848110611ce65750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b602081830181015184830182015201611ca7565b9060808101825160808352805180925260a083019160208092019060005b818110611d5b57505050611d50611d3e6060938385948801519087830390880152611c68565b60408601518582036040870152611c9c565b930151151591015290565b825173ffffffffffffffffffffffffffffffffffffffff1685529383019391830191600101611d18565b7f7e96a921cddcdcf36c97db3aca2753d79be11e503413fe688fa63ca2838a4b9291908281148080611f02575b8015611ecf575b15611dc75750505050600190565b8015611ea6575b80611e7d575b15611de157505050600090565b7f85ad7698013953cc81f5aa394623b6d630ce67fab1182bd7758d9a22a23a6068149182611e40575b505015611e1657600290565b60046040517fd9dd971c000000000000000000000000000000000000000000000000000000008152fd5b811491508115611e53575b503880611e0a565b90507f0f46498815660c285e81f4c96af30b3f9fc2c23c902034b65fa5de9511bebdce1438611e4b565b507f85ad7698013953cc81f5aa394623b6d630ce67fab1182bd7758d9a22a23a60688214611dd4565b507f0f46498815660c285e81f4c96af30b3f9fc2c23c902034b65fa5de9511bebdce8114611dce565b507f0f46498815660c285e81f4c96af30b3f9fc2c23c902034b65fa5de9511bebdce82148015611db95750838314611db9565b507f0f46498815660c285e81f4c96af30b3f9fc2c23c902034b65fa5de9511bebdce8314611db2565b604d8111610cf057600a0a90565b60ff1660128103611f4b575090600090565b80601210600014611fa3577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee0160ff8111610cf05760ff611f8c9116611f2b565b90818102918183041490151715610cf05790600090565b60129291920360ff8111610cf05760ff611fbd9116611f2b565b611fc78184611b22565b928115610d6c57069056
{{ "language": "Solidity", "sources": { "src/adapters/BalancerAdapter.sol": { "content": "// SPDX-License-Identifier: MIT\n// Cowri Labs Inc.\n\npragma solidity ^0.8.19;\n\nimport { IERC20Metadata } from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport \"./OceanAdapter.sol\";\nimport \"../interfaces/IBalancerVault.sol\";\n\nenum ComputeType {\n Deposit,\n Swap,\n Withdraw\n}\n\n/**\n * @notice\n * balancer adapter to do swaps/deposits and withdrawals through balancer\n */\ncontract BalancerAdapter is OceanAdapter {\n /////////////////////////////////////////////////////////////////////\n // Errors //\n /////////////////////////////////////////////////////////////////////\n error INVALID_COMPUTE_TYPE();\n error SLIPPAGE_LIMIT_EXCEEDED();\n\n /////////////////////////////////////////////////////////////////////\n // Events //\n /////////////////////////////////////////////////////////////////////\n event Swap(uint256 inputToken, uint256 inputAmount, uint256 outputAmount, bytes32 slippageProtection, address user, bool computeOutput);\n event Deposit(uint256 inputToken, uint256 inputAmount, uint256 outputAmount, bytes32 slippageProtection, address user, bool computeOutput);\n event Withdraw(uint256 outputToken, uint256 inputAmount, uint256 outputAmount, bytes32 slippageProtection, address user, bool computeOutput);\n\n /// @notice x token Ocean ID.\n uint256 public immutable xToken;\n\n /// @notice y token Ocean ID.\n uint256 public immutable yToken;\n\n /// @notice lp token Ocean ID.\n uint256 public immutable lpTokenId;\n\n /// @notice pool address\n IPool public immutable pool;\n\n /// @notice pool asset list\n IAsset[] public assets;\n\n /// @notice map token Ocean IDs to corresponding Curve pool indices\n mapping(uint256 => uint256) public indexOf;\n\n //*********************************************************************//\n // ---------------------------- constructor -------------------------- //\n //*********************************************************************//\n\n /**\n * @notice only initializing the immutables, mappings & approves tokens\n */\n constructor(address ocean_, address primitive_, address underlyingTokenX_, address underlyingTokenY_, uint256 tokenXIndex_, uint256 tokenYIndex_, bytes32 poolId_) OceanAdapter(ocean_, primitive_) {\n address xTokenAddress = underlyingTokenX_;\n xToken = _calculateOceanId(xTokenAddress, 0);\n underlying[xToken] = xTokenAddress;\n indexOf[xToken] = tokenXIndex_;\n decimals[xToken] = IERC20Metadata(xTokenAddress).decimals();\n _approveToken(xTokenAddress);\n\n address yTokenAddress = underlyingTokenY_;\n yToken = _calculateOceanId(yTokenAddress, 0);\n indexOf[yToken] = tokenYIndex_;\n underlying[yToken] = yTokenAddress;\n decimals[yToken] = IERC20Metadata(yTokenAddress).decimals();\n _approveToken(yTokenAddress);\n\n (address _pool,) = IBalancerVault(primitive).getPool(poolId_);\n pool = IPool(_pool);\n\n lpTokenId = _calculateOceanId(_pool, 0);\n underlying[lpTokenId] = _pool;\n decimals[lpTokenId] = 18;\n _approveToken(_pool);\n\n (IERC20[] memory tokens,,) = IBalancerVault(primitive).getPoolTokens(pool.getPoolId());\n for (uint256 i; i < tokens.length;) {\n assets.push(IAsset(address(tokens[i])));\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @dev wraps the underlying token into the Ocean\n * @param tokenId Ocean ID of token to wrap\n * @param amount wrap amount\n */\n function wrapToken(uint256 tokenId, uint256 amount, bytes32 metadata) internal override {\n address tokenAddress = underlying[tokenId];\n\n Interaction memory interaction = Interaction({ interactionTypeAndAddress: _fetchInteractionId(tokenAddress, uint256(InteractionType.WrapErc20)), inputToken: 0, outputToken: 0, specifiedAmount: amount, metadata: bytes32(0) });\n\n IOceanInteractions(ocean).doInteraction(interaction);\n }\n\n /**\n * @dev unwraps the underlying token from the Ocean\n * @param tokenId Ocean ID of token to unwrap\n * @param amount unwrap amount\n */\n function unwrapToken(uint256 tokenId, uint256 amount, bytes32 metadata) internal override returns (uint256 unwrappedAmount) {\n address tokenAddress = underlying[tokenId];\n\n Interaction memory interaction = Interaction({ interactionTypeAndAddress: _fetchInteractionId(tokenAddress, uint256(InteractionType.UnwrapErc20)), inputToken: 0, outputToken: 0, specifiedAmount: amount, metadata: bytes32(0) });\n\n IOceanInteractions(ocean).doInteraction(interaction);\n\n // handle the unwrap fee scenario\n uint256 unwrapFee = amount / IOceanInteractions(ocean).unwrapFeeDivisor();\n (, uint256 truncated) = _convertDecimals(NORMALIZED_DECIMALS, decimals[tokenId], amount - unwrapFee);\n unwrapFee = unwrapFee + truncated;\n\n unwrappedAmount = amount - unwrapFee;\n }\n\n /**\n * @dev swaps/add liquidity/remove liquidity from Curve 2pool\n * @param inputToken The user is giving this token to the pool\n * @param outputToken The pool is giving this token to the user\n * @param inputAmount The amount of the inputToken the user is giving to the pool\n * @param minimumOutputAmount The minimum amount of tokens expected back after the exchange\n */\n function primitiveOutputAmount(uint256 inputToken, uint256 outputToken, uint256 inputAmount, bytes32 minimumOutputAmount) internal override returns (uint256 outputAmount) {\n (uint256 rawInputAmount,) = _convertDecimals(NORMALIZED_DECIMALS, decimals[inputToken], inputAmount);\n\n ComputeType action = _determineComputeType(inputToken, outputToken);\n\n uint256 rawOutputAmount;\n\n // avoid multiple SLOADS\n uint256 indexOfInputAmount = indexOf[inputToken];\n uint256 indexOfOutputAmount = indexOf[outputToken];\n uint256 assetLength = assets.length;\n\n if (action == ComputeType.Swap) {\n IBalancerVault.SingleSwap memory singleSwap = IBalancerVault.SingleSwap({\n poolId: pool.getPoolId(),\n kind: IBalancerVault.SwapKind.GIVEN_IN,\n assetIn: IAsset(underlying[inputToken]),\n assetOut: IAsset(underlying[outputToken]),\n amount: rawInputAmount,\n userData: new bytes(0)\n });\n\n IBalancerVault.FundManagement memory fundManagement = IBalancerVault.FundManagement({ sender: payable(address(this)), fromInternalBalance: false, recipient: payable(address(this)), toInternalBalance: false });\n rawOutputAmount = IBalancerVault(primitive).swap(singleSwap, fundManagement, uint256(minimumOutputAmount), block.timestamp + 300);\n } else if (action == ComputeType.Deposit) {\n uint256[] memory amounts = new uint256[](assetLength);\n amounts[indexOfInputAmount] = rawInputAmount;\n\n uint256[] memory amountsWithoutBpt = new uint256[](amounts.length - 1);\n for (uint256 i; i < amountsWithoutBpt.length;) {\n amountsWithoutBpt[i] = amounts[i < pool.getBptIndex() ? i : i + 1];\n unchecked {\n ++i;\n }\n }\n\n IBalancerVault.JoinPoolRequest memory joinPool = IBalancerVault.JoinPoolRequest({ assets: assets, maxAmountsIn: amounts, userData: abi.encode(1, amountsWithoutBpt, uint256(minimumOutputAmount)), fromInternalBalance: false });\n\n uint256 bptBalanceBeforeDeposit = IERC20Metadata(address(pool)).balanceOf(address(this));\n IBalancerVault(primitive).joinPool(pool.getPoolId(), address(this), address(this), joinPool);\n rawOutputAmount = IERC20Metadata(address(pool)).balanceOf(address(this)) - bptBalanceBeforeDeposit;\n } else {\n uint256[] memory amounts = new uint256[](assetLength);\n amounts[indexOfOutputAmount] = uint256(minimumOutputAmount);\n\n IBalancerVault.ExitPoolRequest memory exitPool = IBalancerVault.ExitPoolRequest({\n assets: assets,\n minAmountsOut: amounts,\n userData: abi.encode(0, rawInputAmount, indexOfOutputAmount < pool.getBptIndex() ? indexOfOutputAmount : indexOfOutputAmount - 1),\n toInternalBalance: false\n });\n address outputTokenAddress = underlying[outputToken];\n uint256 outputTokenBalanceBeforeWithdraw = IERC20Metadata(outputTokenAddress).balanceOf(address(this));\n\n IBalancerVault(primitive).exitPool(pool.getPoolId(), address(this), payable(address(this)), exitPool);\n rawOutputAmount = IERC20Metadata(outputTokenAddress).balanceOf(address(this)) - outputTokenBalanceBeforeWithdraw;\n }\n\n (outputAmount,) = _convertDecimals(decimals[outputToken], NORMALIZED_DECIMALS, rawOutputAmount);\n\n if (uint256(minimumOutputAmount) > outputAmount) revert SLIPPAGE_LIMIT_EXCEEDED();\n\n if (action == ComputeType.Swap) {\n emit Swap(inputToken, inputAmount, outputAmount, minimumOutputAmount, primitive, true);\n } else if (action == ComputeType.Deposit) {\n emit Deposit(inputToken, inputAmount, outputAmount, minimumOutputAmount, primitive, true);\n } else {\n emit Withdraw(outputToken, inputAmount, outputAmount, minimumOutputAmount, primitive, true);\n }\n }\n\n /**\n * @dev Approves token to be spent by the Ocean and the Curve pool\n */\n function _approveToken(address tokenAddress) private {\n IERC20Metadata(tokenAddress).approve(ocean, type(uint256).max);\n IERC20Metadata(tokenAddress).approve(primitive, type(uint256).max);\n }\n\n /**\n * @dev Uses the inputToken and outputToken to determine the ComputeType\n * (input: xToken, output: yToken) | (input: yToken, output: xToken) => SWAP\n * base := xToken | yToken\n * (input: base, output: lpToken) => DEPOSIT\n * (input: lpToken, output: base) => WITHDRAW\n */\n function _determineComputeType(uint256 inputToken, uint256 outputToken) private view returns (ComputeType computeType) {\n if (((inputToken == xToken) && (outputToken == yToken)) || ((inputToken == yToken) && (outputToken == xToken))) {\n return ComputeType.Swap;\n } else if (((inputToken == xToken) || (inputToken == yToken)) && (outputToken == lpTokenId)) {\n return ComputeType.Deposit;\n } else if ((inputToken == lpTokenId) && ((outputToken == xToken) || (outputToken == yToken))) {\n return ComputeType.Withdraw;\n } else {\n revert INVALID_COMPUTE_TYPE();\n }\n }\n\n receive() external payable { }\n}\n" }, "node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.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 \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\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" }, "src/adapters/OceanAdapter.sol": { "content": "// SPDX-License-Identifier: MIT\n// Cowri Labs Inc.\n\npragma solidity ^0.8.19;\n\nimport \"../interfaces/IOceanPrimitive.sol\";\nimport \"../interfaces/Interactions.sol\";\n\n/**\n * @notice\n * Helper contract for shell adapters\n */\nabstract contract OceanAdapter is IOceanPrimitive {\n /// @notice normalized decimals to be compatible with the Ocean.\n uint8 constant NORMALIZED_DECIMALS = 18;\n\n /// @notice Ocean address.\n address public immutable ocean;\n\n /// @notice external primitive address.\n address public immutable primitive;\n\n /// @notice The underlying token address corresponding to the Ocean ID.\n mapping(uint256 => address) public underlying;\n\n /// @notice The underlying token decimals wrt to the Ocean ID\n mapping(uint256 => uint8) public decimals;\n\n //*********************************************************************//\n // ---------------------------- constructor -------------------------- //\n //*********************************************************************//\n\n /// @notice only initializing the immutables\n constructor(address ocean_, address primitive_) {\n ocean = ocean_;\n primitive = primitive_;\n }\n\n /// @notice only allow the Ocean to call a method\n modifier onlyOcean() {\n require(msg.sender == ocean);\n _;\n }\n\n /**\n * @dev The Ocean must always know the input and output tokens in order to\n * do the accounting. One of the token amounts is chosen by the user, and\n * the other amount is chosen by the primitive. When computeOutputAmount is\n * called, the user provides the inputAmount, and the primitive uses this to\n * compute the outputAmount\n * @param inputToken The user is giving this token to the primitive\n * @param outputToken The primitive is giving this token to the user\n * @param inputAmount The amount of the inputToken the user is giving to the primitive\n * @param metadata a bytes32 value that the user provides the Ocean\n * @dev the unused param is an address field called userAddress\n */\n function computeOutputAmount(uint256 inputToken, uint256 outputToken, uint256 inputAmount, address, bytes32 metadata) external override onlyOcean returns (uint256 outputAmount) {\n uint256 unwrappedAmount = unwrapToken(inputToken, inputAmount, metadata);\n\n outputAmount = primitiveOutputAmount(inputToken, outputToken, unwrappedAmount, metadata);\n\n wrapToken(outputToken, outputAmount, metadata);\n }\n\n /**\n * @notice Not implemented for this primitive\n */\n function computeInputAmount(uint256 inputToken, uint256 outputToken, uint256 outputAmount, address userAddress, bytes32 maximumInputAmount) external override onlyOcean returns (uint256 inputAmount) {\n revert();\n }\n\n /**\n * @notice used to fetch the Ocean interaction ID\n */\n function _fetchInteractionId(address token, uint256 interactionType) internal pure returns (bytes32) {\n uint256 packedValue = uint256(uint160(token));\n packedValue |= interactionType << 248;\n return bytes32(abi.encode(packedValue));\n }\n\n /**\n * @notice calculates Ocean ID for a underlying token\n */\n function _calculateOceanId(address tokenAddress, uint256 tokenId) internal pure returns (uint256) {\n return uint256(keccak256(abi.encodePacked(tokenAddress, tokenId)));\n }\n\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 * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(address, address, uint256, uint256, bytes memory) public pure returns (bytes4) {\n return this.onERC1155Received.selector;\n }\n\n function onERC721Received(address, address, uint256, bytes calldata) public pure returns (bytes4) {\n return this.onERC721Received.selector;\n }\n\n /**\n * @notice returning 0 here since this primitive should not have any tokens\n */\n function getTokenSupply(uint256 tokenId) external view virtual override returns (uint256) {\n return 0;\n }\n\n /**\n * @dev convert a uint256 from one fixed point decimal basis to another,\n * returning the truncated amount if a truncation occurs.\n * @dev fn(from, to, a) => b\n * @dev a = (x * 10**from) => b = (x * 10**to), where x is constant.\n * @param amountToConvert the amount being converted\n * @param decimalsFrom the fixed decimal basis of amountToConvert\n * @param decimalsTo the fixed decimal basis of the returned convertedAmount\n * @return convertedAmount the amount after conversion\n * @return truncatedAmount if (from > to), there may be some truncation, it\n * is up to the caller to decide what to do with the truncated amount.\n */\n function _convertDecimals(uint8 decimalsFrom, uint8 decimalsTo, uint256 amountToConvert) internal pure returns (uint256 convertedAmount, uint256 truncatedAmount) {\n if (decimalsFrom == decimalsTo) {\n // no shift\n convertedAmount = amountToConvert;\n truncatedAmount = 0;\n } else if (decimalsFrom < decimalsTo) {\n // Decimal shift left (add precision)\n uint256 shift = 10 ** (uint256(decimalsTo - decimalsFrom));\n convertedAmount = amountToConvert * shift;\n truncatedAmount = 0;\n } else {\n // Decimal shift right (remove precision) -> truncation\n uint256 shift = 10 ** (uint256(decimalsFrom - decimalsTo));\n convertedAmount = amountToConvert / shift;\n truncatedAmount = amountToConvert % shift;\n }\n }\n\n function primitiveOutputAmount(uint256 inputToken, uint256 outputToken, uint256 inputAmount, bytes32 metadata) internal virtual returns (uint256 outputAmount);\n\n function wrapToken(uint256 tokenId, uint256 amount, bytes32 metadata) internal virtual;\n\n function unwrapToken(uint256 tokenId, uint256 amount, bytes32 metadata) internal virtual returns (uint256 unwrappedAmount);\n}\n" }, "src/interfaces/IBalancerVault.sol": { "content": "// SPDX-License-Identifier: MIT\n// Cowri Labs Inc.\n\npragma solidity ^0.8.19;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IAsset {\n// solhint-disable-previous-line no-empty-blocks\n}\n\ninterface IBalancerQueries {\n function queryExit(bytes32 poolId, address sender, address recipient, IBalancerVault.ExitPoolRequest memory request) external returns (uint256 bptIn, uint256[] memory amountsOut);\n}\n\ninterface IPool {\n function getBptIndex() external view returns (uint256);\n\n function getPoolId() external view returns (bytes32);\n\n function getAmplificationParameter() external view returns (uint256, bool, uint256);\n\n function getScalingFactors() external view returns (uint256[] memory);\n\n function getSwapFeePercentage() external view returns (uint256);\n}\n\ninterface IBalancerVault {\n enum SwapKind {\n GIVEN_IN,\n GIVEN_OUT\n }\n\n enum PoolSpecialization {\n GENERAL,\n MINIMAL_SWAP_INFO,\n TWO_TOKEN\n }\n\n function getPoolTokens(bytes32 poolId) external view returns (IERC20[] memory tokens, uint256[] memory balances, uint256 lastChangeBlock);\n\n function getPool(bytes32 poolId) external view returns (address, PoolSpecialization);\n\n function joinPool(bytes32 poolId, address sender, address recipient, JoinPoolRequest memory request) external payable;\n\n struct JoinPoolRequest {\n IAsset[] assets;\n uint256[] maxAmountsIn;\n bytes userData;\n bool fromInternalBalance;\n }\n\n function exitPool(bytes32 poolId, address sender, address payable recipient, ExitPoolRequest memory request) external;\n\n struct ExitPoolRequest {\n IAsset[] assets;\n uint256[] minAmountsOut;\n bytes userData;\n bool toInternalBalance;\n }\n\n function swap(SingleSwap memory singleSwap, FundManagement memory funds, uint256 limit, uint256 deadline) external payable returns (uint256);\n\n struct SingleSwap {\n bytes32 poolId;\n SwapKind kind;\n IAsset assetIn;\n IAsset assetOut;\n uint256 amount;\n bytes userData;\n }\n\n struct FundManagement {\n address sender;\n bool fromInternalBalance;\n address payable recipient;\n bool toInternalBalance;\n }\n}\n" }, "node_modules/@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" }, "src/interfaces/IOceanPrimitive.sol": { "content": "// SPDX-License-Identifier: unlicensed\n// Cowri Labs Inc.\n\npragma solidity ^0.8.19;\n\n/// @notice Implementing this allows a primitive to be called by the Ocean's\n/// defi framework.\ninterface IOceanPrimitive {\n function computeOutputAmount(uint256 inputToken, uint256 outputToken, uint256 inputAmount, address userAddress, bytes32 metadata) external returns (uint256 outputAmount);\n\n function computeInputAmount(uint256 inputToken, uint256 outputToken, uint256 outputAmount, address userAddress, bytes32 metadata) external returns (uint256 inputAmount);\n\n function getTokenSupply(uint256 tokenId) external view returns (uint256 totalSupply);\n}\n" }, "src/interfaces/Interactions.sol": { "content": "// SPDX-License-Identifier: unlicensed\n// Cowri Labs Inc.\n\npragma solidity ^0.8.19;\n\n/**\n * @param interactionTypeAndAddress the type of interaction and the external\n * contract called during this interaction.\n * @param inputToken this field is ignored except when the interaction type\n * begins with \"Compute\". During a \"Compute\" interaction, this token is given\n * to the external contract.\n * @param outputToken this field is ignored except when the interaction type\n * begins with \"Compute\". During a \"Compute\" interaction, this token is\n * received from the external contract.\n * @param specifiedAmount This value is the amount of the specified token.\n * See the comment above the declaration for InteractionType for information\n * on specified tokens. When this value is equal to type(uint256).max, it is\n * a request by the user to use the intra-transaction delta of the specified\n * token as the specified amount. See LibBalanceDelta for more information\n * about this. When the Ocean executes an interaction, it resolves the\n * specifiedAmount before calling the external contract. During a \"721\"\n * interaction, the resolved specifiedAmount must be identically \"1\".\n * @param metadata This value is used in two ways. During \"Compute\"\n * interactions, it is forwarded to the external contract. The external\n * contract can define whatever expectations it wants for these 32 bytes. The\n * caller is expected to be aware of the expectations of the external contract\n * invoked during the interaction. During 721/1155 and wraps and unwraps,\n * these bytes are cast to uint256 and used as the external ledger's token ID\n * for the interaction.\n */\nstruct Interaction {\n bytes32 interactionTypeAndAddress;\n uint256 inputToken;\n uint256 outputToken;\n uint256 specifiedAmount;\n bytes32 metadata;\n}\n\n/**\n * InteractionType determines how the properties of Interaction are interpreted\n *\n * The interface implemented by the external contract, the specified token\n * for the interaction, and what sign (+/-) of delta can be used are\n * determined by the InteractionType.\n *\n * @param WrapErc20\n * type(externalContract).interfaceId == IERC20\n * specifiedToken == calculateOceanId(externalContract, 0)\n * negative delta can be used as specifiedAmount\n *\n * @param UnwrapErc20\n * type(externalContract).interfaceId == IERC20\n * specifiedToken == calculateOceanId(externalContract, 0)\n * positive delta can be used as specifiedAmount\n *\n * @param WrapErc721\n * type(externalContract).interfaceId == IERC721\n * specifiedToken == calculateOceanId(externalContract, metadata)\n * negative delta can be used as specifiedAmount\n *\n * @param UnwrapErc721\n * type(externalContract).interfaceId == IERC721\n * specifiedToken == calculateOceanId(externalContract, metadata)\n * positive delta can be used as specifiedAmount\n *\n * @param WrapErc1155\n * type(externalContract).interfaceId == IERC1155\n * specifiedToken == calculateOceanId(externalContract, metadata)\n * negative delta can be used as specifiedAmount\n *\n * @param WrapErc1155\n * type(externalContract).interfaceId == IERC1155\n * specifiedToken == calculateOceanId(externalContract, metadata)\n * positive delta can be used as specifiedAmount\n *\n * @param ComputeInputAmount\n * type(externalContract).interfaceId == IOceanexternalContract\n * specifiedToken == outputToken\n * negative delta can be used as specifiedAmount\n *\n * @param ComputeOutputAmount\n * type(externalContract).interfaceId == IOceanexternalContract\n * specifiedToken == inputToken\n * positive delta can be used as specifiedAmount\n */\nenum InteractionType {\n WrapErc20,\n UnwrapErc20,\n WrapErc721,\n UnwrapErc721,\n WrapErc1155,\n UnwrapErc1155,\n ComputeInputAmount,\n ComputeOutputAmount,\n UnwrapEther\n}\n\ninterface IOceanInteractions {\n function unwrapFeeDivisor() external view returns (uint256);\n\n function doMultipleInteractions(Interaction[] calldata interactions, uint256[] calldata ids) external payable returns (uint256[] memory burnIds, uint256[] memory burnAmounts, uint256[] memory mintIds, uint256[] memory mintAmounts);\n\n function forwardedDoMultipleInteractions(\n Interaction[] calldata interactions,\n uint256[] calldata ids,\n address userAddress\n )\n external\n payable\n returns (uint256[] memory burnIds, uint256[] memory burnAmounts, uint256[] memory mintIds, uint256[] memory mintAmounts);\n\n function doInteraction(Interaction calldata interaction) external payable returns (uint256 burnId, uint256 burnAmount, uint256 mintId, uint256 mintAmount);\n\n function forwardedDoInteraction(Interaction calldata interaction, address userAddress) external payable returns (uint256 burnId, uint256 burnAmount, uint256 mintId, uint256 mintAmount);\n}\n" } }, "settings": { "remappings": [ "@prb/test/=lib/prb-test/src/", "forge-std/=lib/forge-std/src/", "@sablier/v2-core/=lib/v2-core/", "balancer-v2-monorepo/=lib/balancer-v2-monorepo/", "src/=src/", "@openzeppelin/=node_modules/@openzeppelin/", "@shell-v2-ocean/=node_modules/shell-v2-ocean/", "abdk-libraries-solidity/=node_modules/abdk-libraries-solidity/", "@balancer-labs/=lib/balancer-v2-monorepo/../../node_modules/@balancer-labs/", "ds-test/=lib/forge-std/lib/ds-test/src/", "prb-math/=lib/prb-math/src/", "prb-test/=lib/prb-test/src/" ], "optimizer": { "enabled": true, "runs": 10000 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "none", "appendCBOR": false }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": true, "libraries": {} } }}
1
20,291,131
94c2fe126ac4376967596c8f45101753150a4ecd9f8f792981c79536c4c664eb
016338c073b65bfc82d02e4a2df69434475d25db657bb98ac21060d4b283da82
be49bd130e126a917ddb5fabf7cdeb6dd9887f40
84654be796dad370032391d5479f8f1fd9ddd14e
bb73b7261b28a1ec6e9824d708cfe16accf4aae3
604080600a3d393df3fe73265c27c849b0e1a62636f6007e8a74dc2a2584aa3d366025573d3d3d3d34865af16031565b363d3d373d3d363d855af45b3d82803e603c573d81fd5b3d81f3
73265c27c849b0e1a62636f6007e8a74dc2a2584aa3d366025573d3d3d3d34865af16031565b363d3d373d3d363d855af45b3d82803e603c573d81fd5b3d81f3
1
20,291,131
94c2fe126ac4376967596c8f45101753150a4ecd9f8f792981c79536c4c664eb
f46c45b68295dc85737e85980466502401194b8cca70d9adad22bd733ae3eff0
acc1735efed1c3cdbe380a8bfb6075947a728650
ffa397285ce46fb78c588a9e993286aac68c37cd
c810ee29948c01e4690840d1a318101f914e1689
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,291,134
d976fb191d4e45df6e868cbdd18aa1c51646ef6039aee057e68283572bcebae2
4d7e451a5a70bd173458c6b76602d6210ae20729b28a87321638aa096ba02abe
ea2440b50d908aa7baa78483a78e0d0d33ede57d
ea2440b50d908aa7baa78483a78e0d0d33ede57d
81a134653b1191fe2e75738898a309251acea326
608060405234801561000f575f80fd5b505f806040518061082001604052806107ee815260200161014f6107ee913990508173ffffffffffffffffffffffffffffffffffffffff168160405161005591906100ef565b5f604051808303815f865af19150503d805f811461008e576040519150601f19603f3d011682016040523d82523d5f602084013e610093565b606091505b5050505050610105565b5f81519050919050565b5f81905092915050565b8281835e5f83830152505050565b5f6100c98261009d565b6100d381856100a7565b93506100e38185602086016100b1565b80840191505092915050565b5f6100fa82846100bf565b915081905092915050565b603e806101115f395ff3fe60806040525f80fdfea264697066735822122024638be71baf537254ad8854034939f6c88138bc56cbc75a6c82a9604592621f64736f6c634300081a003360606040526040516020806107ee8339016040526060805190602001505b625b8d8060016000506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600050819055505b50610767806100876000396000f3006060604052361561007f576000357c0100000000000000000000000000000000000000000000000000000000900480630ecc3912146100815780635479f98b146100fa5780637d0f7a881461017357806390b98a111461019a578063937f6e77146101c7578063bbd39ac014610219578063d26c8a8a146102405761007f565b005b61008c600450610610565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156100ec5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610105600450610432565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610184600480359060200150610261565b6040518082815260200191505060405180910390f35b6101b16004803590602001803590602001506102f6565b6040518082815260200191505060405180910390f35b6102176004803590602001906004018035906020019191908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050905061068e565b005b61022a60048035906020015061027c565b6040518082815260200191505060405180910390f35b61024b6004506102ba565b6040518082815260200191505060405180910390f35b60016000506020528060005260406000206000915090505481565b6000600160005060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000505490506102b5565b919050565b6000600160005060003373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000505490506102f3565b90565b600081600160005060003373ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600050541015610338576000905061042c565b81600160005060003373ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282825054039250508190555081600160005060008573ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828282505401925050819055507f16cdf1707799c6655baac6e210f52b94b7cec08adcaf9ede7dfe8649da926146338484604051808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a16001905061042c565b92915050565b6020604051908101604052806000815260200150600160016000506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060005054101561050757606060405190810160405280602781526020017f536f7272792c20746865206661756365742068617320656e746972656c79207281526020017f756e206472792e00000000000000000000000000000000000000000000000000815260200150905061060d565b60016000506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008181505480929190600190039190505550600160005060003373ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081815054809291906001019190505550606060405190810160405280602281526020017f617965417965436f696e206c6f766521204f6e6520636f696e20666f7220796f81526020017f7521000000000000000000000000000000000000000000000000000000000000815260200150905061060d565b90565b60206040519081016040528060008152602001506000600050805480601f0160208091040260200160405190810160405280929190818152602001828054801561067f57820191906000526020600020905b81548152906001019060200180831161066257829003601f168201915b5050505050905061068b565b90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561076357806000600050908051906020019082805482825590600052602060002090601f01602090048101928215610735579182015b82811115610734578251826000505591602001919060010190610716565b5b5090506107609190610742565b8082111561075c5760008181506000905550600101610742565b5090565b50505b5b5056
60806040525f80fdfea264697066735822122024638be71baf537254ad8854034939f6c88138bc56cbc75a6c82a9604592621f64736f6c634300081a0033
1
20,291,137
8fedd2695c9cf8f8c1c00c4acbacfd7068e670e565ebd8c461dfce96e565e30b
8803cf88b8f833e12eb3c09c1449002b18963160a7ca41cad217b0ecc9640d2e
0000db5c8b030ae20308ac975898e09741e70000
ed0e416e0feea5b484ba5c95d375545ac2b60572
241c21e278a1d9350b088a43749aac03b38f4d79
608060405234801561001057600080fd5b50604051610a1a380380610a1a8339818101604052810190610032919061011c565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550326000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610149565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100e9826100be565b9050919050565b6100f9816100de565b811461010457600080fd5b50565b600081519050610116816100f0565b92915050565b600060208284031215610132576101316100b9565b5b600061014084828501610107565b91505092915050565b6108c2806101586000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063caa5c23f1461003b578063cce3d5d314610057575b600080fd5b610055600480360381019061005091906105fa565b610073565b005b610071600480360381019061006c9190610679565b6101ca565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f890610703565b60405180910390fd5b60005b81518110156101c6578181815181106101205761011f610723565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1682828151811061015557610154610723565b5b60200260200101516020015160405161016e91906107c3565b6000604051808303816000865af19150503d80600081146101ab576040519150601f19603f3d011682016040523d82523d6000602084013e6101b0565b606091505b50505080806101be90610809565b915050610104565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024f90610703565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160405161029e90610877565b60006040518083038185875af1925050503d80600081146102db576040519150601f19603f3d011682016040523d82523d6000602084013e6102e0565b606091505b50505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610348826102ff565b810181811067ffffffffffffffff8211171561036757610366610310565b5b80604052505050565b600061037a6102e6565b9050610386828261033f565b919050565b600067ffffffffffffffff8211156103a6576103a5610310565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f1826103c6565b9050919050565b610401816103e6565b811461040c57600080fd5b50565b60008135905061041e816103f8565b92915050565b600080fd5b600067ffffffffffffffff82111561044457610443610310565b5b61044d826102ff565b9050602081019050919050565b82818337600083830152505050565b600061047c61047784610429565b610370565b90508281526020810184848401111561049857610497610424565b5b6104a384828561045a565b509392505050565b600082601f8301126104c0576104bf6102fa565b5b81356104d0848260208601610469565b91505092915050565b6000604082840312156104ef576104ee6103bc565b5b6104f96040610370565b905060006105098482850161040f565b600083015250602082013567ffffffffffffffff81111561052d5761052c6103c1565b5b610539848285016104ab565b60208301525092915050565b60006105586105538461038b565b610370565b9050808382526020820190506020840283018581111561057b5761057a6103b7565b5b835b818110156105c257803567ffffffffffffffff8111156105a05761059f6102fa565b5b8086016105ad89826104d9565b8552602085019450505060208101905061057d565b5050509392505050565b600082601f8301126105e1576105e06102fa565b5b81356105f1848260208601610545565b91505092915050565b6000602082840312156106105761060f6102f0565b5b600082013567ffffffffffffffff81111561062e5761062d6102f5565b5b61063a848285016105cc565b91505092915050565b6000819050919050565b61065681610643565b811461066157600080fd5b50565b6000813590506106738161064d565b92915050565b60006020828403121561068f5761068e6102f0565b5b600061069d84828501610664565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000600082015250565b60006106ed6017836106a6565b91506106f8826106b7565b602082019050919050565b6000602082019050818103600083015261071c816106e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561078657808201518184015260208101905061076b565b60008484015250505050565b600061079d82610752565b6107a7818561075d565b93506107b7818560208601610768565b80840191505092915050565b60006107cf8284610792565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061081482610643565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610846576108456107da565b5b600182019050919050565b50565b600061086160008361075d565b915061086c82610851565b600082019050919050565b600061088282610854565b915081905091905056fea264697066735822122036692b46567a60a4f6844f8be0961cccba9ff2777bd37b4ea35791aba4c5159b64736f6c63430008120033000000000000000000000000000037bb05b2cef17c6469f4bcdb198826ce0000
608060405234801561001057600080fd5b50600436106100365760003560e01c8063caa5c23f1461003b578063cce3d5d314610057575b600080fd5b610055600480360381019061005091906105fa565b610073565b005b610071600480360381019061006c9190610679565b6101ca565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f890610703565b60405180910390fd5b60005b81518110156101c6578181815181106101205761011f610723565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1682828151811061015557610154610723565b5b60200260200101516020015160405161016e91906107c3565b6000604051808303816000865af19150503d80600081146101ab576040519150601f19603f3d011682016040523d82523d6000602084013e6101b0565b606091505b50505080806101be90610809565b915050610104565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024f90610703565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160405161029e90610877565b60006040518083038185875af1925050503d80600081146102db576040519150601f19603f3d011682016040523d82523d6000602084013e6102e0565b606091505b50505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610348826102ff565b810181811067ffffffffffffffff8211171561036757610366610310565b5b80604052505050565b600061037a6102e6565b9050610386828261033f565b919050565b600067ffffffffffffffff8211156103a6576103a5610310565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f1826103c6565b9050919050565b610401816103e6565b811461040c57600080fd5b50565b60008135905061041e816103f8565b92915050565b600080fd5b600067ffffffffffffffff82111561044457610443610310565b5b61044d826102ff565b9050602081019050919050565b82818337600083830152505050565b600061047c61047784610429565b610370565b90508281526020810184848401111561049857610497610424565b5b6104a384828561045a565b509392505050565b600082601f8301126104c0576104bf6102fa565b5b81356104d0848260208601610469565b91505092915050565b6000604082840312156104ef576104ee6103bc565b5b6104f96040610370565b905060006105098482850161040f565b600083015250602082013567ffffffffffffffff81111561052d5761052c6103c1565b5b610539848285016104ab565b60208301525092915050565b60006105586105538461038b565b610370565b9050808382526020820190506020840283018581111561057b5761057a6103b7565b5b835b818110156105c257803567ffffffffffffffff8111156105a05761059f6102fa565b5b8086016105ad89826104d9565b8552602085019450505060208101905061057d565b5050509392505050565b600082601f8301126105e1576105e06102fa565b5b81356105f1848260208601610545565b91505092915050565b6000602082840312156106105761060f6102f0565b5b600082013567ffffffffffffffff81111561062e5761062d6102f5565b5b61063a848285016105cc565b91505092915050565b6000819050919050565b61065681610643565b811461066157600080fd5b50565b6000813590506106738161064d565b92915050565b60006020828403121561068f5761068e6102f0565b5b600061069d84828501610664565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000600082015250565b60006106ed6017836106a6565b91506106f8826106b7565b602082019050919050565b6000602082019050818103600083015261071c816106e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561078657808201518184015260208101905061076b565b60008484015250505050565b600061079d82610752565b6107a7818561075d565b93506107b7818560208601610768565b80840191505092915050565b60006107cf8284610792565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061081482610643565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610846576108456107da565b5b600182019050919050565b50565b600061086160008361075d565b915061086c82610851565b600082019050919050565b600061088282610854565b915081905091905056fea264697066735822122036692b46567a60a4f6844f8be0961cccba9ff2777bd37b4ea35791aba4c5159b64736f6c63430008120033