Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to verify contracts with doubled metadata hash #851

Closed
tster opened this issue Nov 22, 2022 · 15 comments · Fixed by #1342
Closed

Unable to verify contracts with doubled metadata hash #851

tster opened this issue Nov 22, 2022 · 15 comments · Fixed by #1342
Assignees

Comments

@tster
Copy link
Contributor

tster commented Nov 22, 2022

I'm trying to verify a contract on the Canto network (chain ID 7700) with Sourcify to no avail. The error being thrown on the Sourcify frontend is Contract name: BaseV1Factory. The deployed and recompiled bytecode don't match.

Upon manually recompiling the contract with the correct compiler version (0.8.11) and optimization settings (enabled, 200 runs), the only differences in the bytecode are located at the very end of the bytecode -- specifically in the last ~100 bytes. The recompiled bytecode appears to have two metadata hashes.

I can't find any information online about bytecode having multiple metadata hashes but it might be that the source file contains two separate contracts.

I believe these are indeed metadata hashes because they conform to the encoding described in the Solidity docs, containing bytes sequences such as 736f6c63 (solc).

Expected behavior Per the Sourcify docs, if the only difference in the bytecode is the metadata hash, the contract should be successfully verified with a partial match.

Presumably, in cases where there are multiple metadata hashes, the contract should still be successfully verified with a partial match even if both of the hashes differ in the deployed bytecode.

Details/links The contract in question: https://evm.explorer.canto.io/address/0xE387067f12561e579C5f7d4294f51867E0c1cFba

Source code: (this issue pertains to contract BaseV1Factory located in BaseV1-core.sol): https://github.com/Canto-Network/clm/tree/8e030d33ced2f8d63667659475aadd661f3d7972/src/Swap

Recompiled bytecode:

0x6080604052610e1060035534801561001657600080fd5b50600080546001600160a81b03191633610100810260ff1916919091178255600280546001600160a01b0319169091179055614c2a90819061005890396000f3fe60806040523480156200001157600080fd5b5060043610620001155760003560e01c80639aab924811620000a3578063e5e31b13116200006e578063e5e31b13146200025c578063eb13c4cf1462000282578063ed12c5b414620002bb578063f851a44014620002d257600080fd5b80639aab924814620002035780639fd0506d146200020d578063b187bd261462000226578063bedb86fb146200024557600080fd5b80636801cc3011620000e45780636801cc301462000184578063704b6c0214620001c157806382dfdce414620001d85780639a7165e414620001ef57600080fd5b8063167a6f90146200011a5780631e3dd18b14620001265780632d88af4a146200015a578063574f2ba31462000171575b600080fd5b62000124620002e6565b005b6200013d62000137366004620007f4565b62000329565b6040516001600160a01b0390911681526020015b60405180910390f35b620001246200016b3660046200082b565b62000354565b6005545b60405190815260200162000151565b6200013d6200019536600462000861565b60046020908152600093845260408085208252928452828420905282529020546001600160a01b031681565b62000124620001d23660046200082b565b62000393565b6200013d620001e936600462000861565b620003cd565b6001546200013d906001600160a01b031681565b62000175620006bd565b6000546200013d9061010090046001600160a01b031681565b600054620002349060ff1681565b604051901515815260200162000151565b6200012462000256366004620008ab565b620006f1565b620002346200026d3660046200082b565b60066020526000908152604090205460ff1681565b600754600854604080516001600160a01b0393841681529282166020840152600160a01b90910460ff1615159082015260600162000151565b62000124620002cc366004620007f4565b62000721565b6002546200013d906001600160a01b031681565b6001546001600160a01b03163314620002fe57600080fd5b600154600080546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600581815481106200033a57600080fd5b6000918252602090912001546001600160a01b0316905081565b60005461010090046001600160a01b031633146200037157600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b03163314620003ab57600080fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000826001600160a01b0316846001600160a01b031614156200041c5760405162461bcd60e51b8152602060048201526002602482015261494160f01b60448201526064015b60405180910390fd5b600080846001600160a01b0316866001600160a01b0316106200044157848662000444565b85855b90925090506001600160a01b038216620004865760405162461bcd60e51b81526020600482015260026024820152615a4160f01b604482015260640162000413565b6001600160a01b0382811660009081526004602090815260408083208585168452825280832088151584529091529020541615620004ec5760405162461bcd60e51b8152602060048201526002602482015261504560f01b604482015260640162000413565b6040516bffffffffffffffffffffffff19606084811b8216602084015283901b16603482015284151560f81b604882015260009060490160408051601f19818403018152908290528051602090910120600880546001600160a01b038087166001600160a01b03198b1515600160a01b0281166001600160a81b031990941693909317179092556007805492881692909116919091179055915081906200059390620007e6565b8190604051809103906000f5905080158015620005b4573d6000803e3d6000fd5b506001600160a01b0384811660008181526004602081815260408084208987168086529083528185208d15158087529084528286208054988a166001600160a01b0319998a16811790915582875294845282862087875284528286208187528452828620805489168617905560058054600181810183557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db09091018054909a1687179099558587526006855295839020805460ff1916909817909755935481519687529186019290925290840152929650907fc4805696c66d7cf352fc1d6bb633ad5ee82f6cb577c453024b6e0eb8306c6fc99060600160405180910390a35050509392505050565b600060405180602001620006d190620007e6565b6020820181038252601f19601f8201166040525080519060200120905090565b60005461010090046001600160a01b031633146200070e57600080fd5b6000805460ff1916911515919091179055565b6002546001600160a01b031633146200073957600080fd5b6003548111156200074957600080fd5b60005b600554811015620007e257600581815481106200076d576200076d620008c9565b600091825260209091200154604051633b44b16d60e21b8152600481018490526001600160a01b039091169063ed12c5b490602401600060405180830381600087803b158015620007bd57600080fd5b505af1158015620007d2573d6000803e3d6000fd5b505050508060010190506200074c565b5050565b61431580620008e083390190565b6000602082840312156200080757600080fd5b5035919050565b80356001600160a01b03811681146200082657600080fd5b919050565b6000602082840312156200083e57600080fd5b62000849826200080e565b9392505050565b803580151581146200082657600080fd5b6000806000606084860312156200087757600080fd5b62000882846200080e565b925062000892602085016200080e565b9150620008a26040850162000850565b90509250925092565b600060208284031215620008be57600080fd5b620008498262000850565b634e487b7160e01b600052603260045260246000fdfe610140604052600060025561070860075560016011553480156200002257600080fd5b50336001600160a01b031660e0816001600160a01b0316815250506000806000336001600160a01b031663eb13c4cf6040518163ffffffff1660e01b8152600401606060405180830381865afa15801562000081573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000a791906200078e565b801580156080526001600160a01b0380841660c052841660a0529295509093509150620002ec57826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156200010d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000137919081019062000829565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000176573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620001a0919081019062000829565b604051602001620001b3929190620008e1565b60405160208183030381529060405260009080519060200190620001d9929190620006cb565b50826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000219573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000243919081019062000829565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000282573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620002ac919081019062000829565b604051602001620002bf9291906200093c565b60405160208183030381529060405260019080519060200190620002e5929190620006cb565b5062000505565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156200032b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000355919081019062000829565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000394573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620003be919081019062000829565b604051602001620003d19291906200098d565b60405160208183030381529060405260009080519060200190620003f7929190620006cb565b50826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000437573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000461919081019062000829565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620004a0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620004ca919081019062000829565b604051602001620004dd929190620009ea565b6040516020818303038152906040526001908051906020019062000503929190620006cb565b505b826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000544573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200056a919062000a0c565b6200057790600a62000b4d565b6101008181525050816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620005be573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620005e4919062000a0c565b620005f190600a62000b4d565b610120525050604080516080810182524281526000602082018181529282018181526060830182815260088054600181018255935292517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee360049093029283015592517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee482015591517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee5830155517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee6909101555062000b9b565b828054620006d99062000b5e565b90600052602060002090601f016020900481019282620006fd576000855562000748565b82601f106200071857805160ff191683800117855562000748565b8280016001018555821562000748579182015b82811115620007485782518255916020019190600101906200072b565b50620007569291506200075a565b5090565b5b808211156200075657600081556001016200075b565b80516001600160a01b03811681146200078957600080fd5b919050565b600080600060608486031215620007a457600080fd5b620007af8462000771565b9250620007bf6020850162000771565b915060408401518015158114620007d557600080fd5b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000813578181015183820152602001620007f9565b8381111562000823576000848401525b50505050565b6000602082840312156200083c57600080fd5b81516001600160401b03808211156200085457600080fd5b818401915084601f8301126200086957600080fd5b8151818111156200087e576200087e620007e0565b604051601f8201601f19908116603f01168101908382118183101715620008a957620008a9620007e0565b81604052828152876020848701011115620008c357600080fd5b620008d6836020830160208801620007f6565b979650505050505050565b6e029ba30b13632ab189020a6a690169608d1b8152600083516200090d81600f850160208801620007f6565b602f60f81b600f91840191820152835162000930816010840160208801620007f6565b01601001949350505050565b6473414d4d2d60d81b8152600083516200095e816005850160208801620007f6565b602f60f81b600591840191820152835162000981816006840160208801620007f6565b01600601949350505050565b7002b37b630ba34b632ab189020a6a690169607d1b815260008351620009bb816011850160208801620007f6565b602f60f81b6011918401918201528351620009de816012840160208801620007f6565b01601201949350505050565b6476414d4d2d60d81b8152600083516200095e816005850160208801620007f6565b60006020828403121562000a1f57600080fd5b815160ff8116811462000a3157600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111562000a8f57816000190482111562000a735762000a7362000a38565b8085161562000a8157918102915b93841c939080029062000a53565b509250929050565b60008262000aa85750600162000b47565b8162000ab75750600062000b47565b816001811462000ad0576002811462000adb5762000afb565b600191505062000b47565b60ff84111562000aef5762000aef62000a38565b50506001821b62000b47565b5060208310610133831016604e8410600b841016171562000b20575081810a62000b47565b62000b2c838362000a4e565b806000190482111562000b435762000b4362000a38565b0290505b92915050565b600062000a3160ff84168362000a97565b600181811c9082168062000b7357607f821691505b6020821081141562000b9557634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e051610100516101205161364a62000ccb6000396000818161047101528181611acc0152818161295801528181612a1a0152612b2501526000818161044e01528181611a8b0152818161291901528181612a5c0152612aff01526000818161081001526122020152600081816104fb015281816106770152818161071b0152818161094b01528181610c070152818161146d015281816116f801528181611c7c015261258401526000818161030f015281816104d3015281816106520152818161092a01528181610be5015281816113d7015281816116d601528181611c5a015281816124fc0152818161299a015281816129e101528181612ac60152612b690152600081816103c0015281816104a301528181611a6301526128e5015261364a6000f3fe608060405234801561001057600080fd5b506004361061028a5760003560e01c806389afcb441161015c578063c5700a02116100ce578063ebeb31db11610087578063ebeb31db14610797578063ed12c5b41461079f578063f140a35a146107b2578063f3f24eb1146107c5578063f99f51a6146107ce578063fff6cae9146107ef57600080fd5b8063c5700a021461070d578063d21220a714610716578063d505accf1461073d578063dd62ed3e14610750578063e4463eb21461077b578063eba6aef91461078457600080fd5b80639e8cc04b116101205780639e8cc04b146106a25780639f767c88146106b5578063a9059cbb146106d5578063bc25cf77146106e8578063bf944dbc146106fb578063c245febc1461070457600080fd5b806389afcb44146105db5780638a7b8cf2146105ee57806395d89b41146106295780639cf42614146106315780639d63848a1461064457600080fd5b806323b872dd116102005780635881c475116101b95780635881c475146105445780635a76f25e146105575780636a6278421461056057806370a08231146105735780637ecebe00146105935780638334278d146105b357600080fd5b806323b872dd146103e2578063252c09d7146103f5578063313ce56714610428578063392f37e914610442578063443cb4bc14610528578063517b3f821461053157600080fd5b806313345fe11161025257806313345fe11461034957806318160ddd146103695780631df8c717146103805780631ed4202e14610388578063205aabf11461039b57806322be3de1146103bb57600080fd5b8063022c0d9f1461028f57806306fdde03146102a45780630902f1ac146102c2578063095ea7b3146102e75780630dfe16811461030a575b600080fd5b6102a261029d366004613041565b6107f7565b005b6102ac610da4565b6040516102b99190613105565b60405180910390f35b600954600a54600b545b604080519384526020840192909252908201526060016102b9565b6102fa6102f5366004613138565b610e32565b60405190151581526020016102b9565b6103317f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016102b9565b61035c610357366004613162565b610e9f565b6040516102b991906131d6565b61037260025481565b6040519081526020016102b9565b6102cc6110d0565b6103726103963660046131e9565b61113f565b6103726103a9366004613202565b60106020526000908152604090205481565b6102fa7f000000000000000000000000000000000000000000000000000000000000000081565b6102fa6103f036600461321d565b61119e565b6104086104033660046131e9565b611267565b6040805194855260208501939093529183015260608201526080016102b9565b610430601281565b60405160ff90911681526020016102b9565b600954600a54604080517f000000000000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060208201529081019290925260608201527f0000000000000000000000000000000000000000000000000000000000000000151560808201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660a08301527f00000000000000000000000000000000000000000000000000000000000000001660c082015260e0016102b9565b61037260095481565b61037261053f366004613138565b6112a1565b61035c610552366004613259565b611394565b610372600a5481565b61037261056e366004613202565b6113a3565b610372610581366004613202565b60046020526000908152604090205481565b6103726105a1366004613202565b60066020526000908152604090205481565b6105c66105c13660046131e9565b611600565b604080519283526020830191909152016102b9565b6105c66105e9366004613202565b6116a4565b6105f66119c1565b6040516102b991908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b6102ac611a52565b61037261063f36600461328c565b611a5f565b604080516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811682527f0000000000000000000000000000000000000000000000000000000000000000166020820152016102b9565b6103726106b0366004613259565b611bab565b6103726106c3366004613202565b600f6020526000908152604090205481565b6102fa6106e3366004613138565b611c18565b6102a26106f6366004613202565b611c2e565b610372600c5481565b610372600d5481565b610372600b5481565b6103317f000000000000000000000000000000000000000000000000000000000000000081565b6102a261074b3660046132ae565b611d4c565b61037261075e366004613321565b600360209081526000928352604080842090915290825290205481565b61037260075481565b61035c61079236600461328c565b612041565b600854610372565b6102a26107ad3660046131e9565b6121f7565b6103726107c0366004613354565b612231565b610372600e5481565b6107e16107dc36600461328c565b612250565b6040516102b9929190613377565b6102a26124cf565b60115460011461080657600080fd5b60026011819055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b187bd266040518163ffffffff1660e01b8152600401602060405180830381865afa15801561086c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610890919061339c565b1561089a57600080fd5b60008511806108a95750600084115b6108e05760405162461bcd60e51b8152602060048201526003602482015262494f4160e81b60448201526064015b60405180910390fd5b600954600a5481871080156108f457508086105b6109255760405162461bcd60e51b8152602060048201526002602482015261125360f21b60448201526064016108d7565b6000807f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03898116908316148015906109985750806001600160a01b0316896001600160a01b031614155b6109c95760405162461bcd60e51b8152602060048201526002602482015261125560f21b60448201526064016108d7565b8a156109da576109da828a8d612609565b89156109eb576109eb818a8c612609565b8615610a5857604051639a7bff7960e01b81526001600160a01b038a1690639a7bff7990610a259033908f908f908e908e906004016133be565b600060405180830381600087803b158015610a3f57600080fd5b505af1158015610a53573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac0919061340a565b6040516370a0823160e01b81523060048201529094506001600160a01b038216906370a0823190602401602060405180830381865afa158015610b07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2b919061340a565b9250505060008985610b3d9190613439565b8311610b4a576000610b5e565b610b548a86613439565b610b5e9084613439565b90506000610b6c8a86613439565b8311610b79576000610b8d565b610b838a86613439565b610b8d9084613439565b90506000821180610b9e5750600081115b610bd05760405162461bcd60e51b815260206004820152600360248201526249494160e81b60448201526064016108d7565b6040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610c58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7c919061340a565b6040516370a0823160e01b81523060048201529096506001600160a01b038216906370a0823190602401602060405180830381865afa158015610cc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce7919061340a565b9450610cf38888611a5f565b610cfd8787611a5f565b1015610d2f5760405162461bcd60e51b81526020600482015260016024820152604b60f81b60448201526064016108d7565b5050610d3d848488886126f8565b60408051838152602081018390529081018c9052606081018b90526001600160a01b038a169033907fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229060800160405180910390a350506001601155505050505050505050565b60008054610db190613450565b80601f0160208091040260200160405190810160405280929190818152602001828054610ddd90613450565b8015610e2a5780601f10610dff57610100808354040283529160200191610e2a565b820191906000526020600020905b815481529060010190602001808311610e0d57829003601f168201915b505050505081565b3360008181526003602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610e8d9086815260200190565b60405180910390a35060015b92915050565b606060008367ffffffffffffffff811115610ebc57610ebc613485565b604051908082528060200260200182016040528015610ee5578160200160208202803683370190505b50600854909150600090610efb90600190613439565b9050610f07848661349b565b811015610f265760405162461bcd60e51b81526004016108d7906134ba565b6000610f32858761349b565b610f3c9083613439565b90506000805b838310156110c057610f5487846134f1565b9150600060088481548110610f6b57610f6b613509565b90600052602060002090600402016000015460088481548110610f9057610f90613509565b906000526020600020906004020160000154610fac9190613439565b905060008160088681548110610fc457610fc4613509565b90600052602060002090600402016001015460088681548110610fe957610fe9613509565b9060005260206000209060040201600101546110059190613439565b61100f919061351f565b90506000826008878154811061102757611027613509565b9060005260206000209060040201600201546008878154811061104c5761104c613509565b9060005260206000209060040201600201546110689190613439565b611072919061351f565b90506110808c8e84846128e1565b88858151811061109257611092613509565b60209081029190910101526110a88460016134f1565b935050505086836110b991906134f1565b9250610f42565b509293505050505b949350505050565b600c54600d5442600080806110ee600954600a54600b549192909190565b9250925092508381146111375760006111078286613439565b9050611113818561349b565b61111d90886134f1565b9650611129818461349b565b61113390876134f1565b9550505b505050909192565b60008061114d836001612041565b90506000805b82518110156111935782818151811061116e5761116e613509565b60200260200101518261118191906134f1565b915061118c81613541565b9050611153565b506110c8848261351f565b6001600160a01b0383166000818152600360209081526040808320338085529252822054919290919082148015906111d857506000198114155b1561124e5760006111e98583613439565b6001600160a01b038881166000818152600360209081526040808320948916808452948252918290208590559051848152939450919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505b611259868686612bd6565b6001925050505b9392505050565b6008818154811061127757600080fd5b60009182526020909120600490910201805460018201546002830154600390930154919350919084565b6000806112ac6119c1565b90506000806112b96110d0565b508451919350915042141561132c57600880546112d890600290613439565b815481106112e8576112e8613509565b906000526020600020906004020160405180608001604052908160008201548152602001600182015481526020016002820154815260200160038201548152505092505b825160009061133b9042613439565b90506000818560200151856113509190613439565b61135a919061351f565b905060008286604001518561136f9190613439565b611379919061351f565b9050611387888a84846128e1565b9998505050505050505050565b60606110c88484846001610e9f565b60006011546001146113b457600080fd5b6002601155600954600a546040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144a919061340a565b6040516370a0823160e01b81523060048201529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa1580156114b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d8919061340a565b905060006114e68584613439565b905060006114f48584613439565b60025490915080611532576103e861151461150f848661349b565b612c84565b61151e9190613439565b975061152d60006103e8612cf4565b611567565b61156487611540838661349b565b61154a919061351f565b87611555848661349b565b61155f919061351f565b612d7e565b97505b6000881161159d5760405162461bcd60e51b8152602060048201526003602482015262494c4d60e81b60448201526064016108d7565b6115a78989612cf4565b6115b3858589896126f8565b604080518481526020810184905233917f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f910160405180910390a250506001601155509395945050505050565b600080600080611611856001612250565b9150915060008060005b84518110156116825784818151811061163657611636613509565b60200260200101518361164991906134f1565b925083818151811061165d5761165d613509565b60200260200101518261167091906134f1565b915061167b81613541565b905061161b565b5061168d878361351f565b611697888361351f565b9550955050505050915091565b6000806011546001146116b657600080fd5b6002601155600954600a546040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000906000906001600160a01b038416906370a0823190602401602060405180830381865afa15801561174c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611770919061340a565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156117ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117de919061340a565b306000908152600460205260409020546002549192509080611800858461349b565b61180a919061351f565b995080611817848461349b565b611821919061351f565b985060008a1180156118335750600089115b6118655760405162461bcd60e51b815260206004820152600360248201526224a62160e91b60448201526064016108d7565b61186f3083612d94565b61187a868c8c612609565b611885858c8b612609565b6040516370a0823160e01b81523060048201526001600160a01b038716906370a0823190602401602060405180830381865afa1580156118c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ed919061340a565b6040516370a0823160e01b81523060048201529094506001600160a01b038616906370a0823190602401602060405180830381865afa158015611934573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611958919061340a565b925061196684848a8a6126f8565b604080518b8152602081018b90526001600160a01b038d169133917fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496910160405180910390a350505050505050506001601181905550915091565b6119ec6040518060800160405280600081526020016000815260200160008152602001600081525090565b600880546119fc90600190613439565b81548110611a0c57611a0c613509565b9060005260206000209060040201604051806080016040529081600082015481526020016001820154815260200160028201548152602001600382015481525050905090565b60018054610db190613450565b60007f000000000000000000000000000000000000000000000000000000000000000015611b9a5760007f0000000000000000000000000000000000000000000000000000000000000000611abc85670de0b6b3a764000061349b565b611ac6919061351f565b905060007f0000000000000000000000000000000000000000000000000000000000000000611afd85670de0b6b3a764000061349b565b611b07919061351f565b90506000670de0b6b3a7640000611b1e838561349b565b611b28919061351f565b90506000670de0b6b3a7640000611b3f848061349b565b611b49919061351f565b670de0b6b3a7640000611b5c868061349b565b611b66919061351f565b611b7091906134f1565b9050670de0b6b3a7640000611b85828461349b565b611b8f919061351f565b945050505050610e99565b611ba4828461349b565b9050610e99565b600080611bbb8585856001610e9f565b90506000805b8251811015611c0357828181518110611bdc57611bdc613509565b602002602001015182611bef91906134f1565b915080611bfb81613541565b915050611bc1565b50611c0e848261351f565b9695505050505050565b6000611c25338484612bd6565b50600192915050565b601154600114611c3d57600080fd5b60026011556009546040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091611d0a9184918691906001600160a01b038416906370a08231906024015b602060405180830381865afa158015611cd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cfb919061340a565b611d059190613439565b612609565b600a546040516370a0823160e01b8152306004820152611d429183918691906001600160a01b038416906370a0823190602401611cba565b5050600160115550565b42841015611d8e5760405162461bcd60e51b815260206004820152600f60248201526e10985cd9558c4e8811561412549151608a1b60448201526064016108d7565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051611dbe919061355c565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160408051601f19818403018152918152815160209283012060058190556001600160a01b038a166000908152600690935290822080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918b918b918b919087611e7483613541565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e00160405160208183030381529060405280519060200120604051602001611eed92919061190160f01b81526002810192909252602282015260420190565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015611f58573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590611f8e5750886001600160a01b0316816001600160a01b0316145b611fda5760405162461bcd60e51b815260206004820152601960248201527f4261736556313a20494e56414c49445f5349474e41545552450000000000000060448201526064016108d7565b6001600160a01b038981166000818152600360209081526040808320948d16808452948252918290208b905590518a81527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050505050505050565b606060008367ffffffffffffffff81111561205e5761205e613485565b604051908082528060200260200182016040528015612087578160200160208202803683370190505b5060085490915060009061209d90600190613439565b90506120a9848661349b565b8110156120c85760405162461bcd60e51b81526004016108d7906134ba565b60006120d4858761349b565b6120de9083613439565b905060008060005b848410156121ea576120f888856134f1565b92506008848154811061210d5761210d613509565b9060005260206000209060040201600001546008848154811061213257612132613509565b90600052602060002090600402016000015461214e9190613439565b9050806008858154811061216457612164613509565b9060005260206000209060040201600301546008858154811061218957612189613509565b9060005260206000209060040201600301546121a59190613439565b6121af919061351f565b8683815181106121c1576121c1613509565b60209081029190910101526121d78260016134f1565b91506121e388856134f1565b93506120e6565b5093979650505050505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461222c57600080fd5b600755565b600954600a5460009190612247858584846128e1565b95945050505050565b60608060008467ffffffffffffffff81111561226e5761226e613485565b604051908082528060200260200182016040528015612297578160200160208202803683370190505b50905060008567ffffffffffffffff8111156122b5576122b5613485565b6040519080825280602002602001820160405280156122de578160200160208202803683370190505b506008549091506000906122f490600190613439565b9050612300868861349b565b81101561231f5760405162461bcd60e51b81526004016108d7906134ba565b600061232b878961349b565b6123359083613439565b905060008060005b848410156124be5761234f8a856134f1565b92506008848154811061236457612364613509565b9060005260206000209060040201600001546008848154811061238957612389613509565b9060005260206000209060040201600001546123a59190613439565b905080600885815481106123bb576123bb613509565b906000526020600020906004020160010154600885815481106123e0576123e0613509565b9060005260206000209060040201600101546123fc9190613439565b612406919061351f565b87838151811061241857612418613509565b602002602001018181525050806008858154811061243857612438613509565b9060005260206000209060040201600201546008858154811061245d5761245d613509565b9060005260206000209060040201600201546124799190613439565b612483919061351f565b86838151811061249557612495613509565b60209081029190910101526124ab8260016134f1565b91506124b78a856134f1565b935061233d565b509499939850929650505050505050565b6011546001146124de57600080fd5b60026011556040516370a0823160e01b8152306004820152612602907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561254b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061256f919061340a565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156125d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125f7919061340a565b600954600a546126f8565b6001601155565b6000836001600160a01b03163b1161262057600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009283929087169161267c91906135f8565b6000604051808303816000865af19150503d80600081146126b9576040519150601f19603f3d011682016040523d82523d6000602084013e6126be565b606091505b50915091508180156126e85750805115806126e85750808060200190518101906126e8919061339c565b6126f157600080fd5b5050505050565b600b54429060009061270a9083613439565b905060008111801561271b57508315155b801561272657508215155b1561279157612735818561349b565b600c600082825461274691906134f1565b909155506127569050818461349b565b600d600082825461276791906134f1565b909155505060025461277a90829061349b565b600e600082825461278b91906134f1565b90915550505b600061279b6119c1565b80519091506127aa9084613439565b91506007548211156128905760408051608081018252848152600c5460208201908152600d54928201928352600e54606083019081526008805460018101825560009190915292517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee360049094029384015590517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee483015591517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee582015590517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee6909101555b6009879055600a869055600b83905560408051888152602081018890527fcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a910160405180910390a150505050505050565b60007f000000000000000000000000000000000000000000000000000000000000000015612b645760006129158484611a5f565b90507f000000000000000000000000000000000000000000000000000000000000000061294a85670de0b6b3a764000061349b565b612954919061351f565b93507f000000000000000000000000000000000000000000000000000000000000000061298984670de0b6b3a764000061349b565b612993919061351f565b92506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b0316146129d85784866129db565b85855b915091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b031614612a5a577f0000000000000000000000000000000000000000000000000000000000000000612a4b89670de0b6b3a764000061349b565b612a55919061351f565b612a97565b7f0000000000000000000000000000000000000000000000000000000000000000612a8d89670de0b6b3a764000061349b565b612a97919061351f565b97506000612aaf612aa8848b6134f1565b8584612e16565b612ab99083613439565b9050670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316896001600160a01b031614612b23577f0000000000000000000000000000000000000000000000000000000000000000612b45565b7f00000000000000000000000000000000000000000000000000000000000000005b612b4f908361349b565b612b59919061351f565b9450505050506110c8565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031614612ba7578385612baa565b84845b9092509050612bb987836134f1565b612bc3828961349b565b612bcd919061351f565b925050506110c8565b6001600160a01b03831660009081526004602052604081208054839290612bfe908490613439565b90915550506001600160a01b03821660009081526004602052604081208054839290612c2b9084906134f1565b92505081905550816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612c7791815260200190565b60405180910390a3505050565b60006003821115612ce55750806000612c9e60028361351f565b612ca99060016134f1565b90505b81811015612cdf57905080600281612cc4818661351f565b612cce91906134f1565b612cd8919061351f565b9050612cac565b50919050565b8115612cef575060015b919050565b8060026000828254612d0691906134f1565b90915550506001600160a01b03821660009081526004602052604081208054839290612d339084906134f1565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050565b6000818310612d8d5781611260565b5090919050565b8060026000828254612da69190613439565b90915550506001600160a01b03821660009081526004602052604081208054839290612dd3908490613439565b90915550506040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612d72565b6000805b60ff811015612f1c57826000612e308783612f25565b905085811015612e80576000612e468887612fc2565b612e508389613439565b612e6290670de0b6b3a764000061349b565b612e6c919061351f565b9050612e7881876134f1565b955050612ec2565b6000612e8c8887612fc2565b612e968884613439565b612ea890670de0b6b3a764000061349b565b612eb2919061351f565b9050612ebe8187613439565b9550505b81851115612eeb576001612ed68387613439565b11612ee657849350505050611260565b612f07565b6001612ef78684613439565b11612f0757849350505050611260565b50508080612f1490613541565b915050612e1a565b50909392505050565b6000670de0b6b3a764000082818581612f3e828061349b565b612f48919061351f565b612f52919061349b565b612f5c919061351f565b612f66919061349b565b612f70919061351f565b670de0b6b3a7640000808481612f86828061349b565b612f90919061351f565b612f9a919061349b565b612fa4919061351f565b612fae908661349b565b612fb8919061351f565b61126091906134f1565b6000670de0b6b3a76400008381612fd9828061349b565b612fe3919061351f565b612fed919061349b565b612ff7919061351f565b670de0b6b3a76400008061300b858061349b565b613015919061351f565b61302086600361349b565b612fae919061349b565b80356001600160a01b0381168114612cef57600080fd5b60008060008060006080868803121561305957600080fd5b85359450602086013593506130706040870161302a565b9250606086013567ffffffffffffffff8082111561308d57600080fd5b818801915088601f8301126130a157600080fd5b8135818111156130b057600080fd5b8960208285010111156130c257600080fd5b9699959850939650602001949392505050565b60005b838110156130f05781810151838201526020016130d8565b838111156130ff576000848401525b50505050565b60208152600082518060208401526131248160408501602087016130d5565b601f01601f19169190910160400192915050565b6000806040838503121561314b57600080fd5b6131548361302a565b946020939093013593505050565b6000806000806080858703121561317857600080fd5b6131818561302a565b966020860135965060408601359560600135945092505050565b600081518084526020808501945080840160005b838110156131cb578151875295820195908201906001016131af565b509495945050505050565b602081526000611260602083018461319b565b6000602082840312156131fb57600080fd5b5035919050565b60006020828403121561321457600080fd5b6112608261302a565b60008060006060848603121561323257600080fd5b61323b8461302a565b92506132496020850161302a565b9150604084013590509250925092565b60008060006060848603121561326e57600080fd5b6132778461302a565b95602085013595506040909401359392505050565b6000806040838503121561329f57600080fd5b50508035926020909101359150565b600080600080600080600060e0888a0312156132c957600080fd5b6132d28861302a565b96506132e06020890161302a565b95506040880135945060608801359350608088013560ff8116811461330457600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561333457600080fd5b61333d8361302a565b915061334b6020840161302a565b90509250929050565b6000806040838503121561336757600080fd5b8235915061334b6020840161302a565b60408152600061338a604083018561319b565b8281036020840152612247818561319b565b6000602082840312156133ae57600080fd5b8151801515811461126057600080fd5b60018060a01b038616815284602082015283604082015260806060820152816080820152818360a0830137600081830160a090810191909152601f909201601f19160101949350505050565b60006020828403121561341c57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561344b5761344b613423565b500390565b600181811c9082168061346457607f821691505b60208210811415612cdf57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60008160001904831182151516156134b5576134b5613423565b500290565b6020808252601b908201527f504149523a3a4e4f5420524541445920464f522050524943494e470000000000604082015260600190565b6000821982111561350457613504613423565b500190565b634e487b7160e01b600052603260045260246000fd5b60008261353c57634e487b7160e01b600052601260045260246000fd5b500490565b600060001982141561355557613555613423565b5060010190565b600080835481600182811c91508083168061357857607f831692505b602080841082141561359857634e487b7160e01b86526022600452602486fd5b8180156135ac57600181146135bd576135ea565b60ff198616895284890196506135ea565b60008a81526020902060005b868110156135e25781548b8201529085019083016135c9565b505084890196505b509498975050505050505050565b6000825161360a8184602087016130d5565b919091019291505056fea26469706673582212204821d8e8821b11c85366edaadfce5a889446fd79c95a019c193175f24bd844e164736f6c634300080b0033a2646970667358221220bf3f6b861220109ff59d3be40090441370e8ee3e84837c056ac41b7ab0dbc8e864736f6c634300080b0033

View in Huly HI-442

@marcocastignoli
Copy link
Member

I'll look at this tomorrow but there is no such a thing as two metadata hashes as far as I know. This is the decoded bytecode (using https://playground.sourcify.dev/). I used the or paste contract bytecode option.

image

@kuzdogan
Copy link
Member

kuzdogan commented Nov 23, 2022

Yes I can see another "auxdata" section before the green highlighted one (ends with 0033) again.

Do you have the metadata of the deployed contract? It should be in the build artifacts. Or maybe the complete compilation settings? This behaviour is really weird and should not happen with the compiler unless the the contract deployer adds this manually when creating the contract

@tster
Copy link
Contributor Author

tster commented Nov 23, 2022

Exactly. There are two 53 byte sequences starting a264 and ending 0033.

Unfortunately I do not have access to the original metadata at this time. I am relatively confident it was compiled with 0.8.11 with 200 optimizer runs enabled. It seems that the metadata hashes are super sensitive, though -- e.g. minor changes to the filepath seem to affect them.

FWIW I have tried compiling the source through two different environments (Foundry and Remix) and in both cases I get two metadata hashes at the end.

@kuzdogan
Copy link
Member

I see the project uses Foundry. You can find the metadata in out/MyContract.sol/MyContract.json under "rawMetadata". You can also drag&drop the whole project directory into https://sourcify.dev/#/verifier without the need to manually recompile the contract. The metadata changes with even a slightest change on the compilation settings or even a byte in the source files

@kuzdogan
Copy link
Member

I see, I assumed you have access to the original metadata. Let me see if I can reproduce this.

@tster
Copy link
Contributor Author

tster commented Nov 23, 2022

Thanks! I will keep asking for the original metadata but it would be nice to get a partial match if it cannot be found (the contract was deployed 3 months ago), or at least understand what is causing the double hash.

@kuzdogan
Copy link
Member

A partial match will not be possible with the double hash because the hash before the last appended one is also changing.

A partial match is done by trimming the appended CBOR section (auxdata) of both the on-chain bytecode and the recompiled bytecode and seeing if they match. Here only the second auxdata will be trimmed out and the first auxdatas will be different in the bytecodes, avoiding a bytecode match. Here are the auxdatas for illustration:

==kuzdogan's recompiled==
a2646970667358221220 92cd79116627ad2592b26d4c4ef990465c18e66db67c36b221878d2bcba03ae2 64736f6c634300080b0033
a2646970667358221220 9852e3f98ff360e76e93348978fdd25b58b46ff0566719a78d0b41ed626465a1 64736f6c634300080b0033

==deployed==
a2646970667358221220 3c3fcd0160262f7289c5b6ceef5d82c0ab9d4c7dea5fbcbc2649a8857a795f68 64736f6c634300080b0033
a2646970667358221220 e2fe4b05758f5ea22cecc572f02185dc4b90b9de836a56996a39e4a9e18aa238 64736f6c634300080b0033

==tster's recompiled==
a2646970667358221220 4821d8e8821b11c85366edaadfce5a889446fd79c95a019c193175f24bd844e1 64736f6c634300080b0033
a2646970667358221220 bf3f6b861220109ff59d3be40090441370e8ee3e84837c056ac41b7ab0dbc8e8 64736f6c634300080b0033

@kuzdogan
Copy link
Member

It seems this is because this contract is a factory so it's a nested contract code. Indeed the bytecode of the BaseV1Pair is nested in the BaseV1Factory's bytecode:

BaseV1Pair (creation) bytecode:

0x610140604052600060025561070860075560016011553...a264697066735822122092cd79116627ad2592b26d4c4ef990465c18e66db67c36b221878d2bcba03ae264736f6c634300080b0033

BaseV1Factory (creation) bytecode:

0x6080604052610...61014060405260006002556107086007556001601155......a264697066735822122092cd79116627ad2592b26d4c4ef990465c18e66db67c36b221878d2bcba03ae264736f6c634300080b0033 (second auxdata starts) a26469706673582212209852e3f98ff360e76e93348978fdd25b58b46ff0566719a78d0b41ed626465a164736f6c634300080b0033

This means actually how we are verifying is correct and the first auxdata is actually the part of the contract bytecode that needs to be verified.

Still, I haven't seen a bytecode like this before and need to look deeper if this is a common case. If you know of any other factory contracts, please share them.

Also can you please share the metadata files of both BaseV1Factory and BaseV1Pair that you compiled? I want to see what caused the hashes to be different than mine. I suspect it's the source paths. And all things equal I expect to be able to generate the exact same bytecode + metadata with the clm repo, but again, all things equal at the time the contract was compiled and deployed.

@tster
Copy link
Contributor Author

tster commented Nov 23, 2022

A partial match will not be possible with the double hash

This is one of the reasons I created this issue. Perhaps if there are more examples of doubled metadata hashes in the future, Sourcify could consider adapting the bytecode comparison to allow for multiple hashes.

It seems this is because this contract is a factory so it's a nested contract code.

Ah, that makes a lot of sense! Thank you for sharing.

Also can you please share the metadata files of both BaseV1Factory and BaseV1Pair that you compiled?

Here: https://gist.github.com/tster/85c67b8d051ba0ab9f76b35ae835c12d

I do believe the filepath is affecting the hashes. I did a test (albeit late last night) where I changed the name of the build folder and it seemed to give different hashes.

As a result I think it'll be difficult to recreate the exact same bytecode as was generated at contract deployment.

@kuzdogan
Copy link
Member

kuzdogan commented Nov 28, 2022

I see that this is a common case with factory contracts. I was able to generate a "double auxdata" bytecode with the following two contracts:

SimpleStorage.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract SimpleStorage {

    uint256 favoriteNumber;

    struct People {
        uint256 favoriteNumber;
        string name;
    }
    // uint256[] public anArray;
    //create an array of type People, which is a struct and name it people. It is also public.
    People[] public people;

    mapping(string => uint256) public nameToFavoriteNumber;

    function store(uint256 _favoriteNumber) public {
        favoriteNumber = _favoriteNumber;
    }

    function retrieve() public view returns (uint256){
        return favoriteNumber;
    }

    function addPerson(string memory _name, uint256 _favoriteNumber) public {
        people.push(People(_favoriteNumber, _name));
        nameToFavoriteNumber[_name] = _favoriteNumber;
    }
}
SimpleStorageFactory.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./SimpleStorage.sol";

contract StorageFactory {

    SimpleStorage[] public simpleStorageArray;

    function createSimpleStorageContract() public {
        SimpleStorage simpleStorage = new SimpleStorage();
        simpleStorageArray.push(simpleStorage);
    }

    function sfStore(uint256 _simpleStorageIndex, uint256 _simpleStorageNumber) public {

        simpleStorageArray[_simpleStorageIndex].store(_simpleStorageNumber);
    }

    function sfGet(uint256 _simpleStorageIndex) public view returns (uint256) {

        return simpleStorageArray[_simpleStorageIndex].retrieve();
    }
}
Bytecode
608060405234801561001057600080fd5b50610cb1806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80631563700f146100515780631dda65411461006d57806364591bf114610077578063c5f19c20146100a7575b600080fd5b61006b600480360381019061006691906103ab565b6100d7565b005b610075610184565b005b610091600480360381019061008c9190610351565b610217565b60405161009e9190610409565b60405180910390f35b6100c160048036038101906100bc9190610351565b610256565b6040516100ce9190610424565b60405180910390f35b600082815481106100eb576100ea61049f565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636057361d826040518263ffffffff1660e01b815260040161014e9190610424565b600060405180830381600087803b15801561016857600080fd5b505af115801561017c573d6000803e3d6000fd5b505050505050565b60006040516101929061031a565b604051809103906000f0801580156101ae573d6000803e3d6000fd5b5090506000819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000818154811061022757600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080828154811061026b5761026a61049f565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e64cec16040518163ffffffff1660e01b815260040160206040518083038186803b1580156102db57600080fd5b505afa1580156102ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610313919061037e565b9050919050565b610791806104eb83390190565b600081359050610336816104d3565b92915050565b60008151905061034b816104d3565b92915050565b600060208284031215610367576103666104ce565b5b600061037584828501610327565b91505092915050565b600060208284031215610394576103936104ce565b5b60006103a28482850161033c565b91505092915050565b600080604083850312156103c2576103c16104ce565b5b60006103d085828601610327565b92505060206103e185828601610327565b9150509250929050565b6103f481610469565b82525050565b6104038161045f565b82525050565b600060208201905061041e60008301846103eb565b92915050565b600060208201905061043960008301846103fa565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006104748261047b565b9050919050565b60006104868261048d565b9050919050565b60006104988261043f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b6104dc8161045f565b81146104e757600080fd5b5056fe608060405234801561001057600080fd5b50610771806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80632e64cec11461005c5780636057361d1461007a5780636f760f41146100965780638bab8dd5146100b25780639e7a13ad146100e2575b600080fd5b610064610113565b604051610071919061052a565b60405180910390f35b610094600480360381019061008f919061046d565b61011c565b005b6100b060048036038101906100ab9190610411565b610126565b005b6100cc60048036038101906100c791906103c8565b6101b6565b6040516100d9919061052a565b60405180910390f35b6100fc60048036038101906100f7919061046d565b6101e4565b60405161010a929190610545565b60405180910390f35b60008054905090565b8060008190555050565b6001604051806040016040528083815260200184815250908060018154018082558091505060019003906000526020600020906002020160009091909190915060008201518160000155602082015181600101908051906020019061018c9291906102a0565b505050806002836040516101a09190610513565b9081526020016040518091039020819055505050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915090505481565b600181815481106101f457600080fd5b906000526020600020906002020160009150905080600001549080600101805461021d9061063e565b80601f01602080910402602001604051908101604052809291908181526020018280546102499061063e565b80156102965780601f1061026b57610100808354040283529160200191610296565b820191906000526020600020905b81548152906001019060200180831161027957829003601f168201915b5050505050905082565b8280546102ac9061063e565b90600052602060002090601f0160209004810192826102ce5760008555610315565b82601f106102e757805160ff1916838001178555610315565b82800160010185558215610315579182015b828111156103145782518255916020019190600101906102f9565b5b5090506103229190610326565b5090565b5b8082111561033f576000816000905550600101610327565b5090565b60006103566103518461059a565b610575565b90508281526020810184848401111561037257610371610704565b5b61037d8482856105fc565b509392505050565b600082601f83011261039a576103996106ff565b5b81356103aa848260208601610343565b91505092915050565b6000813590506103c281610724565b92915050565b6000602082840312156103de576103dd61070e565b5b600082013567ffffffffffffffff8111156103fc576103fb610709565b5b61040884828501610385565b91505092915050565b600080604083850312156104285761042761070e565b5b600083013567ffffffffffffffff81111561044657610445610709565b5b61045285828601610385565b9250506020610463858286016103b3565b9150509250929050565b6000602082840312156104835761048261070e565b5b6000610491848285016103b3565b91505092915050565b60006104a5826105cb565b6104af81856105d6565b93506104bf81856020860161060b565b6104c881610713565b840191505092915050565b60006104de826105cb565b6104e881856105e7565b93506104f881856020860161060b565b80840191505092915050565b61050d816105f2565b82525050565b600061051f82846104d3565b915081905092915050565b600060208201905061053f6000830184610504565b92915050565b600060408201905061055a6000830185610504565b818103602083015261056c818461049a565b90509392505050565b600061057f610590565b905061058b8282610670565b919050565b6000604051905090565b600067ffffffffffffffff8211156105b5576105b46106d0565b5b6105be82610713565b9050602081019050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b6000819050919050565b82818337600083830152505050565b60005b8381101561062957808201518184015260208101905061060e565b83811115610638576000848401525b50505050565b6000600282049050600182168061065657607f821691505b6020821081141561066a576106696106a1565b5b50919050565b61067982610713565b810181811067ffffffffffffffff82111715610698576106976106d0565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b61072d816105f2565b811461073857600080fd5b5056fe...
...a2646970667358221220379853d4a44844fcab5233c4687bf1459af2f69fd77391e88848fb9e2a2fc1ec64736f6c63430008070033
...a2646970667358221220d2fee54fa8a62658ce37186b76b9042c4101f0d0babcf6f7eca6fdd01fd2a5e464736f6c63430008070033

Edit: Also this is a simple Factory repo https://github.com/samc621/TokenFactory

This might be something we want to handle. Still, need to verify if factory contracts always have double auxdata at the end of the bytecode and not middle. Then we can trim the auxdata once again and not do a regex. Removing auxdata with regex has shown to allow misleading source codes.

Theoretically one should be able to generate a full match from the same commit of the repo when the contract was deployed. Do you know at which commit the contract was deployed? @tster

Also from the metadata you provided I see both the paths and the hashes of the sources are different. Did you compile from another commit?

Yours
    "sources": {
      "src/BaseV1-core.sol": {
        "keccak256": "0xa1fdca125920ee1ccde44963c093474650f9b8939a79aa76de9243c58e9dcef6",
        "urls": [
          "bzz-raw://ed9a06aaa82b119905c6f6802d4d91bc2b91fb7ee0139755bf37c68e8eb2a6fe",
          "dweb:/ipfs/QmS2t2GZeGYBFKzGkM9QUE9w5JxHqGZCsDux9caQhinWUs"
        ],
        "license": "MIT"
      },
      "src/BaseV1-libs.sol": {
        "keccak256": "0x85b323014d6ee76d81806c44787ff6e8aaeb1fd843b60ac44834c7e8bc1a1079",
        "urls": [
          "bzz-raw://4de2cd640e5b6b0f71a06c75594f063c7f95a5e2b1c899517908f705e0bdd7bc",
          "dweb:/ipfs/QmYbpB2jawP614FFdbzjnhAwh1Z3jVGF84utjZ4pb4SY2v"
        ],
        "license": null
      }
    },
Mine
    "sources": {
      "src/Swap/BaseV1-core.sol": {
        "keccak256": "0x7f78b45e70ecdd7091280ad2cbabca621f5468d8d2be44f2c20d0a3b5959e8f5",
        "urls": [
          "bzz-raw://d0f6226c8c91a3deeec75e509e4199fee6f5edfcd65766533095fc180a381d95",
          "dweb:/ipfs/QmRs1f3vhXtAb3z2tVnXXBpAsLqfRUFPz5P2VC8T2ydgVA"
        ],
        "license": "MIT"
      },
      "src/Swap/BaseV1-libs.sol": {
        "keccak256": "0x1e9bf0b17252bc691a6798415a032687444bf32ab2942777fd2f697225874cab",
        "urls": [
          "bzz-raw://f9c503969600a9e3b98a44aedaa5db6656b4bec33e949c8563401a8e6276fd2e",
          "dweb:/ipfs/QmX8S8j99nhSS8TSadKtXi6QPVrrKT7Ay5NPsiTiwzR59g"
        ],
        "license": null
      }
    },

@tster
Copy link
Contributor Author

tster commented Dec 1, 2022

Sorry to keep you waiting @kuzdogan.

Interesting to know you were able to recreate this with other factory contracts.

Unfortunately I do not know at which commit the contract was deployed. I've tried recompiling the contract based on a few different commits and was not able to recreate the exact bytecode with the same hashes. Still waiting on the original metadata.

Did you compile from another commit?

In the case of the metadata I shared with you previously, the path was different because I created a fresh environment and only copied over the contracts I wanted to compile. But like I say, I also tried with clones of the GitHub repo at a few different commits and was unsuccessful.

Funnily, I thought it was actually the absolute path (down to the user name and drive) that made the difference. Makes much more sense that the relative path is what matters.

@kuzdogan
Copy link
Member

We've received another example, this time not only double hash at the end, but also a metadata hash in the middle of the bytecode. So there must be a more generalized way to handle this.

The contract repo is: https://github.com/Velocimeter/instruments/tree/canto-v0.2.0
The chain and addresses can be found at deployments/. The target contract was BribeFactory on Canto. The contract is verified on Arbitrum Etherscan. I wonder how they handle this situation.

The onchain deployed bytecode on Canto:

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80632a26b9eb146100515780636485f0c414610080578063b0ad856f14610093578063eb57738c146100a6575b600080fd5b61006461005f3660046101c1565b6100b9565b6040516001600160a01b03909116815260200160405180910390f35b61006461008e3660046101c1565b610116565b600354610064906001600160a01b031681565b600254610064906001600160a01b031681565b600033826040516100c990610173565b6100d4929190610286565b604051809103906000f0801580156100f0573d6000803e3d6000fd5b50600280546001600160a01b0319166001600160a01b0392909216918217905592915050565b6000338260405161012690610181565b610131929190610286565b604051809103906000f08015801561014d573d6000803e3d6000fd5b50600380546001600160a01b0319166001600160a01b0392909216918217905592915050565b612e8e80620002e383390190565b611f5c806200317183390190565b634e487b7160e01b600052604160045260246000fd5b80356001600160a01b03811681146101bc57600080fd5b919050565b600060208083850312156101d457600080fd5b823567ffffffffffffffff808211156101ec57600080fd5b818501915085601f83011261020057600080fd5b8135818111156102125761021261018f565b8060051b604051601f19603f830116810181811085821117156102375761023761018f565b60405291825284820192508381018501918883111561025557600080fd5b938501935b8285101561027a5761026b856101a5565b8452938501939285019261025a565b98975050505050505050565b6001600160a01b038381168252604060208084018290528451918401829052600092858201929091906060860190855b818110156102d45785518516835294830194918301916001016102b6565b50909897505050505050505056fe60c0604052600080546001600160a01b0319908116730a178469e3d08beaa0a289e416ab924f10807989179091556001805490911673ecf044c5b4b867cfda001101c617ecd347095b441781556012553480156200005c57600080fd5b5060405162002e8e38038062002e8e8339810160408190526200007f91620002b4565b6001600160a01b038216608081905260408051638dd598fb60e01b81529051638dd598fb916004808201926020929091908290030181865afa158015620000ca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000f091906200039d565b6001600160a01b031660a05260005b8151811015620002025760006001600160a01b0316828281518110620001295762000129620003c2565b60200260200101516001600160a01b031614620001ed576001600960008484815181106200015b576200015b620003c2565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055506008828281518110620001b157620001b1620003c2565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b039092169190911790555b80620001f981620003d8565b915050620000ff565b50600154600054604051632210724360e11b81526001600160a01b039182166004820152911690634420e486906024016020604051808303816000875af115801562000252573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000278919062000400565b5050506200041a565b80516001600160a01b03811681146200029957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215620002c857600080fd5b620002d38362000281565b602084810151919350906001600160401b0380821115620002f357600080fd5b818601915086601f8301126200030857600080fd5b8151818111156200031d576200031d6200029e565b8060051b604051601f19603f830116810181811085821117156200034557620003456200029e565b6040529182528482019250838101850191898311156200036457600080fd5b938501935b828510156200038d576200037d8562000281565b8452938501939285019262000369565b8096505050505050509250929050565b600060208284031215620003b057600080fd5b620003bb8262000281565b9392505050565b634e487b7160e01b600052603260045260246000fd5b600060018201620003f957634e487b7160e01b600052601160045260246000fd5b5060010190565b6000602082840312156200041357600080fd5b5051919050565b60805160a051612a246200046a6000396000818161041801528181610aae01528181610f2e015261175401526000818161030601528181610cb901528181610eeb015261165e0152612a246000f3fe608060405234801561001057600080fd5b50600436106102115760003560e01c806399bcc05211610125578063e6886396116100ad578063f301af421161007c578063f301af421461057b578063f32077231461058e578063f5f8d365146105a1578063f7412baf146105b4578063fd314098146105db57600080fd5b8063e68863961461052c578063e8111a1214610534578063f12297771461053d578063f25e55a51461055057600080fd5b8063a28d4c9c116100f4578063a28d4c9c146104b3578063a7852afa146104c6578063aa479652146104d9578063b66503cf146104f9578063da09d19d1461050c57600080fd5b806399bcc0521461044d5780639cc7f708146104605780639ce43f90146104805780639e2bf22c146104a057600080fd5b806349dcc204116101a8578063638634ee11610177578063638634ee146103da57806368fcee1a146103ed57806376f4be36146104005780638dd598fb146104135780639418f9391461043a57600080fd5b806349dcc204146103405780634d5ce0381461037257806350589793146103a55780635a45d052146103c557600080fd5b80632ce9aead116101e45780632ce9aead146102a35780633b881999146102c35780633e491d47146102ee57806346c96aac1461030157600080fd5b806301316ddf1461021657806318160ddd146102625780631be0528914610279578063221ca18c14610283575b600080fd5b6102486102243660046125e3565b60106020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152015b60405180910390f35b61026b600a5481565b604051908152602001610259565b61026b62093a8081565b61026b61029136600461260f565b60026020526000908152604090205481565b61026b6102b136600461260f565b60046020526000908152604090205481565b61026b6102d13660046125e3565b600760209081526000928352604080842090915290825290205481565b61026b6102fc3660046125e3565b6105ee565b6103287f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610259565b61024861034e36600461262c565b600c6020908152600092835260408084209091529082529020805460019091015482565b61039561038036600461260f565b60096020526000908152604090205460ff1681565b6040519015158152602001610259565b61026b6103b336600461264e565b600d6020526000908152604090205481565b6103d86103d33660046125e3565b610910565b005b61026b6103e836600461260f565b610948565b6103d86103fb3660046125e3565b61096c565b61026b61040e36600461264e565b610978565b6103287f000000000000000000000000000000000000000000000000000000000000000081565b6103d8610448366004612667565b610aac565b61026b61045b36600461260f565b610c3d565b61026b61046e36600461264e565b600b6020526000908152604090205481565b61026b61048e36600461260f565b60056020526000908152604090205481565b6103d86104ae36600461262c565b610cae565b61026b6104c136600461262c565b610d87565b6103d86104d43660046126bf565b610ecc565b61026b6104e736600461260f565b60116020526000908152604090205481565b6103d86105073660046125e3565b611211565b61026b61051a36600461260f565b60036020526000908152604090205481565b60085461026b565b61026b600f5481565b61026b61054b36600461260f565b611507565b61026b61055e3660046125e3565b600660209081526000928352604080842090915290825290205481565b61032861058936600461264e565b611629565b6103d861059c36600461262c565b611653565b6103d86105af3660046126bf565b611724565b6102486105c236600461264e565b600e602052600090815260409020805460019091015482565b6102486105e93660046125e3565b611a2b565b6001600160a01b038216600081815260066020908152604080832085845282528083205493835260108252808320838052909152812054909182916106339190611c4c565b6000848152600d60205260408120549192500361065457600091505061090a565b60006106608483610d87565b6000858152600d60205260408120549192509061067f906001906127a6565b9050600081156107ec57825b6106966001846127a6565b81116107ea576000878152600c60208181526040808420858552808352818520825180840190935280548352600190810154838501528c865293909252929182906106e29086906127bd565b815260200190815260200160002060405180604001604052908160008201548152602001600182015481525050905060006107218b8460000151611a2b565b50905060006107348c8460000151611a2b565b5090508b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610775573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079991906127d5565b6107a490600a6128dc565b6107ae83836127a6565b85602001516107bd91906128eb565b6107c7919061290a565b6107d190876127bd565b95505050505080806107e29061292c565b91505061068b565b505b6000868152600c6020908152604080832085845282528083208151808301909252805480835260019091015492820192909252919061082c908a90611a2b565b509050886001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561086d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089191906127d5565b61089c90600a6128dc565b6001600160a01b038a1660009081526007602090815260408083208c84529091529020546108cb908390611c4c565b6108d48b611507565b6108de91906127a6565b83602001516108ed91906128eb565b6108f7919061290a565b61090190846127bd565b96505050505050505b92915050565b61091a8282611c62565b6001600160a01b03909316600090815260056020908152604080832060049092529091209390935590915550565b6001600160a01b03811660009081526003602052604081205461090a904290611dc5565b61091a82826000611dd4565b600f5460009080820361098e5750600092915050565b82600e600061099e6001856127a6565b815260200190815260200160002060000154116109c7576109c06001826127a6565b9392505050565b60008052600e6020527fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c54831015610a025750600092915050565b600080610a106001846127a6565b90505b81811115610aa45760006002610a2984846127a6565b610a33919061290a565b610a3d90836127a6565b6000818152600e6020908152604091829020825180840190935280548084526001909101549183019190915291925090879003610a7e575095945050505050565b8051871115610a8f57819350610a9d565b610a9a6001836127a6565b92505b5050610a13565b509392505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166385f2aef26040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610b0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b309190612945565b6001600160a01b0316336001600160a01b031614610b815760405162461bcd60e51b81526020600482015260096024820152686f6e6c79207465616d60b81b60448201526064015b60405180910390fd5b816001600160a01b031660088481548110610b9e57610b9e612962565b6000918252602090912001546001600160a01b031614610bbd57600080fd5b6001600160a01b03808316600090815260096020526040808220805460ff1990811690915592841682529020805490911660011790556008805482919085908110610c0a57610c0a612962565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550505050565b6001600160a01b0381166000908152600360205260408120544210610c6457506000919050565b6001600160a01b038216600090815260036020526040812054610c889042906127a6565b6001600160a01b0384166000908152600260205260409020549091506109c090826128eb565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610ce357600080fd5b610ceb611fc4565b81600a6000828254610cfd91906127a6565b90915550506000818152600b602052604081208054849290610d209084906127a6565b90915550506000818152600b6020526040902054610d3f90829061204c565b610d47612125565b604080518281526020810184905233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b56891015b60405180910390a25050565b6000828152600d6020526040812054808203610da757600091505061090a565b6000848152600c602052604081208491610dc26001856127a6565b81526020019081526020016000206000015411610dec57610de46001826127a6565b91505061090a565b6000848152600c60209081526040808320838052909152902054831015610e1757600091505061090a565b600080610e256001846127a6565b90505b81811115610ec35760006002610e3e84846127a6565b610e48919061290a565b610e5290836127a6565b6000888152600c60209081526040808320848452825291829020825180840190935280548084526001909101549183019190915291925090879003610e9d5750935061090a92505050565b8051871115610eae57819350610ebc565b610eb96001836127a6565b92505b5050610e28565b50949350505050565b601254600114610edb57600080fd5b6002601255336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f1557600080fd5b6040516331a9108f60e11b8152600481018390526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015610f7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa19190612945565b905060005b825181101561120657610fd6838281518110610fc457610fc4612962565b60200260200101516000196001611dd4565b60056000868581518110610fec57610fec612962565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006004600088878151811061102c5761102c612962565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000849190505583919050555050600061108784838151811061107957611079612962565b6020026020010151866105ee565b905042600660008685815181106110a0576110a0612962565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600087815260200190815260200160002081905550600560008584815181106110f3576110f3612962565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020546007600086858151811061113257611132612962565b6020908102919091018101516001600160a01b031682528181019290925260409081016000908120898252909252902055801561118d5761118d84838151811061117e5761117e612962565b602002602001015184836121c9565b83828151811061119f5761119f612962565b60200260200101516001600160a01b0316836001600160a01b03167f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc9836040516111eb91815260200190565b60405180910390a350806111fe8161292c565b915050610fa6565b505060016012555050565b60125460011461122057600080fd5b60026012558061122f57600080fd5b6001600160a01b03821660009081526009602052604090205460ff1661125457600080fd5b6001600160a01b038216600090815260026020526040812054900361127f5761127f826000426122b8565b61128d826000196001611dd4565b6001600160a01b03841660009081526005602090815260408083206004835281842094909455939092556003909152205442106112fb576112d0823330846123a7565b6112dd62093a808261290a565b6001600160a01b038316600090815260026020526040902055611394565b6001600160a01b03821660009081526003602052604081205461131f9042906127a6565b6001600160a01b0384166000908152600260205260408120549192509061134690836128eb565b905080831161135457600080fd5b611360843330866123a7565b62093a8061136e82856127bd565b611378919061290a565b6001600160a01b03851660009081526002602052604090205550505b6001600160a01b0382166000908152600260205260409020546113b657600080fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156113fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114219190612978565b905061143062093a808261290a565b6001600160a01b03841660009081526002602052604090205411156114975760405162461bcd60e51b815260206004820152601860248201527f50726f76696465642072657761726420746f6f206869676800000000000000006044820152606401610b78565b6114a462093a80426127bd565b6001600160a01b0384166000818152600360205260409081902092909255905133907ff70d5c697de7ea828df48e5c4573cb2194c659f1901f70110c52b066dcf50826906114f59086815260200190565b60405180910390a35050600160125550565b6000600a5460000361152f57506001600160a01b031660009081526005602052604090205490565b600a54826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611570573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159491906127d5565b61159f90600a6128dc565b6001600160a01b038416600090815260026020908152604080832054600483528184205460039093529220546115d59190611dc5565b6115de86610948565b6115e891906127a6565b6115f291906128eb565b6115fc91906128eb565b611606919061290a565b6001600160a01b03831660009081526005602052604090205461090a91906127bd565b6008818154811061163957600080fd5b6000918252602090912001546001600160a01b0316905081565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461168857600080fd5b611690611fc4565b81600a60008282546116a291906127bd565b90915550506000818152600b6020526040812080548492906116c59084906127bd565b90915550506000818152600b60205260409020546116e490829061204c565b6116ec612125565b604080518281526020810184905233917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159101610d7b565b60125460011461173357600080fd5b600260125560405163430c208160e01b8152336004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063430c208190604401602060405180830381865afa1580156117a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c79190612991565b6117d057600080fd5b60005b8151811015611a21576117f1828281518110610fc457610fc4612962565b6005600085858151811061180757611807612962565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006004600087878151811061184757611847612962565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600084919050558391905055505060006118a283838151811061189457611894612962565b6020026020010151856105ee565b905042600660008585815181106118bb576118bb612962565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000868152602001908152602001600020819055506005600084848151811061190e5761190e612962565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020546007600085858151811061194d5761194d612962565b6020908102919091018101516001600160a01b03168252818101929092526040908101600090812088825290925290205580156119a8576119a883838151811061199957611999612962565b602002602001015133836121c9565b8282815181106119ba576119ba612962565b60200260200101516001600160a01b0316336001600160a01b03167f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc983604051611a0691815260200190565b60405180910390a35080611a198161292c565b9150506117d3565b5050600160125550565b6001600160a01b0382166000908152601160205260408120548190808203611a5a576000809250925050611c45565b6001600160a01b03851660009081526010602052604081208591611a7f6001856127a6565b81526020019081526020016000206000015411611b1c576001600160a01b038516600090815260106020526040812090611aba6001846127a6565b81526020019081526020016000206001015460106000876001600160a01b03166001600160a01b031681526020019081526020016000206000600184611b0091906127a6565b8152602001908152602001600020600001549250925050611c45565b6001600160a01b0385166000908152601060209081526040808320838052909152902054841015611b54576000809250925050611c45565b600080611b626001846127a6565b90505b81811115611c145760006002611b7b84846127a6565b611b85919061290a565b611b8f90836127a6565b6001600160a01b0389166000908152601060209081526040808320848452825291829020825180840190935280548084526001909101549183019190915291925090889003611bee57602081015190519096509450611c459350505050565b8051881115611bff57819350611c0d565b611c0a6001836127a6565b92505b5050611b65565b506001600160a01b038616600090815260106020908152604080832093835292905220600181015490549093509150505b9250929050565b6000818311611c5b57816109c0565b5090919050565b6001600160a01b0382166000908152600460209081526040808320546005909252822054600f54839291908303611c9c5792509050611c45565b6001600160a01b0386166000908152600260205260408120549003611cc7579250429150611c459050565b6000611cd283610978565b90506000611cee6001600f54611ce891906127a6565b88611dc5565b9050815b81811015611db6576000818152600e60209081526040918290208251808401909352805483526001015490820181905215611da3576000600e81611d378560016127bd565b8152602001908152602001600020604051806040016040529081600082015481526020016001820154815250509050600080611d828d8460000151866000015187602001518d61249f565b9092509050611d9182896127bd565b9750611d9e8d89836122b8565b975050505b5080611dae8161292c565b915050611cf2565b50919792965091945050505050565b6000818310611c5b57816109c0565b6001600160a01b0383166000908152600460209081526040808320546005909252822054600f54839291908303611e0e5792509050611fbc565b6001600160a01b0387166000908152600260205260408120549003611e39579250429150611fbc9050565b6000611e4483610978565b90506000611e606001600f54611e5a91906127a6565b89611dc5565b90508015611f3957815b611e756001836127a6565b8111611f37576000818152600e60209081526040918290208251808401909352805483526001015490820181905215611f24576000600e81611eb88560016127bd565b8152602001908152602001600020604051806040016040529081600082015481526020016001820154815250509050600080611f038e8460000151866000015187602001518d61249f565b9092509050611f1282896127bd565b9750611f1f8e89836122b8565b975050505b5080611f2f8161292c565b915050611e6a565b505b8615611fb3576000818152600e60209081526040918290208251808401909352805483526001015490820181905215611fb1576000611f928b611f7b8d610948565b8451611f87908a611c4c565b85602001518a61249f565b509050611f9f81866127bd565b9450611fac8b86426122b8565b429550505b505b50909350909150505b935093915050565b60085460005b8181101561204857600060088281548110611fe757611fe7612962565b6000918252602090912001546001600160a01b0316905061200c816000196001611dd4565b6001600160a01b0390921660009081526005602090815260408083206004909252909120929092559055806120408161292c565b915050611fca565b5050565b6000828152600d60205260409020544290801580159061209657506000848152600c6020526040812083916120826001856127a6565b815260200190815260200160002060000154145b156120cf576000848152600c6020526040812084916120b66001856127a6565b815260208101919091526040016000206001015561211f565b60408051808201825283815260208082018681526000888152600c835284812086825290925292902090518155905160019182015561210f9082906127bd565b6000858152600d60205260409020555b50505050565b600f54428115801590612157575080600e60006121436001866127a6565b815260200190815260200160002060000154145b1561218657600a54600e600061216e6001866127a6565b81526020810191909152604001600020600101555050565b604080518082018252828152600a5460208083019182526000868152600e909152929092209051815590516001918201556121c29083906127bd565b600f555050565b6000836001600160a01b03163b116121e057600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009283929087169161223c91906129b3565b6000604051808303816000865af19150503d8060008114612279576040519150601f19603f3d011682016040523d82523d6000602084013e61227e565b606091505b50915091508180156122a85750805115806122a85750808060200190518101906122a89190612991565b6122b157600080fd5b5050505050565b6001600160a01b038316600090815260116020526040902054801580159061231457506001600160a01b038416600090815260106020526040812083916123006001856127a6565b815260200190815260200160002060000154145b1561233e576001600160a01b038416600090815260106020526040812084916120b66001856127a6565b60408051808201825283815260208082018681526001600160a01b0388166000908152601083528481208682529092529290209051815590516001918201556123889082906127bd565b6001600160a01b03851660009081526011602052604090205550505050565b6000846001600160a01b03163b116123be57600080fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b179052915160009283929088169161242291906129b3565b6000604051808303816000865af19150503d806000811461245f576040519150601f19603f3d011682016040523d82523d6000602084013e612464565b606091505b509150915081801561248e57508051158061248e57508080602001905181019061248e9190612991565b61249757600080fd5b505050505050565b60008060006124ae8785611c4c565b905084886001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156124ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061251391906127d5565b61251e90600a6128dc565b6001600160a01b038a166000908152600260205260409020546125626125448a89611c4c565b6001600160a01b038d16600090815260036020526040902054611dc5565b6001600160a01b038c16600090815260036020526040902054612586908690611dc5565b61259091906127a6565b61259a91906128eb565b6125a491906128eb565b6125ae919061290a565b9890975095505050505050565b6001600160a01b03811681146125d057600080fd5b50565b80356125de816125bb565b919050565b600080604083850312156125f657600080fd5b8235612601816125bb565b946020939093013593505050565b60006020828403121561262157600080fd5b81356109c0816125bb565b6000806040838503121561263f57600080fd5b50508035926020909101359150565b60006020828403121561266057600080fd5b5035919050565b60008060006060848603121561267c57600080fd5b83359250602084013561268e816125bb565b9150604084013561269e816125bb565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156126d257600080fd5b8235915060208084013567ffffffffffffffff808211156126f257600080fd5b818601915086601f83011261270657600080fd5b813581811115612718576127186126a9565b8060051b604051601f19603f8301168101818110858211171561273d5761273d6126a9565b60405291825284820192508381018501918983111561275b57600080fd5b938501935b8285101561278057612771856125d3565b84529385019392850192612760565b8096505050505050509250929050565b634e487b7160e01b600052601160045260246000fd5b6000828210156127b8576127b8612790565b500390565b600082198211156127d0576127d0612790565b500190565b6000602082840312156127e757600080fd5b815160ff811681146109c057600080fd5b600181815b8085111561283357816000190482111561281957612819612790565b8085161561282657918102915b93841c93908002906127fd565b509250929050565b60008261284a5750600161090a565b816128575750600061090a565b816001811461286d576002811461287757612893565b600191505061090a565b60ff84111561288857612888612790565b50506001821b61090a565b5060208310610133831016604e8410600b84101617156128b6575081810a61090a565b6128c083836127f8565b80600019048211156128d4576128d4612790565b029392505050565b60006109c060ff84168361283b565b600081600019048311821515161561290557612905612790565b500290565b60008261292757634e487b7160e01b600052601260045260246000fd5b500490565b60006001820161293e5761293e612790565b5060010190565b60006020828403121561295757600080fd5b81516109c0816125bb565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561298a57600080fd5b5051919050565b6000602082840312156129a357600080fd5b815180151581146109c057600080fd5b6000825160005b818110156129d457602081860181015185830152016129ba565b818111156129e3576000828501525b50919091019291505056fea26469706673582212206bd63dcd50d2d0978656869a799a0d2f5a2b01beb86cc5a1d0d9b99276d22d3864736f6c634300080d003360c0604052600080546001600160a01b0319908116730a178469e3d08beaa0a289e416ab924f10807989179091556001805490911673ecf044c5b4b867cfda001101c617ecd347095b44178155600d553480156200005c57600080fd5b5060405162001f5c38038062001f5c8339810160408190526200007f91620002b4565b6001600160a01b038216608081905260408051638dd598fb60e01b81529051638dd598fb916004808201926020929091908290030181865afa158015620000ca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000f091906200039d565b6001600160a01b031660a05260005b8151811015620002025760006001600160a01b0316828281518110620001295762000129620003c2565b60200260200101516001600160a01b031614620001ed576001600860008484815181106200015b576200015b620003c2565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055506007828281518110620001b157620001b1620003c2565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b039092169190911790555b80620001f981620003d8565b915050620000ff565b50600154600054604051632210724360e11b81526001600160a01b039182166004820152911690634420e486906024016020604051808303816000875af115801562000252573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000278919062000400565b5050506200041a565b80516001600160a01b03811681146200029957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215620002c857600080fd5b620002d38362000281565b602084810151919350906001600160401b0380821115620002f357600080fd5b818601915086601f8301126200030857600080fd5b8151818111156200031d576200031d6200029e565b8060051b604051601f19603f830116810181811085821117156200034557620003456200029e565b6040529182528482019250838101850191898311156200036457600080fd5b938501935b828510156200038d576200037d8562000281565b8452938501939285019262000369565b8096505050505050509250929050565b600060208284031215620003b057600080fd5b620003bb8262000281565b9392505050565b634e487b7160e01b600052603260045260246000fd5b600060018201620003f957634e487b7160e01b600052601160045260246000fd5b5060010190565b6000602082840312156200041357600080fd5b5051919050565b60805160a051611aeb62000471600039600081816102d90152818161089b01528181610cdb015261125e0152600081816101da01528181610a6e01528181610c9801528181610ed601526111700152611aeb6000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c80639cc7f708116100de578063e688639611610097578063f301af4211610071578063f301af4214610416578063f320772314610429578063f5f8d3651461043c578063f7412baf1461044f57600080fd5b8063e6886396146103da578063e8111a12146103e2578063f25e55a5146103eb57600080fd5b80639cc7f7081461034e5780639e2bf22c1461036e578063a28d4c9c14610381578063a7852afa14610394578063b66503cf146103a7578063da09d19d146103ba57600080fd5b8063505897931161014b5780638dd598fb116101255780638dd598fb146102d457806392777b29146102fb5780639418f9391461032657806399bcc0521461033b57600080fd5b8063505897931461028e578063638634ee146102ae57806376f4be36146102c157600080fd5b80630175e23b1461019357806318160ddd146101b95780633e491d47146101c257806346c96aac146101d557806349dcc204146102145780634d5ce0381461025b575b600080fd5b6101a66101a1366004611795565b610476565b6040519081526020015b60405180910390f35b6101a660025481565b6101a66101d03660046117d6565b6104b8565b6101fc7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101b0565b610246610222366004611802565b60096020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101b0565b61027e610269366004611824565b60086020526000908152604090205460ff1681565b60405190151581526020016101b0565b6101a661029c366004611795565b600a6020526000908152604090205481565b6101a66102bc366004611824565b610741565b6101a66102cf366004611795565b610765565b6101fc7f000000000000000000000000000000000000000000000000000000000000000081565b6101a66103093660046117d6565b600460209081526000928352604080842090915290825290205481565b610339610334366004611841565b610899565b005b6101a6610349366004611824565b610a2a565b6101a661035c366004611795565b60036020526000908152604090205481565b61033961037c366004611802565b610a63565b6101a661038f366004611802565b610b34565b6103396103a2366004611899565b610c79565b6103396103b53660046117d6565b610e79565b6101a66103c8366004611824565b60056020526000908152604090205481565b6007546101a6565b6101a6600c5481565b6101a66103f93660046117d6565b600660209081526000928352604080842090915290825290205481565b6101fc610424366004611795565b61113b565b610339610437366004611802565b611165565b61033961044a366004611899565b61122e565b61024661045d366004611795565b600b602052600090815260409020805460019091015482565b60008061048283611402565b9050600061049362093a8083611980565b90508084106104ae576104a98262093a80611980565b6104b0565b815b949350505050565b6001600160a01b0382166000908152600660209081526040808320848452825280832054600a90925282205482036104f457600091505061073b565b60006105008483610b34565b6000858152600a60205260408120549192509061051f90600190611998565b90506000610540604051806040016040528060008152602001600081525090565b61054985611402565b81526001831561065a57845b610560600186611998565b81116106585760008981526009602090815260408083208484528252808320815180830190925280548083526001909101549282019290925291906105a490611402565b85519091508111156105c25760208501516105bf9087611980565b95505b808552600b60006105d96102cf62093a8085611980565b815260200190815260200160002060010154935083600460008e6001600160a01b03166001600160a01b03168152602001908152602001600020600083815260200190815260200160002054836020015161063491906119af565b61063e91906119e4565b602086015250819050610650816119f8565b915050610555565b505b600088815260096020908152604080832087845282528083208151808301909252805480835260019091015492820192909252919061069890611402565b905060006106a962093a8083611980565b90508042111561072f57600b60006106c083610765565b815260200190815260200160002060010154600460008e6001600160a01b03166001600160a01b03168152602001908152602001600020600084815260200190815260200160002054846020015161071891906119af565b61072291906119e4565b61072c9087611980565b95505b50939750505050505050505b92915050565b6001600160a01b03811660009081526005602052604081205461073b90429061141b565b600c5460009080820361077b5750600092915050565b82600b600061078b600185611998565b815260200190815260200160002060000154116107b4576107ad600182611998565b9392505050565b60008052600b6020527fdf7de25b7f1fd6d0b5205f0e18f1f35bd7b8d84cce336588d184533ce43a6f76548310156107ef5750600092915050565b6000806107fd600184611998565b90505b8181111561089157600060026108168484611998565b61082091906119e4565b61082a9083611998565b6000818152600b602090815260409182902082518084019093528054808452600190910154918301919091529192509087900361086b575095945050505050565b805187111561087c5781935061088a565b610887600183611998565b92505b5050610800565b509392505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166385f2aef26040518163ffffffff1660e01b81526004016020604051808303816000875af11580156108f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091d9190611a11565b6001600160a01b0316336001600160a01b03161461096e5760405162461bcd60e51b81526020600482015260096024820152686f6e6c79207465616d60b81b60448201526064015b60405180910390fd5b816001600160a01b03166007848154811061098b5761098b611a2e565b6000918252602090912001546001600160a01b0316146109aa57600080fd5b6001600160a01b03808316600090815260086020526040808220805460ff19908116909155928416825290208054909116600117905560078054829190859081106109f7576109f7611a2e565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550505050565b600080610a3642610476565b6001600160a01b039093166000908152600460209081526040808320958352949052929092205492915050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610a9857600080fd5b8160026000828254610aaa9190611998565b909155505060008181526003602052604081208054849290610acd908490611998565b9091555050600081815260036020526040902054610aec908290611431565b610af461150a565b604080518281526020810184905233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b56891015b60405180910390a25050565b6000828152600a6020526040812054808203610b5457600091505061073b565b60008481526009602052604081208491610b6f600185611998565b81526020019081526020016000206000015411610b9957610b91600182611998565b91505061073b565b6000848152600960209081526040808320838052909152902054831015610bc457600091505061073b565b600080610bd2600184611998565b90505b81811115610c705760006002610beb8484611998565b610bf591906119e4565b610bff9083611998565b6000888152600960209081526040808320848452825291829020825180840190935280548084526001909101549183019190915291925090879003610c4a5750935061073b92505050565b8051871115610c5b57819350610c69565b610c66600183611998565b92505b5050610bd5565b50949350505050565b600d54600114610c8857600080fd5b6002600d55336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610cc257600080fd5b6040516331a9108f60e11b8152600481018390526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015610d2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4e9190611a11565b905060005b8251811015610e6e576000610d81848381518110610d7357610d73611a2e565b6020026020010151866104b8565b90504260066000868581518110610d9a57610d9a611a2e565b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081208982529092529020558015610df557610df5848381518110610de657610de6611a2e565b602002602001015184836115ae565b838281518110610e0757610e07611a2e565b60200260200101516001600160a01b0316836001600160a01b03167f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc983604051610e5391815260200190565b60405180910390a35080610e66816119f8565b915050610d53565b50506001600d555050565b600d54600114610e8857600080fd5b6002600d5580610e9757600080fd5b6001600160a01b03821660009081526008602052604090205460ff16610fdf57604051633af32abf60e01b81526001600160a01b0383811660048301527f00000000000000000000000000000000000000000000000000000000000000001690633af32abf90602401602060405180830381865afa158015610f1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f419190611a44565b610f8d5760405162461bcd60e51b815260206004820181905260248201527f627269626520746f6b656e73206d7573742062652077686974656c69737465646044820152606401610965565b600754601011610fdf5760405162461bcd60e51b815260206004820152601760248201527f746f6f206d616e79207265776172647320746f6b656e730000000000000000006044820152606401610965565b6000610fea42610476565b6001600160a01b038416600090815260046020908152604080832084845290915290205490915061101d8433308661169d565b6110278382611980565b6001600160a01b038516600090815260046020908152604080832086845290915290205561105862093a8083611980565b6001600160a01b03851660009081526005602090815260408083209390935560089052205460ff166110ea576001600160a01b0384166000818152600860205260408120805460ff191660019081179091556007805491820181559091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b03191690911790555b60408051838152602081018590526001600160a01b0386169133917f52977ea98a2220a03ee9ba5cb003ada08d394ea10155483c95dc2dc77a7eb24b910160405180910390a350506001600d555050565b6007818154811061114b57600080fd5b6000918252602090912001546001600160a01b0316905081565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461119a57600080fd5b81600260008282546111ac9190611980565b9091555050600081815260036020526040812080548492906111cf908490611980565b90915550506000818152600360205260409020546111ee908290611431565b6111f661150a565b604080518281526020810184905233917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159101610b28565b600d5460011461123d57600080fd5b6002600d5560405163430c208160e01b8152336004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063430c208190604401602060405180830381865afa1580156112ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112d19190611a44565b6112da57600080fd5b60005b81518110156113f857600061130b8383815181106112fd576112fd611a2e565b6020026020010151856104b8565b9050426006600085858151811061132457611324611a2e565b6020908102919091018101516001600160a01b031682528181019290925260409081016000908120888252909252902055801561137f5761137f83838151811061137057611370611a2e565b602002602001015133836115ae565b82828151811061139157611391611a2e565b60200260200101516001600160a01b0316336001600160a01b03167f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc9836040516113dd91815260200190565b60405180910390a350806113f0816119f8565b9150506112dd565b50506001600d5550565b600061141162093a8083611a66565b61073b9083611998565b600081831061142a57816107ad565b5090919050565b6000828152600a60205260409020544290801580159061147b575060008481526009602052604081208391611467600185611998565b815260200190815260200160002060000154145b156114b4576000848152600960205260408120849161149b600185611998565b8152602081019190915260400160002060010155611504565b60408051808201825283815260208082018681526000888152600983528481208682529092529290209051815590516001918201556114f4908290611980565b6000858152600a60205260409020555b50505050565b600c5442811580159061153c575080600b6000611528600186611998565b815260200190815260200160002060000154145b1561156b57600254600b6000611553600186611998565b81526020810191909152604001600020600101555050565b60408051808201825282815260025460208083019182526000868152600b909152929092209051815590516001918201556115a7908390611980565b600c555050565b6000836001600160a01b03163b116115c557600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916116219190611a7a565b6000604051808303816000865af19150503d806000811461165e576040519150601f19603f3d011682016040523d82523d6000602084013e611663565b606091505b509150915081801561168d57508051158061168d57508080602001905181019061168d9190611a44565b61169657600080fd5b5050505050565b6000846001600160a01b03163b116116b457600080fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916117189190611a7a565b6000604051808303816000865af19150503d8060008114611755576040519150601f19603f3d011682016040523d82523d6000602084013e61175a565b606091505b50915091508180156117845750805115806117845750808060200190518101906117849190611a44565b61178d57600080fd5b505050505050565b6000602082840312156117a757600080fd5b5035919050565b6001600160a01b03811681146117c357600080fd5b50565b80356117d1816117ae565b919050565b600080604083850312156117e957600080fd5b82356117f4816117ae565b946020939093013593505050565b6000806040838503121561181557600080fd5b50508035926020909101359150565b60006020828403121561183657600080fd5b81356107ad816117ae565b60008060006060848603121561185657600080fd5b833592506020840135611868816117ae565b91506040840135611878816117ae565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156118ac57600080fd5b8235915060208084013567ffffffffffffffff808211156118cc57600080fd5b818601915086601f8301126118e057600080fd5b8135818111156118f2576118f2611883565b8060051b604051601f19603f8301168101818110858211171561191757611917611883565b60405291825284820192508381018501918983111561193557600080fd5b938501935b8285101561195a5761194b856117c6565b8452938501939285019261193a565b8096505050505050509250929050565b634e487b7160e01b600052601160045260246000fd5b600082198211156119935761199361196a565b500190565b6000828210156119aa576119aa61196a565b500390565b60008160001904831182151516156119c9576119c961196a565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826119f3576119f36119ce565b500490565b600060018201611a0a57611a0a61196a565b5060010190565b600060208284031215611a2357600080fd5b81516107ad816117ae565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611a5657600080fd5b815180151581146107ad57600080fd5b600082611a7557611a756119ce565b500690565b6000825160005b81811015611a9b5760208186018101518583015201611a81565b81811115611aaa576000828501525b50919091019291505056fea2646970667358221220c3d6dec0373dd416c8a10379ef6e4c4616108a18e0898444b722d83b8a372a1964736f6c634300080d0033a264697066735822122053ee0d13352b8552171656fb73fbd51a75159e22e89bd53bcbde1cb112b61e3c64736f6c634300080d0033

The recompiled deployed bytecode:

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80632a26b9eb146100515780636485f0c414610080578063b0ad856f14610093578063eb57738c146100a6575b600080fd5b61006461005f3660046101c1565b6100b9565b6040516001600160a01b03909116815260200160405180910390f35b61006461008e3660046101c1565b610116565b600354610064906001600160a01b031681565b600254610064906001600160a01b031681565b600033826040516100c990610173565b6100d4929190610286565b604051809103906000f0801580156100f0573d6000803e3d6000fd5b50600280546001600160a01b0319166001600160a01b0392909216918217905592915050565b6000338260405161012690610181565b610131929190610286565b604051809103906000f08015801561014d573d6000803e3d6000fd5b50600380546001600160a01b0319166001600160a01b0392909216918217905592915050565b612e8e80620002e383390190565b611f5c806200317183390190565b634e487b7160e01b600052604160045260246000fd5b80356001600160a01b03811681146101bc57600080fd5b919050565b600060208083850312156101d457600080fd5b823567ffffffffffffffff808211156101ec57600080fd5b818501915085601f83011261020057600080fd5b8135818111156102125761021261018f565b8060051b604051601f19603f830116810181811085821117156102375761023761018f565b60405291825284820192508381018501918883111561025557600080fd5b938501935b8285101561027a5761026b856101a5565b8452938501939285019261025a565b98975050505050505050565b6001600160a01b038381168252604060208084018290528451918401829052600092858201929091906060860190855b818110156102d45785518516835294830194918301916001016102b6565b50909897505050505050505056fe60c0604052600080546001600160a01b0319908116730a178469e3d08beaa0a289e416ab924f10807989179091556001805490911673ecf044c5b4b867cfda001101c617ecd347095b441781556012553480156200005c57600080fd5b5060405162002e8e38038062002e8e8339810160408190526200007f91620002b4565b6001600160a01b038216608081905260408051638dd598fb60e01b81529051638dd598fb916004808201926020929091908290030181865afa158015620000ca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000f091906200039d565b6001600160a01b031660a05260005b8151811015620002025760006001600160a01b0316828281518110620001295762000129620003c2565b60200260200101516001600160a01b031614620001ed576001600960008484815181106200015b576200015b620003c2565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055506008828281518110620001b157620001b1620003c2565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b039092169190911790555b80620001f981620003d8565b915050620000ff565b50600154600054604051632210724360e11b81526001600160a01b039182166004820152911690634420e486906024016020604051808303816000875af115801562000252573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000278919062000400565b5050506200041a565b80516001600160a01b03811681146200029957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215620002c857600080fd5b620002d38362000281565b602084810151919350906001600160401b0380821115620002f357600080fd5b818601915086601f8301126200030857600080fd5b8151818111156200031d576200031d6200029e565b8060051b604051601f19603f830116810181811085821117156200034557620003456200029e565b6040529182528482019250838101850191898311156200036457600080fd5b938501935b828510156200038d576200037d8562000281565b8452938501939285019262000369565b8096505050505050509250929050565b600060208284031215620003b057600080fd5b620003bb8262000281565b9392505050565b634e487b7160e01b600052603260045260246000fd5b600060018201620003f957634e487b7160e01b600052601160045260246000fd5b5060010190565b6000602082840312156200041357600080fd5b5051919050565b60805160a051612a246200046a6000396000818161041801528181610aae01528181610f2e015261175401526000818161030601528181610cb901528181610eeb015261165e0152612a246000f3fe608060405234801561001057600080fd5b50600436106102115760003560e01c806399bcc05211610125578063e6886396116100ad578063f301af421161007c578063f301af421461057b578063f32077231461058e578063f5f8d365146105a1578063f7412baf146105b4578063fd314098146105db57600080fd5b8063e68863961461052c578063e8111a1214610534578063f12297771461053d578063f25e55a51461055057600080fd5b8063a28d4c9c116100f4578063a28d4c9c146104b3578063a7852afa146104c6578063aa479652146104d9578063b66503cf146104f9578063da09d19d1461050c57600080fd5b806399bcc0521461044d5780639cc7f708146104605780639ce43f90146104805780639e2bf22c146104a057600080fd5b806349dcc204116101a8578063638634ee11610177578063638634ee146103da57806368fcee1a146103ed57806376f4be36146104005780638dd598fb146104135780639418f9391461043a57600080fd5b806349dcc204146103405780634d5ce0381461037257806350589793146103a55780635a45d052146103c557600080fd5b80632ce9aead116101e45780632ce9aead146102a35780633b881999146102c35780633e491d47146102ee57806346c96aac1461030157600080fd5b806301316ddf1461021657806318160ddd146102625780631be0528914610279578063221ca18c14610283575b600080fd5b6102486102243660046125e3565b60106020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152015b60405180910390f35b61026b600a5481565b604051908152602001610259565b61026b62093a8081565b61026b61029136600461260f565b60026020526000908152604090205481565b61026b6102b136600461260f565b60046020526000908152604090205481565b61026b6102d13660046125e3565b600760209081526000928352604080842090915290825290205481565b61026b6102fc3660046125e3565b6105ee565b6103287f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610259565b61024861034e36600461262c565b600c6020908152600092835260408084209091529082529020805460019091015482565b61039561038036600461260f565b60096020526000908152604090205460ff1681565b6040519015158152602001610259565b61026b6103b336600461264e565b600d6020526000908152604090205481565b6103d86103d33660046125e3565b610910565b005b61026b6103e836600461260f565b610948565b6103d86103fb3660046125e3565b61096c565b61026b61040e36600461264e565b610978565b6103287f000000000000000000000000000000000000000000000000000000000000000081565b6103d8610448366004612667565b610aac565b61026b61045b36600461260f565b610c3d565b61026b61046e36600461264e565b600b6020526000908152604090205481565b61026b61048e36600461260f565b60056020526000908152604090205481565b6103d86104ae36600461262c565b610cae565b61026b6104c136600461262c565b610d87565b6103d86104d43660046126bf565b610ecc565b61026b6104e736600461260f565b60116020526000908152604090205481565b6103d86105073660046125e3565b611211565b61026b61051a36600461260f565b60036020526000908152604090205481565b60085461026b565b61026b600f5481565b61026b61054b36600461260f565b611507565b61026b61055e3660046125e3565b600660209081526000928352604080842090915290825290205481565b61032861058936600461264e565b611629565b6103d861059c36600461262c565b611653565b6103d86105af3660046126bf565b611724565b6102486105c236600461264e565b600e602052600090815260409020805460019091015482565b6102486105e93660046125e3565b611a2b565b6001600160a01b038216600081815260066020908152604080832085845282528083205493835260108252808320838052909152812054909182916106339190611c4c565b6000848152600d60205260408120549192500361065457600091505061090a565b60006106608483610d87565b6000858152600d60205260408120549192509061067f906001906127a6565b9050600081156107ec57825b6106966001846127a6565b81116107ea576000878152600c60208181526040808420858552808352818520825180840190935280548352600190810154838501528c865293909252929182906106e29086906127bd565b815260200190815260200160002060405180604001604052908160008201548152602001600182015481525050905060006107218b8460000151611a2b565b50905060006107348c8460000151611a2b565b5090508b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610775573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079991906127d5565b6107a490600a6128dc565b6107ae83836127a6565b85602001516107bd91906128eb565b6107c7919061290a565b6107d190876127bd565b95505050505080806107e29061292c565b91505061068b565b505b6000868152600c6020908152604080832085845282528083208151808301909252805480835260019091015492820192909252919061082c908a90611a2b565b509050886001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561086d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089191906127d5565b61089c90600a6128dc565b6001600160a01b038a1660009081526007602090815260408083208c84529091529020546108cb908390611c4c565b6108d48b611507565b6108de91906127a6565b83602001516108ed91906128eb565b6108f7919061290a565b61090190846127bd565b96505050505050505b92915050565b61091a8282611c62565b6001600160a01b03909316600090815260056020908152604080832060049092529091209390935590915550565b6001600160a01b03811660009081526003602052604081205461090a904290611dc5565b61091a82826000611dd4565b600f5460009080820361098e5750600092915050565b82600e600061099e6001856127a6565b815260200190815260200160002060000154116109c7576109c06001826127a6565b9392505050565b60008052600e6020527fe710864318d4a32f37d6ce54cb3fadbef648dd12d8dbdf53973564d56b7f881c54831015610a025750600092915050565b600080610a106001846127a6565b90505b81811115610aa45760006002610a2984846127a6565b610a33919061290a565b610a3d90836127a6565b6000818152600e6020908152604091829020825180840190935280548084526001909101549183019190915291925090879003610a7e575095945050505050565b8051871115610a8f57819350610a9d565b610a9a6001836127a6565b92505b5050610a13565b509392505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166385f2aef26040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610b0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b309190612945565b6001600160a01b0316336001600160a01b031614610b815760405162461bcd60e51b81526020600482015260096024820152686f6e6c79207465616d60b81b60448201526064015b60405180910390fd5b816001600160a01b031660088481548110610b9e57610b9e612962565b6000918252602090912001546001600160a01b031614610bbd57600080fd5b6001600160a01b03808316600090815260096020526040808220805460ff1990811690915592841682529020805490911660011790556008805482919085908110610c0a57610c0a612962565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550505050565b6001600160a01b0381166000908152600360205260408120544210610c6457506000919050565b6001600160a01b038216600090815260036020526040812054610c889042906127a6565b6001600160a01b0384166000908152600260205260409020549091506109c090826128eb565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610ce357600080fd5b610ceb611fc4565b81600a6000828254610cfd91906127a6565b90915550506000818152600b602052604081208054849290610d209084906127a6565b90915550506000818152600b6020526040902054610d3f90829061204c565b610d47612125565b604080518281526020810184905233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b56891015b60405180910390a25050565b6000828152600d6020526040812054808203610da757600091505061090a565b6000848152600c602052604081208491610dc26001856127a6565b81526020019081526020016000206000015411610dec57610de46001826127a6565b91505061090a565b6000848152600c60209081526040808320838052909152902054831015610e1757600091505061090a565b600080610e256001846127a6565b90505b81811115610ec35760006002610e3e84846127a6565b610e48919061290a565b610e5290836127a6565b6000888152600c60209081526040808320848452825291829020825180840190935280548084526001909101549183019190915291925090879003610e9d5750935061090a92505050565b8051871115610eae57819350610ebc565b610eb96001836127a6565b92505b5050610e28565b50949350505050565b601254600114610edb57600080fd5b6002601255336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f1557600080fd5b6040516331a9108f60e11b8152600481018390526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015610f7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa19190612945565b905060005b825181101561120657610fd6838281518110610fc457610fc4612962565b60200260200101516000196001611dd4565b60056000868581518110610fec57610fec612962565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006004600088878151811061102c5761102c612962565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000849190505583919050555050600061108784838151811061107957611079612962565b6020026020010151866105ee565b905042600660008685815181106110a0576110a0612962565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600087815260200190815260200160002081905550600560008584815181106110f3576110f3612962565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020546007600086858151811061113257611132612962565b6020908102919091018101516001600160a01b031682528181019290925260409081016000908120898252909252902055801561118d5761118d84838151811061117e5761117e612962565b602002602001015184836121c9565b83828151811061119f5761119f612962565b60200260200101516001600160a01b0316836001600160a01b03167f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc9836040516111eb91815260200190565b60405180910390a350806111fe8161292c565b915050610fa6565b505060016012555050565b60125460011461122057600080fd5b60026012558061122f57600080fd5b6001600160a01b03821660009081526009602052604090205460ff1661125457600080fd5b6001600160a01b038216600090815260026020526040812054900361127f5761127f826000426122b8565b61128d826000196001611dd4565b6001600160a01b03841660009081526005602090815260408083206004835281842094909455939092556003909152205442106112fb576112d0823330846123a7565b6112dd62093a808261290a565b6001600160a01b038316600090815260026020526040902055611394565b6001600160a01b03821660009081526003602052604081205461131f9042906127a6565b6001600160a01b0384166000908152600260205260408120549192509061134690836128eb565b905080831161135457600080fd5b611360843330866123a7565b62093a8061136e82856127bd565b611378919061290a565b6001600160a01b03851660009081526002602052604090205550505b6001600160a01b0382166000908152600260205260409020546113b657600080fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156113fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114219190612978565b905061143062093a808261290a565b6001600160a01b03841660009081526002602052604090205411156114975760405162461bcd60e51b815260206004820152601860248201527f50726f76696465642072657761726420746f6f206869676800000000000000006044820152606401610b78565b6114a462093a80426127bd565b6001600160a01b0384166000818152600360205260409081902092909255905133907ff70d5c697de7ea828df48e5c4573cb2194c659f1901f70110c52b066dcf50826906114f59086815260200190565b60405180910390a35050600160125550565b6000600a5460000361152f57506001600160a01b031660009081526005602052604090205490565b600a54826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611570573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159491906127d5565b61159f90600a6128dc565b6001600160a01b038416600090815260026020908152604080832054600483528184205460039093529220546115d59190611dc5565b6115de86610948565b6115e891906127a6565b6115f291906128eb565b6115fc91906128eb565b611606919061290a565b6001600160a01b03831660009081526005602052604090205461090a91906127bd565b6008818154811061163957600080fd5b6000918252602090912001546001600160a01b0316905081565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461168857600080fd5b611690611fc4565b81600a60008282546116a291906127bd565b90915550506000818152600b6020526040812080548492906116c59084906127bd565b90915550506000818152600b60205260409020546116e490829061204c565b6116ec612125565b604080518281526020810184905233917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159101610d7b565b60125460011461173357600080fd5b600260125560405163430c208160e01b8152336004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063430c208190604401602060405180830381865afa1580156117a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c79190612991565b6117d057600080fd5b60005b8151811015611a21576117f1828281518110610fc457610fc4612962565b6005600085858151811061180757611807612962565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006004600087878151811061184757611847612962565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600084919050558391905055505060006118a283838151811061189457611894612962565b6020026020010151856105ee565b905042600660008585815181106118bb576118bb612962565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000868152602001908152602001600020819055506005600084848151811061190e5761190e612962565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020546007600085858151811061194d5761194d612962565b6020908102919091018101516001600160a01b03168252818101929092526040908101600090812088825290925290205580156119a8576119a883838151811061199957611999612962565b602002602001015133836121c9565b8282815181106119ba576119ba612962565b60200260200101516001600160a01b0316336001600160a01b03167f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc983604051611a0691815260200190565b60405180910390a35080611a198161292c565b9150506117d3565b5050600160125550565b6001600160a01b0382166000908152601160205260408120548190808203611a5a576000809250925050611c45565b6001600160a01b03851660009081526010602052604081208591611a7f6001856127a6565b81526020019081526020016000206000015411611b1c576001600160a01b038516600090815260106020526040812090611aba6001846127a6565b81526020019081526020016000206001015460106000876001600160a01b03166001600160a01b031681526020019081526020016000206000600184611b0091906127a6565b8152602001908152602001600020600001549250925050611c45565b6001600160a01b0385166000908152601060209081526040808320838052909152902054841015611b54576000809250925050611c45565b600080611b626001846127a6565b90505b81811115611c145760006002611b7b84846127a6565b611b85919061290a565b611b8f90836127a6565b6001600160a01b0389166000908152601060209081526040808320848452825291829020825180840190935280548084526001909101549183019190915291925090889003611bee57602081015190519096509450611c459350505050565b8051881115611bff57819350611c0d565b611c0a6001836127a6565b92505b5050611b65565b506001600160a01b038616600090815260106020908152604080832093835292905220600181015490549093509150505b9250929050565b6000818311611c5b57816109c0565b5090919050565b6001600160a01b0382166000908152600460209081526040808320546005909252822054600f54839291908303611c9c5792509050611c45565b6001600160a01b0386166000908152600260205260408120549003611cc7579250429150611c459050565b6000611cd283610978565b90506000611cee6001600f54611ce891906127a6565b88611dc5565b9050815b81811015611db6576000818152600e60209081526040918290208251808401909352805483526001015490820181905215611da3576000600e81611d378560016127bd565b8152602001908152602001600020604051806040016040529081600082015481526020016001820154815250509050600080611d828d8460000151866000015187602001518d61249f565b9092509050611d9182896127bd565b9750611d9e8d89836122b8565b975050505b5080611dae8161292c565b915050611cf2565b50919792965091945050505050565b6000818310611c5b57816109c0565b6001600160a01b0383166000908152600460209081526040808320546005909252822054600f54839291908303611e0e5792509050611fbc565b6001600160a01b0387166000908152600260205260408120549003611e39579250429150611fbc9050565b6000611e4483610978565b90506000611e606001600f54611e5a91906127a6565b89611dc5565b90508015611f3957815b611e756001836127a6565b8111611f37576000818152600e60209081526040918290208251808401909352805483526001015490820181905215611f24576000600e81611eb88560016127bd565b8152602001908152602001600020604051806040016040529081600082015481526020016001820154815250509050600080611f038e8460000151866000015187602001518d61249f565b9092509050611f1282896127bd565b9750611f1f8e89836122b8565b975050505b5080611f2f8161292c565b915050611e6a565b505b8615611fb3576000818152600e60209081526040918290208251808401909352805483526001015490820181905215611fb1576000611f928b611f7b8d610948565b8451611f87908a611c4c565b85602001518a61249f565b509050611f9f81866127bd565b9450611fac8b86426122b8565b429550505b505b50909350909150505b935093915050565b60085460005b8181101561204857600060088281548110611fe757611fe7612962565b6000918252602090912001546001600160a01b0316905061200c816000196001611dd4565b6001600160a01b0390921660009081526005602090815260408083206004909252909120929092559055806120408161292c565b915050611fca565b5050565b6000828152600d60205260409020544290801580159061209657506000848152600c6020526040812083916120826001856127a6565b815260200190815260200160002060000154145b156120cf576000848152600c6020526040812084916120b66001856127a6565b815260208101919091526040016000206001015561211f565b60408051808201825283815260208082018681526000888152600c835284812086825290925292902090518155905160019182015561210f9082906127bd565b6000858152600d60205260409020555b50505050565b600f54428115801590612157575080600e60006121436001866127a6565b815260200190815260200160002060000154145b1561218657600a54600e600061216e6001866127a6565b81526020810191909152604001600020600101555050565b604080518082018252828152600a5460208083019182526000868152600e909152929092209051815590516001918201556121c29083906127bd565b600f555050565b6000836001600160a01b03163b116121e057600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009283929087169161223c91906129b3565b6000604051808303816000865af19150503d8060008114612279576040519150601f19603f3d011682016040523d82523d6000602084013e61227e565b606091505b50915091508180156122a85750805115806122a85750808060200190518101906122a89190612991565b6122b157600080fd5b5050505050565b6001600160a01b038316600090815260116020526040902054801580159061231457506001600160a01b038416600090815260106020526040812083916123006001856127a6565b815260200190815260200160002060000154145b1561233e576001600160a01b038416600090815260106020526040812084916120b66001856127a6565b60408051808201825283815260208082018681526001600160a01b0388166000908152601083528481208682529092529290209051815590516001918201556123889082906127bd565b6001600160a01b03851660009081526011602052604090205550505050565b6000846001600160a01b03163b116123be57600080fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b179052915160009283929088169161242291906129b3565b6000604051808303816000865af19150503d806000811461245f576040519150601f19603f3d011682016040523d82523d6000602084013e612464565b606091505b509150915081801561248e57508051158061248e57508080602001905181019061248e9190612991565b61249757600080fd5b505050505050565b60008060006124ae8785611c4c565b905084886001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156124ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061251391906127d5565b61251e90600a6128dc565b6001600160a01b038a166000908152600260205260409020546125626125448a89611c4c565b6001600160a01b038d16600090815260036020526040902054611dc5565b6001600160a01b038c16600090815260036020526040902054612586908690611dc5565b61259091906127a6565b61259a91906128eb565b6125a491906128eb565b6125ae919061290a565b9890975095505050505050565b6001600160a01b03811681146125d057600080fd5b50565b80356125de816125bb565b919050565b600080604083850312156125f657600080fd5b8235612601816125bb565b946020939093013593505050565b60006020828403121561262157600080fd5b81356109c0816125bb565b6000806040838503121561263f57600080fd5b50508035926020909101359150565b60006020828403121561266057600080fd5b5035919050565b60008060006060848603121561267c57600080fd5b83359250602084013561268e816125bb565b9150604084013561269e816125bb565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156126d257600080fd5b8235915060208084013567ffffffffffffffff808211156126f257600080fd5b818601915086601f83011261270657600080fd5b813581811115612718576127186126a9565b8060051b604051601f19603f8301168101818110858211171561273d5761273d6126a9565b60405291825284820192508381018501918983111561275b57600080fd5b938501935b8285101561278057612771856125d3565b84529385019392850192612760565b8096505050505050509250929050565b634e487b7160e01b600052601160045260246000fd5b6000828210156127b8576127b8612790565b500390565b600082198211156127d0576127d0612790565b500190565b6000602082840312156127e757600080fd5b815160ff811681146109c057600080fd5b600181815b8085111561283357816000190482111561281957612819612790565b8085161561282657918102915b93841c93908002906127fd565b509250929050565b60008261284a5750600161090a565b816128575750600061090a565b816001811461286d576002811461287757612893565b600191505061090a565b60ff84111561288857612888612790565b50506001821b61090a565b5060208310610133831016604e8410600b84101617156128b6575081810a61090a565b6128c083836127f8565b80600019048211156128d4576128d4612790565b029392505050565b60006109c060ff84168361283b565b600081600019048311821515161561290557612905612790565b500290565b60008261292757634e487b7160e01b600052601260045260246000fd5b500490565b60006001820161293e5761293e612790565b5060010190565b60006020828403121561295757600080fd5b81516109c0816125bb565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561298a57600080fd5b5051919050565b6000602082840312156129a357600080fd5b815180151581146109c057600080fd5b6000825160005b818110156129d457602081860181015185830152016129ba565b818111156129e3576000828501525b50919091019291505056fea2646970667358221220a67ce37505c372adb0395a9c3ba3422cac77dc8fa4d76540eb3e999a75b5d0d064736f6c634300080d003360c0604052600080546001600160a01b0319908116730a178469e3d08beaa0a289e416ab924f10807989179091556001805490911673ecf044c5b4b867cfda001101c617ecd347095b44178155600d553480156200005c57600080fd5b5060405162001f5c38038062001f5c8339810160408190526200007f91620002b4565b6001600160a01b038216608081905260408051638dd598fb60e01b81529051638dd598fb916004808201926020929091908290030181865afa158015620000ca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000f091906200039d565b6001600160a01b031660a05260005b8151811015620002025760006001600160a01b0316828281518110620001295762000129620003c2565b60200260200101516001600160a01b031614620001ed576001600860008484815181106200015b576200015b620003c2565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055506007828281518110620001b157620001b1620003c2565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b039092169190911790555b80620001f981620003d8565b915050620000ff565b50600154600054604051632210724360e11b81526001600160a01b039182166004820152911690634420e486906024016020604051808303816000875af115801562000252573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000278919062000400565b5050506200041a565b80516001600160a01b03811681146200029957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215620002c857600080fd5b620002d38362000281565b602084810151919350906001600160401b0380821115620002f357600080fd5b818601915086601f8301126200030857600080fd5b8151818111156200031d576200031d6200029e565b8060051b604051601f19603f830116810181811085821117156200034557620003456200029e565b6040529182528482019250838101850191898311156200036457600080fd5b938501935b828510156200038d576200037d8562000281565b8452938501939285019262000369565b8096505050505050509250929050565b600060208284031215620003b057600080fd5b620003bb8262000281565b9392505050565b634e487b7160e01b600052603260045260246000fd5b600060018201620003f957634e487b7160e01b600052601160045260246000fd5b5060010190565b6000602082840312156200041357600080fd5b5051919050565b60805160a051611aeb62000471600039600081816102d90152818161089b01528181610cdb015261125e0152600081816101da01528181610a6e01528181610c9801528181610ed601526111700152611aeb6000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c80639cc7f708116100de578063e688639611610097578063f301af4211610071578063f301af4214610416578063f320772314610429578063f5f8d3651461043c578063f7412baf1461044f57600080fd5b8063e6886396146103da578063e8111a12146103e2578063f25e55a5146103eb57600080fd5b80639cc7f7081461034e5780639e2bf22c1461036e578063a28d4c9c14610381578063a7852afa14610394578063b66503cf146103a7578063da09d19d146103ba57600080fd5b8063505897931161014b5780638dd598fb116101255780638dd598fb146102d457806392777b29146102fb5780639418f9391461032657806399bcc0521461033b57600080fd5b8063505897931461028e578063638634ee146102ae57806376f4be36146102c157600080fd5b80630175e23b1461019357806318160ddd146101b95780633e491d47146101c257806346c96aac146101d557806349dcc204146102145780634d5ce0381461025b575b600080fd5b6101a66101a1366004611795565b610476565b6040519081526020015b60405180910390f35b6101a660025481565b6101a66101d03660046117d6565b6104b8565b6101fc7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101b0565b610246610222366004611802565b60096020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101b0565b61027e610269366004611824565b60086020526000908152604090205460ff1681565b60405190151581526020016101b0565b6101a661029c366004611795565b600a6020526000908152604090205481565b6101a66102bc366004611824565b610741565b6101a66102cf366004611795565b610765565b6101fc7f000000000000000000000000000000000000000000000000000000000000000081565b6101a66103093660046117d6565b600460209081526000928352604080842090915290825290205481565b610339610334366004611841565b610899565b005b6101a6610349366004611824565b610a2a565b6101a661035c366004611795565b60036020526000908152604090205481565b61033961037c366004611802565b610a63565b6101a661038f366004611802565b610b34565b6103396103a2366004611899565b610c79565b6103396103b53660046117d6565b610e79565b6101a66103c8366004611824565b60056020526000908152604090205481565b6007546101a6565b6101a6600c5481565b6101a66103f93660046117d6565b600660209081526000928352604080842090915290825290205481565b6101fc610424366004611795565b61113b565b610339610437366004611802565b611165565b61033961044a366004611899565b61122e565b61024661045d366004611795565b600b602052600090815260409020805460019091015482565b60008061048283611402565b9050600061049362093a8083611980565b90508084106104ae576104a98262093a80611980565b6104b0565b815b949350505050565b6001600160a01b0382166000908152600660209081526040808320848452825280832054600a90925282205482036104f457600091505061073b565b60006105008483610b34565b6000858152600a60205260408120549192509061051f90600190611998565b90506000610540604051806040016040528060008152602001600081525090565b61054985611402565b81526001831561065a57845b610560600186611998565b81116106585760008981526009602090815260408083208484528252808320815180830190925280548083526001909101549282019290925291906105a490611402565b85519091508111156105c25760208501516105bf9087611980565b95505b808552600b60006105d96102cf62093a8085611980565b815260200190815260200160002060010154935083600460008e6001600160a01b03166001600160a01b03168152602001908152602001600020600083815260200190815260200160002054836020015161063491906119af565b61063e91906119e4565b602086015250819050610650816119f8565b915050610555565b505b600088815260096020908152604080832087845282528083208151808301909252805480835260019091015492820192909252919061069890611402565b905060006106a962093a8083611980565b90508042111561072f57600b60006106c083610765565b815260200190815260200160002060010154600460008e6001600160a01b03166001600160a01b03168152602001908152602001600020600084815260200190815260200160002054846020015161071891906119af565b61072291906119e4565b61072c9087611980565b95505b50939750505050505050505b92915050565b6001600160a01b03811660009081526005602052604081205461073b90429061141b565b600c5460009080820361077b5750600092915050565b82600b600061078b600185611998565b815260200190815260200160002060000154116107b4576107ad600182611998565b9392505050565b60008052600b6020527fdf7de25b7f1fd6d0b5205f0e18f1f35bd7b8d84cce336588d184533ce43a6f76548310156107ef5750600092915050565b6000806107fd600184611998565b90505b8181111561089157600060026108168484611998565b61082091906119e4565b61082a9083611998565b6000818152600b602090815260409182902082518084019093528054808452600190910154918301919091529192509087900361086b575095945050505050565b805187111561087c5781935061088a565b610887600183611998565b92505b5050610800565b509392505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166385f2aef26040518163ffffffff1660e01b81526004016020604051808303816000875af11580156108f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091d9190611a11565b6001600160a01b0316336001600160a01b03161461096e5760405162461bcd60e51b81526020600482015260096024820152686f6e6c79207465616d60b81b60448201526064015b60405180910390fd5b816001600160a01b03166007848154811061098b5761098b611a2e565b6000918252602090912001546001600160a01b0316146109aa57600080fd5b6001600160a01b03808316600090815260086020526040808220805460ff19908116909155928416825290208054909116600117905560078054829190859081106109f7576109f7611a2e565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550505050565b600080610a3642610476565b6001600160a01b039093166000908152600460209081526040808320958352949052929092205492915050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610a9857600080fd5b8160026000828254610aaa9190611998565b909155505060008181526003602052604081208054849290610acd908490611998565b9091555050600081815260036020526040902054610aec908290611431565b610af461150a565b604080518281526020810184905233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b56891015b60405180910390a25050565b6000828152600a6020526040812054808203610b5457600091505061073b565b60008481526009602052604081208491610b6f600185611998565b81526020019081526020016000206000015411610b9957610b91600182611998565b91505061073b565b6000848152600960209081526040808320838052909152902054831015610bc457600091505061073b565b600080610bd2600184611998565b90505b81811115610c705760006002610beb8484611998565b610bf591906119e4565b610bff9083611998565b6000888152600960209081526040808320848452825291829020825180840190935280548084526001909101549183019190915291925090879003610c4a5750935061073b92505050565b8051871115610c5b57819350610c69565b610c66600183611998565b92505b5050610bd5565b50949350505050565b600d54600114610c8857600080fd5b6002600d55336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610cc257600080fd5b6040516331a9108f60e11b8152600481018390526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015610d2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4e9190611a11565b905060005b8251811015610e6e576000610d81848381518110610d7357610d73611a2e565b6020026020010151866104b8565b90504260066000868581518110610d9a57610d9a611a2e565b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081208982529092529020558015610df557610df5848381518110610de657610de6611a2e565b602002602001015184836115ae565b838281518110610e0757610e07611a2e565b60200260200101516001600160a01b0316836001600160a01b03167f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc983604051610e5391815260200190565b60405180910390a35080610e66816119f8565b915050610d53565b50506001600d555050565b600d54600114610e8857600080fd5b6002600d5580610e9757600080fd5b6001600160a01b03821660009081526008602052604090205460ff16610fdf57604051633af32abf60e01b81526001600160a01b0383811660048301527f00000000000000000000000000000000000000000000000000000000000000001690633af32abf90602401602060405180830381865afa158015610f1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f419190611a44565b610f8d5760405162461bcd60e51b815260206004820181905260248201527f627269626520746f6b656e73206d7573742062652077686974656c69737465646044820152606401610965565b600754601011610fdf5760405162461bcd60e51b815260206004820152601760248201527f746f6f206d616e79207265776172647320746f6b656e730000000000000000006044820152606401610965565b6000610fea42610476565b6001600160a01b038416600090815260046020908152604080832084845290915290205490915061101d8433308661169d565b6110278382611980565b6001600160a01b038516600090815260046020908152604080832086845290915290205561105862093a8083611980565b6001600160a01b03851660009081526005602090815260408083209390935560089052205460ff166110ea576001600160a01b0384166000818152600860205260408120805460ff191660019081179091556007805491820181559091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b03191690911790555b60408051838152602081018590526001600160a01b0386169133917f52977ea98a2220a03ee9ba5cb003ada08d394ea10155483c95dc2dc77a7eb24b910160405180910390a350506001600d555050565b6007818154811061114b57600080fd5b6000918252602090912001546001600160a01b0316905081565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461119a57600080fd5b81600260008282546111ac9190611980565b9091555050600081815260036020526040812080548492906111cf908490611980565b90915550506000818152600360205260409020546111ee908290611431565b6111f661150a565b604080518281526020810184905233917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159101610b28565b600d5460011461123d57600080fd5b6002600d5560405163430c208160e01b8152336004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063430c208190604401602060405180830381865afa1580156112ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112d19190611a44565b6112da57600080fd5b60005b81518110156113f857600061130b8383815181106112fd576112fd611a2e565b6020026020010151856104b8565b9050426006600085858151811061132457611324611a2e565b6020908102919091018101516001600160a01b031682528181019290925260409081016000908120888252909252902055801561137f5761137f83838151811061137057611370611a2e565b602002602001015133836115ae565b82828151811061139157611391611a2e565b60200260200101516001600160a01b0316336001600160a01b03167f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc9836040516113dd91815260200190565b60405180910390a350806113f0816119f8565b9150506112dd565b50506001600d5550565b600061141162093a8083611a66565b61073b9083611998565b600081831061142a57816107ad565b5090919050565b6000828152600a60205260409020544290801580159061147b575060008481526009602052604081208391611467600185611998565b815260200190815260200160002060000154145b156114b4576000848152600960205260408120849161149b600185611998565b8152602081019190915260400160002060010155611504565b60408051808201825283815260208082018681526000888152600983528481208682529092529290209051815590516001918201556114f4908290611980565b6000858152600a60205260409020555b50505050565b600c5442811580159061153c575080600b6000611528600186611998565b815260200190815260200160002060000154145b1561156b57600254600b6000611553600186611998565b81526020810191909152604001600020600101555050565b60408051808201825282815260025460208083019182526000868152600b909152929092209051815590516001918201556115a7908390611980565b600c555050565b6000836001600160a01b03163b116115c557600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916116219190611a7a565b6000604051808303816000865af19150503d806000811461165e576040519150601f19603f3d011682016040523d82523d6000602084013e611663565b606091505b509150915081801561168d57508051158061168d57508080602001905181019061168d9190611a44565b61169657600080fd5b5050505050565b6000846001600160a01b03163b116116b457600080fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916117189190611a7a565b6000604051808303816000865af19150503d8060008114611755576040519150601f19603f3d011682016040523d82523d6000602084013e61175a565b606091505b50915091508180156117845750805115806117845750808060200190518101906117849190611a44565b61178d57600080fd5b505050505050565b6000602082840312156117a757600080fd5b5035919050565b6001600160a01b03811681146117c357600080fd5b50565b80356117d1816117ae565b919050565b600080604083850312156117e957600080fd5b82356117f4816117ae565b946020939093013593505050565b6000806040838503121561181557600080fd5b50508035926020909101359150565b60006020828403121561183657600080fd5b81356107ad816117ae565b60008060006060848603121561185657600080fd5b833592506020840135611868816117ae565b91506040840135611878816117ae565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156118ac57600080fd5b8235915060208084013567ffffffffffffffff808211156118cc57600080fd5b818601915086601f8301126118e057600080fd5b8135818111156118f2576118f2611883565b8060051b604051601f19603f8301168101818110858211171561191757611917611883565b60405291825284820192508381018501918983111561193557600080fd5b938501935b8285101561195a5761194b856117c6565b8452938501939285019261193a565b8096505050505050509250929050565b634e487b7160e01b600052601160045260246000fd5b600082198211156119935761199361196a565b500190565b6000828210156119aa576119aa61196a565b500390565b60008160001904831182151516156119c9576119c961196a565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826119f3576119f36119ce565b500490565b600060018201611a0a57611a0a61196a565b5060010190565b600060208284031215611a2357600080fd5b81516107ad816117ae565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611a5657600080fd5b815180151581146107ad57600080fd5b600082611a7557611a756119ce565b500690565b6000825160005b81811015611a9b5760208186018101518583015201611a81565b81811115611aaa576000828501525b50919091019291505056fea2646970667358221220936158a5e0e91ea3c494ae724b180b263a618ef19ba52e2f0dc9fa01b2737a4c64736f6c634300080d0033a26469706673582212204e71db3f790de2d848b40206f2aa7dc0ac0c47517ce21a2555c1148046cccf7664736f6c634300080d0033

The different part in the middle of the bytecode (also differs at the end). Above one on-chain, below recompiled.

9291505056fea26469706673582212206bd63dcd50d2d0978656869a799a0d2f5a2b01beb86cc5a1d0d9b99276d22d3864736f6c634300080d003360c060405260008054600
9291505056fea2646970667358221220a67ce37505c372adb0395a9c3ba3422cac77dc8fa4d76540eb3e999a75b5d0d064736f6c634300080d003360c060405260008054600

@sealer3
Copy link
Contributor

sealer3 commented Aug 19, 2023

Does recompiling with changed metadata (e.g. all sources have a newline appended to them) affect other parts of the bytecode besides the metadata hash? If not, it might be a crude way of finding the metadata blocks.

@kuzdogan
Copy link
Member

Does recompiling with changed metadata (e.g. all sources have a newline appended to them) affect other parts of the bytecode besides the metadata hash? If not, it might be a crude way of finding the metadata blocks.

Yes but it only affects the respective contracts. So if you add a comment to the child contract its hash will change, whereas adding a comment to the factory contract will only that contract's hash.

In fact, this is how Blockscout is finding hashes. @rimrakhimov Are you adding comments etc. to all files?

We got to know about this a while ago but these days we have some more immediate things we need to address.

@rimrakhimov
Copy link
Contributor

rimrakhimov commented Aug 21, 2023

@kuzdogan We are just adding a space at the end of each file, yes (https://github.com/blockscout/blockscout-rs/blob/main/smart-contract-verifier/smart-contract-verifier/src/verifier/compiler_input.rs#L10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants