{
"id": "ssc-b8923f70-c1f7-497f-961j",
"json": {
"contractName": "contract",
"contractAction": "deploy",
"contractPayload": {
"name": "smmkt",
"code": "Y29uc3QgVE9LRU5TWU1CT0wgPSAnU01NS1QnOwphY3Rpb25zLmNyZWF0ZVNTQyA9IGZ1bmN0aW9uIChwYXlsb2FkKSB7CiAgZGIuY3JlYXRlVGFibGUoJ2JhbGFuY2VzJyk7CiAgbGV0IHJld2FyZHMgPSBkYi5jcmVhdGVUYWJsZSgncmV3YXJkcycpOwogIHJld2FyZHMuaW5zZXJ0KHsKICAgICdwZW5kaW5nUmV3YXJkcyc6IDAsCiAgICAncmV3YXJkc0Rpc3RyaWJ1dGlvbkludGVydmFsJzogMzAwMDAsCiAgICAnbGFzdEJsb2NrUmV3YXJkJzogcmVmU3RlZW1CbG9ja051bWJlciwKICAgICd0b2tlbklzc3VhbmNlUmF0ZSc6IDEsCiAgICAnbmV4dEhhbHZpbmcnOiA1MDAwMDAsCiAgICAnYmVuZWZpY2lhcmllcyc6IFsnc21tYXJrZXR0b2tlbiddCiAgfSkKfQoKYWN0aW9ucy51cGRhdGVSZXdhcmRzRGlzdHJpYnV0aW9uSW50ZXJ2YWwgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogIGlmIChzZW5kZXIgIT09IG93bmVyKSByZXR1cm47CgogIGNvbnN0IHsgbmJCbG9ja3MgfSA9IHBheWxvYWQ7CgogIGlmIChOdW1iZXIuaXNJbnRlZ2VyKG5iQmxvY2tzKSkgewogICAgbGV0IHJld2FyZHMgPSBkYi5nZXRUYWJsZSgncmV3YXJkcycpOwogICAgbGV0IHJlYyA9IHJld2FyZHMuZmluZE9uZSh7fSk7CiAgICByZWMucmV3YXJkc0Rpc3RyaWJ1dGlvbkludGVydmFsID0gbmJCbG9ja3M7CiAgICByZXdhcmRzLnVwZGF0ZShyZWMpOwogIH0KfQoKYWN0aW9ucy51cGRhdGVCZW5lZmljaWFyaWVzID0gZnVuY3Rpb24gKHBheWxvYWQpIHsKIC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