Test body
Test Body 2
##STEEMCONTRACTSBEGIN##test_contract_users##addUser##{ "username": "AwesomeUsername" }##STEEMCONTRACTSEND##
test comment 5
It's hard to say, but The ENIAC is regarded as the first 'real' computer. It was developed at University of Pennsylvania in 1946.
another comment
yes, marx had made some interesting observations.
test
test 6
test 7 test 73 test 75
test !zè§!èz
etrtrt
post test comment
***test
test dffdgerter
test comment
##STEEMCONTRACTSBEGIN##CONTRACTNAME##CONTRACTACTION##PAYLOAD##STEEMCONTRACTSEND##
##STEEMCONTRACTSBEGIN##test_contract'##hello##{ "name": "Harpagon" }##STEEMCONTRACTSEND##
##STEEMCONTRACTSBEGIN##test_contract##hello##{ "name": "Harpagon" }##STEEMCONTRACTSEND##
##STEEMCONTRACTSBEGIN##contract##deploy##if(payload&&payload.name&&'string'==typeof payload.name){const a='Hello '+payload.name;db.greetings=db.greetings?db.greetings:db.greetings=[],db.greetings.push(a)}##STEEMCONTRACTSEND##
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract", "code": "if(payload&&payload.name&&'string'==typeof payload.name){const a='Hello '+payload.name;db.greetings=db.greetings?db.greetings:db.greetings=[],db.greetings.push(a)}"}##STEEMCONTRACTSEND##
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": "actions.addUser=function(a){const{username:b}=a;if(b&&'string'==typeof b){let c=db.getTable('users'),d=db.findJsonPath(c,$..[?(@.id == '\${sender}')]);if(d);else{const e={id:sender,username:b};c.push(e)}}},actions.updateUser=function(a){const{username:b}=a;if(b&&'string'==typeof b){let c=db.getTable('users'),d=db.findJsonPath(c,$..[?(@.id == '\${sender}')]);d&&(d.username=b)}},actions.removeUser=function(a){if(sender==owner){const{userId:b}=a;if(b&&'string'==typeof b){let c=db.getTable('users');const d=c.findIndex(e=>e.id===b);-1!=d&&c.splice(d,1)}}};"}##STEEMCONTRACTSEND##
$..[?(@.id == '\${sender}')]
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": "actions.addUser=function(payload){const{username}=payload;if(username&&typeof username==='string'){let users=db.getTable('users');let user=db.findJsonPath(users,`$..[?(@.id=='${sender}')]`);if(user){}else{const newUser={'id':sender,'username':username};users.push(newUser)}}}actions.updateUser=function(payload){const{username}=payload;if(username&&typeof username==='string'){let users=db.getTable('users');let user=db.findJsonPath(users,`$..[?(@.id=='${sender}')]`);if(user)user.username=username}}actions.removeUser=function(payload){if(sender!=owner)return;const{userId}=payload;if(userId&&typeof userId==='string'){let users=db.getTable('users');const index=users.findIndex(user=>user.id===userId);if(index!=-1)users.splice(index,1)}}"}##STEEMCONTRACTSEND##
{ "id": "ssc-b8923f70-c1f7-497f-961d", "json": { "contractName": "contract", "contractAction": "deploy", "contractPayload": { "name": "account", "code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogIGRiLmNyZWF0ZVRhYmxlKCdhY2NvdW50cycpOwp9CgovLyByZWdpc3RlciBhbiBhY2NvdW50IGhlbHBzIG90aGVyIGNvbnRyYWN0cyB0byBrbm93IAovLyBpZiBhbiBhY2NvdW50IGV4aXN0cyBvbiB0aGUgU3RlZW0gYmxvY2tjaGFpbgphY3Rpb25zLnJlZ2lzdGVyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsKICBsZXQgYWNjb3VudHMgPSBkYi5nZXRUYWJsZSgnYWNjb3VudHMnKTsKCiAgbGV0IGFjY291bnQgPSBhY2NvdW50cy5maW5kT25lKHsgJ2lkJzogc2VuZGVyIH0pOwoKICBpZiAoYWNjb3VudCA9PT0gbnVsbCkgewogICAgY29uc3QgbmV3QWNjb3VudCA9IHsKICAgICAgJ2lkJzogc2VuZGVyCiAgICB9OwoKICAgIGFjY291bnRzLmluc2VydChuZXdBY2NvdW50KTsKICB9IAp9" } } }
{ "id": "ssc-b8923f70-c1f7-497f-961d", "json": { "contractName": "contract", "contractAction": "deploy", "contractPayload": { "name": "token", "code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdG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GJlIHBvc2l0aXZlJykpIHsKICAgICAgICAgICAgbGV0IHRva2VucyA9IGRiLmdldFRhYmxlKCd0b2tlbnMnKTsKICAgIAogICAgICAgICAgICAvLyBjaGVjayBpZiB0aGUgdG9rZW4gYWxyZWFkeSBleGlzdHMKICAgICAgICAgICAgbGV0IHRva2VuID0gdG9rZW5zLmZpbmRPbmUoeyBzeW1ib2wgfSk7CiAgICAKICAgICAgICAgICAgaWYgKGFzc2VydCh0b2tlbiA9PT0gbnVsbCwgJ3N5bWJvbCBhbHJlYWR5IGV4aXN0cycpKSB7IAogICAgICAgICAgICAgIGNvbnN0IG5ld1Rva2VuID0gewogICAgICAgICAgICAgICAgJ2lzc3Vlcic6IHNlbmRlciwKICAgICAgICAgICAgICAgIHN5bWJvbCwKICAgICAgICAgICAgICAgIHByZWNpc2lvbiwKICAgICAgICAgICAgICAgIG1heFN1cHBseSwKICAgICAgICAgICAgICAgICdzdXBwbHknOiAwCiAgICAgICAgICAgICAgfTsKICAgICAgICAgIAogICAgICAgICAgICAgIHRva2Vucy5pbnNlcnQobmV3VG9rZW4pOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICAKICAgIGFjdGlvbnMuaXNzdWUgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogICAgICBjb25zdCB7IHRvLCBzeW1ib2wsIHF1YW50aXR5IH0gPSBwYXlsb2FkOwogICAgCiAgICAgIGlmICh0byAmJiB0eXBlb2YgdG8gPT09ICdzdHJpbmcnCiAgICAgICAgICAmJiBzeW1ib2wgJiYgdHlwZW9mIHN5bWJvbCA9PT0gJ3N0cmluZycKICAgICAgICAgICYmIHF1YW50aXR5ICYmIHR5cGVvZiBxdWFudGl0eSA9PT0gJ251bWJlcicpIHsKICAgICAgICAKICAgICAgICBsZXQgdG9rZW5zID0gZGIuZ2V0VGFibGUoJ3Rva2VucycpOwogICAgICAgIGxldCB0b2tlbiA9IHRva2Vucy5maW5kT25lKHsgc3ltYm9sIH0pOw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wgbGV0J3Mgbm93IGlzc3VlIHRoZSB0b2tlbnMKICAgIAogICAgICAgICAgICAgIHRva2VuLnN1cHBseSA9IGNhbGN1bGF0ZUJhbGFuY2UodG9rZW4uc3VwcGx5LCBxdWFudGl0eSwgdG9rZW4ucHJlY2lzaW9uLCB0cnVlKTsKICAgICAgICAgICAgICB0b2tlbnMudXBkYXRlKHRva2VuKTsKICAgICAgICAgICAgICAKICAgICAgICAgICAgICBhZGRCYWxhbmNlKHRva2VuLmlzc3VlciwgdG9rZW4sIHF1YW50aXR5KTsKICAgIAogICAgICAgICAgICAgIGlmKHRvICE9PSB0b2tlbi5pc3N1ZXIpIHsKICAgICAgICAgICAgICAgIGFjdGlvbnMudHJhbnNmZXIocGF5bG9hZCk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICAKICAgIGFjdGlvbnMudHJhbnNmZXIgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogICAgICBjb25zdCB7IHRvLCBzeW1ib2wsIHF1YW50aXR5IH0gPSBwYXlsb2FkOwogICAgCiAgICAgIGlmICh0byAmJiB0eXBlb2YgdG8gPT09ICdzdHJpbmcnCiAgICAgICAgICAmJiBzeW1ib2wgJiYgdHlwZW9mIHN5bWJvbCA9PT0gJ3N0cmluZycKICAgICAgICAgICYmIHF1YW50aXR5ICYmIHR5cGVvZiBxdWFudGl0eSA9PT0gJ251bWJlcicpIHsKICAgIAogICAgICAgIGlmIChhc3NlcnQodG8gIT09IHNlbmRlciwgJ2Nhbm5vdCB0cmFuc2ZlciB0byBzZWxmJykpIHsKICAgICAgICAgIGxldCBhY2NvdW50ID0gZGIuZmluZE9uZUluVGFibGUoJ2FjY291bnQnLCAnYWNjb3VudHMnLCB7ICdpZCc6IHRvIH0pOwogICAgCiAgICAgICAgICAvLyB0aGUgYWNjb3VudCBtdXN0IGhhdmUgYmVlbiByZWdpc3RlcmVkIGJlZm9yZQogICAgICAgICAgaWYgKGFzc2VydChhY2NvdW50ICE9PSBudWxsLCAndG8gYWNjb3VudCBkb2VzIG5vdCBleGlzdCcpKSB7CiAgICAgICAgICAgIGxldCB0b2tlbnMgPSBkYi5nZXRUYWJsZSgndG9rZW5zJyk7CiAgICAgICAgICAgIGxldCB0b2tlbiA9IHRva2Vucy5maW5kT25lKHsgc3ltYm9sIH0pOwogICAgCiAgICAgICAgICAgIC8vIHRoZSBzeW1ib2wgbXVzdCBleGlzdAogICAgICAgICAgICAvLyB0aGVuIHdlIG5lZWQgdG8gY2hlY2sgdGhhdCB0aGUgcXVhbnRpdHkgaXMgY29ycmVjdAogICAgICAgICAgICBpZiAoYXNzZXJ0KHRva2VuICE9PSBudWxsLCAnc3ltYm9sIGRvZXMgbm90IGV4aXN0JykKICAgICAgICAgICAgICAgICYmIGFzc2VydChjb3VudERlY2ltYWxzKHF1YW50aXR5KSA8PSB0b2tlbi5wcmVjaXNpb24sICdzeW1ib2wgcHJlY2lzaW9uIG1pc21hdGNoJykKICAgICAgICAgICAgICAgICYmIGFzc2VydChxdWFudGl0eSA+IDAsICdtdXN0IHRyYW5zZmVyIHBvc2l0aXZlIHF1YW50aXR5JykpIHsKICAgICAgICAgICAgICAKICAgICAgICAgICAgICBpZiAoc3ViQmFsYW5jZShzZW5kZXIsIHRva2VuLCBxdWFudGl0eSkpIHsKICAgICAgICAgICAgICAgIGFkZEJhbGFuY2UodG8sIHRva2VuLCBxdWFudGl0eSk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICAKICAgIGxldCBzdWJCYWxhbmNlID0gZnVuY3Rpb24gKGFjY291bnQsIHRva2VuLCBxdWFudGl0eSkgewogICAgICBsZXQgYmFsYW5jZXMgPSBkYi5nZXRUYWJsZSgnYmFsYW5jZXMnKTsKICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlcy5maW5kT25lKHsgYWNjb3VudCwgJ3N5bWJvbCc6IH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XJ0KGJhbGFuY2UpOwogICAgICB9IGVsc2UgewogICAgICAgIGJhbGFuY2UuYmFsYW5jZSA9IGNhbGN1bGF0ZUJhbGFuY2UoYmFsYW5jZS5iYWxhbmNlLCBxdWFudGl0eSwgdG9rZW4ucHJlY2lzaW9uLCB0cnVlKTsKICAgIAogICAgICAgIGJhbGFuY2VzLnVwZGF0ZShiYWxhbmNlKTsKICAgICAgfQogICAgfQoKICAgIGxldCBjYWxjdWxhdGVCYWxhbmNlID0gZnVuY3Rpb24gKGJhbGFuY2UsIHF1YW50aXR5LCBwcmVjaXNpb24sIGFkZCkgewogICAgICBpZiAocHJlY2lzaW9uID09PSAwKSB7CiAgICAgICAgcmV0dXJuIGFkZCA/IGJhbGFuY2UgKyBxdWFudGl0eSA6IGJhbGFuY2UgLSBxdWFudGl0eSAKICAgICAgfQoKICAgICAgbGV0IHJhdGUgPSBNYXRoLnBvdygxMCwgcHJlY2lzaW9uKTsKICAgICAgbGV0IHRtcFF0eSA9IHF1YW50aXR5ICogcmF0ZTsKICAgICAgbGV0IHRtcEJhbGFuY2U9IGJhbGFuY2UgKiByYXRlOwoKICAgICAgcmV0dXJuIGFkZCA/ICh0bXBCYWxhbmNlICsgdG1wUXR5KSAvIHJhdGUgOiAodG1wQmFsYW5jZSAtIHRtcFF0eSkgLyByYXRlOwogICAgfQogICAgCiAgICBsZXQgY291bnREZWNpbWFscyA9IGZ1bmN0aW9uICh2YWx1ZSkgewogICAgICBpZihNYXRoLmZsb29yKHZhbHVlKSA9PT0gdmFsdWUpIHJldHVybiAwOwogICAgICByZXR1cm4gdmFsdWUudG9TdHJpbmcoKS5zcGxpdCgnLicpWzFdLmxlbmd0aCB8fCAwOyAKICAgIH0=" } } }
{ "id": "ssc-b8923f70-c1f7-497f-961d", "json": { "contractName": "account2", "contractAction": "register", "contractPayload": {} } }
{ "id": "ssc-b8923f70-c1f7-497f-961g", "json": { "contractName": "contract", "contractAction": "deploy", "contractPayload": { "name": "account", "code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogIGRiLmNyZWF0ZVRhYmxlKCdhY2NvdW50cycpOwp9CgovLyByZWdpc3RlciBhbiBhY2NvdW50IGhlbHBzIG90aGVyIGNvbnRyYWN0cyB0byBrbm93IAovLyBpZiBhbiBhY2NvdW50IGV4aXN0cyBvbiB0aGUgU3RlZW0gYmxvY2tjaGFpbgphY3Rpb25zLnJlZ2lzdGVyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsKICBsZXQgYWNjb3VudHMgPSBkYi5nZXRUYWJsZSgnYWNjb3VudHMnKTsKCiAgbGV0IGFjY291bnQgPSBhY2NvdW50cy5maW5kT25lKHsgJ2lkJzogc2VuZGVyIH0pOwoKICBpZiAoYWNjb3VudCA9PT0gbnVsbCkgewogICAgY29uc3QgbmV3QWNjb3VudCA9IHsKICAgICAgJ2lkJzogc2VuZGVyCiAgICB9OwoKICAgIGFjY291bnRzLmluc2VydChuZXdBY2NvdW50KTsKICB9IAp9" } } }
{ "id": "ssc-b8923f70-c1f7-497f-961g", "json": { "contractName": "account", "contractAction": "register", "contractPayload": {} } }
{ "id": "ssc-b8923f70-c1f7-497f-961d", "json": { "contractName": "account", "contractAction": "register", "contractPayload": {} } }
{ "id": "ssc-b8923f70-c1f7-497f-961d", "json": { "contractName": "token", "contractAction": "create", "contractPayload": { "symbol": "PKTC", "precision": 0, "maxSupply": 1000000 } } }
{ "id": "ssc-b8923f70-c1f7-497f-961d", "json": { "contractName": "token", "contractAction": "issue", "contractPayload": { "symbol": "PKTC", "to": "harpagon", "quantity": 100 } } }
{ "id": "ssc-b8923f70-c1f7-497f-961d", "json": { "contractName": "token", "contractAction": "issue", "contractPayload": { "symbol": "PKTC", "to": "harpagon", "quantity": 900 } } }
{ "id": "ssc-b8923f70-c1f7-497f-961g", "json": { "contractName": "contract", "contractAction": "deploy", "contractPayload": { "name": "token", "code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbi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HVlKSB7CiAgaWYgKE1hdGguZmxvb3IodmFsdWUpID09PSB2YWx1ZSkgcmV0dXJuIDA7CiAgcmV0dXJuIHZhbHVlLnRvU3RyaW5nKCkuc3BsaXQoJy4nKVsxXS5sZW5ndGggfHwgMDsKfQ==" } } }
{ "id": "ssc-b8923f70-c1f7-497f-961d-g", "json": { "contractName": "token", "contractAction": "create", "contractPayload": { "symbol": "PKTC", "precision": 0, "maxSupply": 1000000 } } }
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": "actions.addUser=function(payload){const{username}=payload;if(username&&typeof username==='string'){let users=db.getTable('users');let user=db.findJsonPath(users,"$..[?(@.id == '"+sender+"')]");if(user){}else{const newUser={'id':sender,'username':username};users.push(newUser)}}}actions.updateUser=function(payload){const{username}=payload;if(username&&typeof username==='string'){let users=db.getTable('users');let user=db.findJsonPath(users,"$..[?(@.id == '"+sender+"')]");if(user)user.username=username}}actions.removeUser=function(payload){if(sender!=owner)return;const{userId}=payload;if(userId&&typeof userId==='string'){let users=db.getTable('users');const index=users.findIndex(user=>user.id===userId);if(index!=-1)users.splice(index,1)}}"}##STEEMCONTRACTSEND##
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": "actions.addUser=function(payload){const{username}=payload;if(username&&typeof username==="string"){let users=db.getTable("users");let user=db.findJsonPath(users,"$..[?(@.id == '"+sender+"')]");if(user){}else{const newUser={"id":sender,"username":username};users.push(newUser)}}}actions.updateUser=function(payload){const{username}=payload;if(username&&typeof username==="string"){let users=db.getTable("users");let user=db.findJsonPath(users,"$..[?(@.id == '"+sender+"')]");if(user)user.username=username}}actions.removeUser=function(payload){if(sender!=owner)return;const{userId}=payload;if(userId&&typeof userId==="string"){let users=db.getTable("users");const index=users.findIndex(user=>user.id===userId);if(index!=-1)users.splice(index,1)}}"}##STEEMCONTRACTSEND##
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": 'actions.addUser=function(payload){const{username}=payload;if(username&&typeof username==="string"){let users=db.getTable("users");let user=db.findJsonPath(users,"$..[?(@.id == '"+sender+"')]");if(user){}else{const newUser={"id":sender,"username":username};users.push(newUser)}}}actions.updateUser=function(payload){const{username}=payload;if(username&&typeof username==="string"){let users=db.getTable("users");let user=db.findJsonPath(users,"$..[?(@.id == '"+sender+"')]");if(user)user.username=username}}actions.removeUser=function(payload){if(sender!=owner)return;const{userId}=payload;if(userId&&typeof userId==="string"){let users=db.getTable("users");const index=users.findIndex(user=>user.id===userId);if(index!=-1)users.splice(index,1)}}'}##STEEMCONTRACTSEND##
test comment 2
edited comment
test reply
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": "actions.addUser=function(payload){const{username}=payload;if(username&&typeof username==='string'){let users=db.getTable('users');let user=db.findJsonPath(users,'$..[?(@.id == ''+sender+'')]');if(user){}else{const newUser={'id':sender,'username':username};users.push(newUser)}}}actions.updateUser=function(payload){const{username}=payload;if(username&&typeof username==='string'){let users=db.getTable('users');let user=db.findJsonPath(users,'$..[?(@.id == ''+sender+'')]');if(user)user.username=username}}actions.removeUser=function(payload){if(sender!=owner)return;const{userId}=payload;if(userId&&typeof userId==='string'){let users=db.getTable('users');const index=users.findIndex(user=>user.id===userId);if(index!=-1)users.splice(index,1)}}"}##STEEMCONTRACTSEND##
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": "YWN0aW9ucy5hZGRVc2VyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsNCiAgICBjb25zdCB7IHVzZXJuYW1lIH0gPSBwYXlsb2FkOw0KICAgIGlmICh1c2VybmFtZSAmJiB0eXBlb2YgdXNlcm5hbWUgPT09ICdzdHJpbmcnKXsNCg0KICAgICAgbGV0IHVzZXJzID0gZGIuZ2V0VGFibGUoJ3VzZXJzJyk7DQoNCiAgICAgIGxldCB1c2VyID0gZGIuZmluZEpzb25QYXRoKHVzZXJzLCBgJC4uWz8oQC5pZCA9PSAnXCR7c2VuZGVyfScpXWAp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gdXNlcnMuc3BsaWNlKGluZGV4LCAxKTsNCiAgICB9DQogIH0="}##STEEMCONTRACTSEND##
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "users_contract", "code": "YWN0aW9ucy5jcmVhdGUgPSBmdW5jdGlvbiAocGF5bG9hZCkgew0KICAgICAgZGIuY3JlYXRlVGFibGUoJ3VzZXJzJyk7DQogICAgfQ0KDQogICAgYWN0aW9ucy5hZGRVc2VyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsNCiAgICAgIGNvbnN0IHsgdXNlcm5hbWUgfSA9IHBheWxvYWQ7DQogICAgICBpZiAodXNlcm5hbWUgJiYgdHlwZW9mIHVzZXJuYW1lID09PSAnc3RyaW5nJyl7DQoNCiAgICAgICAgbGV0IHVzZXJzID0gZGIuZ2V0VGFibGUoJ3VzZXJzJyk7DQoNCiAgICAgICAgbGV0IHVzZXIgPSB1c2Vycy5maW5kT25lKHsgJ2lkJzogc2VuZGVyIH0pOw0KDQogICAgICAgIGlmICh1c2VyID09PSBudWxsKSB7DQogICAgICAgICAgY29uc3QgbmV3VXNlciA9IHsNCiAgICAgICAgICAgICdpZCc6IHNlbmRlciwNCiAgICAgICAgICAgICd1c2VybmFtZSc6IHVzZXJuYW1lLA0KICAgICAgICAgICAgJ3ZlcmlmaWVkJzogZmFsc2UsDQogICAgICAgICAgfTsNCg0KICAgICAgICAgIHVzZXJzLmluc2VydChuZXdVc2VyKTsNCiAgICAgICAgICBlbWl0KCduZXdVc2VyQ3JlYXRlZCcsIG5ld1VzZXIpOw0KICAgICAgICB9IA0KICAgICAgfQ0KICAgIH0NCg0KICAgIGFjdGlvbnMudXBkYXRlVXNlciA9IGZ1bmN0aW9uIChwYXlsb2FkKSB7DQogICAgICBjb25zdCB7IHVzZXJuYW1lIH0gPSBwYXlsb2FkOw0KICAgICAgaWYgKHVzZXJuYW1lICYmIHR5cGVvZiB1c2VybmFtZSA9PT0gJ3N0cmluZycpew0KDQogICAgICAgIGxldCB1c2VycyA9IGRiLmdldFRhYmxlKCd1c2VycycpOw0KICAgICAgICBsZXQgdXNlciA9IHVzZXJzLmZpbmRPbmUoeyAnaWQnOiBzZW5kZXIgfSk7DQogICAgICAgIGlmICh1c2VyKSB7DQogICAgICAgICAgdXNlci51c2VybmFtZSA9IHVzZXJuYW1lOw0KICAgICAgICAgIHVzZXJzLnVwZGF0ZSh1c2VyKTsNCiAgICAgICAgfQ0KICAgICAgfQ0KICAgIH0="##STEEMCONTRACTSEND##
##STEEMCONTRACTSBEGIN##users_contract##addUser##{ "username": "AwesomeUsername" }##STEEMCONTRACTSEND##
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "users_contract", "code": "YWN0aW9ucy5jcmVhdGUgPSBmdW5jdGlvbiAocGF5bG9hZCkgew0KICAgICAgZGIuY3JlYXRlVGFibGUoJ3VzZXJzJyk7DQogICAgfQ0KDQogICAgYWN0aW9ucy5hZGRVc2VyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsNCiAgICAgIGNvbnN0IHsgdXNlcm5hbWUgfSA9IHBheWxvYWQ7DQogICAgICBpZiAodXNlcm5hbWUgJiYgdHlwZW9mIHVzZXJuYW1lID09PSAnc3RyaW5nJyl7DQoNCiAgICAgICAgbGV0IHVzZXJzID0gZGIuZ2V0VGFibGUoJ3VzZXJzJyk7DQoNCiAgICAgICAgbGV0IHVzZXIgPSB1c2Vycy5maW5kT25lKHsgJ2lkJzogc2VuZGVyIH0pOw0KDQogICAgICAgIGlmICh1c2VyID09PSBudWxsKSB7DQogICAgICAgICAgY29uc3QgbmV3VXNlciA9IHsNCiAgICAgICAgICAgICdpZCc6IHNlbmRlciwNCiAgICAgICAgICAgICd1c2VybmFtZSc6IHVzZXJuYW1lLA0KICAgICAgICAgICAgJ3ZlcmlmaWVkJzogZmFsc2UsDQogICAgICAgICAgfTsNCg0KICAgICAgICAgIHVzZXJzLmluc2VydChuZXdVc2VyKTsNCiAgICAgICAgICBlbWl0KCduZXdVc2VyQ3JlYXRlZCcsIG5ld1VzZXIpOw0KICAgICAgICB9IA0KICAgICAgfQ0KICAgIH0NCg0KICAgIGFjdGlvbnMudXBkYXRlVXNlciA9IGZ1bmN0aW9uIChwYXlsb2FkKSB7DQogICAgICBjb25zdCB7IHVzZXJuYW1lIH0gPSBwYXlsb2FkOw0KICAgICAgaWYgKHVzZXJuYW1lICYmIHR5cGVvZiB1c2VybmFtZSA9PT0gJ3N0cmluZycpew0KDQogICAgICAgIGxldCB1c2VycyA9IGRiLmdldFRhYmxlKCd1c2VycycpOw0KICAgICAgICBsZXQgdXNlciA9IHVzZXJzLmZpbmRPbmUoeyAnaWQnOiBzZW5kZXIgfSk7DQogICAgICAgIGlmICh1c2VyKSB7DQogICAgICAgICAgdXNlci51c2VybmFtZSA9IHVzZXJuYW1lOw0KICAgICAgICAgIHVzZXJzLnVwZGF0ZSh1c2VyKTsNCiAgICAgICAgfQ0KICAgICAgfQ0KICAgIH0="}##STEEMCONTRACTSEND##
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "users_test_contract", "code": "YWN0aW9ucy5jcmVhdGUgPSBmdW5jdGlvbiAocGF5bG9hZCkgew0KICAgICAgZGIuY3JlYXRlVGFibGUoJ3VzZXJzJyk7DQogICAgfQ0KDQogICAgYWN0aW9ucy5hZGRVc2VyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsNCiAgICAgIGNvbnN0IHsgdXNlcm5hbWUgfSA9IHBheWxvYWQ7DQogICAgICBpZiAodXNlcm5hbWUgJiYgdHlwZW9mIHVzZXJuYW1lID09PSAnc3RyaW5nJyl7DQoNCiAgICAgICAgbGV0IHVzZXJzID0gZGIuZ2V0VGFibGUoJ3VzZXJzJyk7DQoNCiAgICAgICAgbGV0IHVzZXIgPSB1c2Vycy5maW5kT25lKHsgJ2lkJzogc2VuZGVyIH0pOw0KDQogICAgICAgIGlmICh1c2VyID09PSBudWxsKSB7DQogICAgICAgICAgY29uc3QgbmV3VXNlciA9IHsNCiAgICAgICAgICAgICdpZCc6IHNlbmRlciwNCiAgICAgICAgICAgICd1c2VybmFtZSc6IHVzZXJuYW1lLA0KICAgICAgICAgICAgJ3ZlcmlmaWVkJzogZmFsc2UsDQogICAgICAgICAgfTsNCg0KICAgICAgICAgIHVzZXJzLmluc2VydChuZXdVc2VyKTsNCiAgICAgICAgICBlbWl0KCduZXdVc2VyQ3JlYXRlZCcsIG5ld1VzZXIpOw0KICAgICAgICB9IA0KICAgICAgfQ0KICAgIH0NCg0KICAgIGFjdGlvbnMudXBkYXRlVXNlciA9IGZ1bmN0aW9uIChwYXlsb2FkKSB7DQogICAgICBjb25zdCB7IHVzZXJuYW1lIH0gPSBwYXlsb2FkOw0KICAgICAgaWYgKHVzZXJuYW1lICYmIHR5cGVvZiB1c2VybmFtZSA9PT0gJ3N0cmluZycpew0KDQogICAgICAgIGxldCB1c2VycyA9IGRiLmdldFRhYmxlKCd1c2VycycpOw0KICAgICAgICBsZXQgdXNlciA9IHVzZXJzLmZpbmRPbmUoeyAnaWQnOiBzZW5kZXIgfSk7DQogICAgICAgIGlmICh1c2VyKSB7DQogICAgICAgICAgdXNlci51c2VybmFtZSA9IHVzZXJuYW1lOw0KICAgICAgICAgIHVzZXJzLnVwZGF0ZSh1c2VyKTsNCiAgICAgICAgfQ0KICAgICAgfQ0KICAgIH0="}##STEEMCONTRACTSEND##
##STEEMCONTRACTSBEGIN##users_test_contract##addUser##{ "username": "AwesomeUsername" }##STEEMCONTRACTSEND##
{ "id": "ssc-b8923f70-c1f7-497f-961d", "json": { "contractName": "contract", "contractAction": "deploy", "contractPayload": { "name": "account2", "code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogIGRiLmNyZWF0ZVRhYmxlKCdhY2NvdW50cycpOwp9CgovLyByZWdpc3RlciBhbiBhY2NvdW50IGhlbHBzIG90aGVyIGNvbnRyYWN0cyB0byBrbm93IAovLyBpZiBhbiBhY2NvdW50IGV4aXN0cyBvbiB0aGUgU3RlZW0gYmxvY2tjaGFpbgphY3Rpb25zLnJlZ2lzdGVyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsKICBsZXQgYWNjb3VudHMgPSBkYi5nZXRUYWJsZSgnYWNjb3VudHMnKTsKCiAgbGV0IGFjY291bnQgPSBhY2NvdW50cy5maW5kT25lKHsgJ2lkJzogc2VuZGVyIH0pOwoKICBpZiAoYWNjb3VudCA9PT0gbnVsbCkgewogICAgY29uc3QgbmV3QWNjb3VudCA9IHsKICAgICAgJ2lkJzogc2VuZGVyCiAgICB9OwoKICAgIGFjY291bnRzLmluc2VydChuZXdBY2NvdW50KTsKICB9IAp9" } } }
{ "id": "ssc-b8923f70-c1f7-497f-961l", "json": { "contractName": "contract", "contractAction": "deploy", "contractPayload": { "name": "account", "code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogIGRiLmNyZWF0ZVRhYmxlKCdhY2NvdW50cycpOwp9CgovLyByZWdpc3RlciBhbiBhY2NvdW50IGhlbHBzIG90aGVyIGNvbnRyYWN0cyB0byBrbm93IAovLyBpZiBhbiBhY2NvdW50IGV4aXN0cyBvbiB0aGUgU3RlZW0gYmxvY2tjaGFpbgphY3Rpb25zLnJlZ2lzdGVyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsKICBsZXQgYWNjb3VudHMgPSBkYi5nZXRUYWJsZSgnYWNjb3VudHMnKTsKCiAgbGV0IGFjY291bnQgPSBhY2NvdW50cy5maW5kT25lKHsgJ2lkJzogc2VuZGVyIH0pOwoKICBpZiAoYWNjb3VudCA9PT0gbnVsbCkgewogICAgY29uc3QgbmV3QWNjb3VudCA9IHsKICAgICAgJ2lkJzogc2VuZGVyCiAgICB9OwoKICAgIGFjY291bnRzLmluc2VydChuZXdBY2NvdW50KTsKICB9IAp9" } } }
{ "id": "ssc-b8923f70-c1f7-497f-961l", "json": { "contractName": "account", "contractAction": "register", "contractPayload": {} } }
{ "id": "ssc-b8923f70-c1f7-497f-961l", "json": { "contractName": "contract", "contractAction": "deploy", "contractPayload": { "name": "token", "code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogICAgICBkYi5jcmVhdGVUYWJsZSgndG9rZW5zJyk7CiAgICAgIGRiLmNyZWF0ZVRhYmxlKCdiYWxhbmNlcycpOwogICAgfQogICAgCiAgICBhY3Rpb25zLmNyZWF0ZSA9IGZ1bmN0aW9uIChwYXlsb2FkKSB7CiAgICAgIGNvbnN0IHsgc3ltYm9sLCBwcmVjaXNpb24sIG1heFN1cHBseSB9ID0gcGF5bG9hZDsKICAgIAogICAgICBpZiAoc3ltYm9sICYmIHR5cGVvZiBzeW1ib2wgPT09ICdzdHJpbmcnCiAgICAgICAgJiYgKHByZWNpc2lvbiAmJiB0eXBlb2YgcHJlY2lzaW9uID09PSAnbnVtYmVyJyB8fCBwcmVjaXNpb24gPT09IDApCiAgICAgICAgJiYgbWF4U3VwcGx5ICYmIHR5cGVvZiBtYXhTdXBwbHkgPT09ICdudW1iZXInKSB7CiAgICAKICAgICAgICBjb25zdCBSZWdleFB1cmVMZXR0ZXJzID0gL15bYS16QS1aXSskLzsKICAgIAogICAgICAgIC8vIHRoZSBzeW1ib2wgbXVzdCBiZSBtYWRlIG9mIGxldHRlcnMgb25seQogICAgICAgIC8vIHRoZSBwcmVjaXNpb24gbXVzdCBiZSBiZXR3ZWVuIDAgYW5kIDggYW5kIG11c3QgYmUgYW4gaW50ZWdlcgogICAgICAgIC8vIHRoZSBtYXggc3VwcGx5IG11c3QgYmUgcG9zaXRpdmUKICAgICAgICBpZiAoYXNzZXJ0KFJlZ2V4UHVyZUxldHRlcnMudGVzdChzeW1ib2wpLCAnaW52YWxpZCBzeW1ib2wnKQogICAgICAgICAgJiYgYXNzZXJ0KChwcmVjaXNpb24gPj0gMCAmJiBwcmVjaXNpb24gPD0gOCkgJiYgKE51bWJlci5pc0ludGVnZXIocHJlY2lzaW9uKSksICdpbnZhbGlkIHByZWNpc2lvbicpCiAgICAgICAgICAmJiBhc3NlcnQobWF4U3VwcGx5ID4gMCwgJ21heFN1cHBseSBtdXN0IGJlIHBvc2l0aXZlJykpIHsKICAgICAgICAgIGxldCB0b2tlbnMgPSBkYi5nZXRUYWJsZSgndG9rZW5zJyk7CiAgICAKICAgICAgICAgIC8vIGNoZWNrIGlmIHRoZSB0b2tlbiBhbHJlYWR5IGV4aXN0cwogICAgICAgICAgbGV0IHRva2VuID0gdG9rZW5zLmZpbmRPbmUoeyBzeW1ib2wgfSk7CiAgICAKICAgICAgICAgIGlmIChhc3NlcnQodG9rZW4gPT09IG51bGwsICdzeW1ib2wgYWxyZWFkeSBleGlzdHMnKSkgewogICAgICAgICAgICBjb25zdCBuZXdUb2tlbiA9IHsKICAgICAgICAgICAgICAnaXNzdWVyJzogc2VuZGVyLAogICAgICAgICAgICAgIHN5bWJvbCwKICAgICAgICAgICAgICBwcmVjaXNpb24sCiAgICAgICAgICAgICAgbWF4U3VwcGx5LAogICAgICAgICAgICAgICdzdXBwbHknOiAwCiAgICAgICAgICAgIH07CiAgICAKICAgICAgICAgICAgdG9rZW5zLmluc2VydChuZXdUb2tlbik7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICAKICAgIGFjdGlvbnMuaXNzdWUgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogICAgICBjb25zdCB7IHRvLCBzeW1ib2wsIHF1YW50aXR5LCBpc1NpZ25lZFdpdGhBY3RpdmVLZXkgfSA9IHBheWxvYWQ7CiAgICAKICAgICAgaWYgKGFzc2VydChpc1NpZ25lZFdpdGhBY3RpdmVLZXkgPT09IHRydWUsICd5b3UgbXVzdCB1c2UgYSBjdXN0b21fanNvbiBzaWduZWQgd2l0aCB5b3VyIGFjdGl2ZSBrZXknKQogICAgICAgICYmIHRvICYmIHR5cGVvZiB0byA9PT0gJ3N0cmluZycKICAgICAgICAmJiBzeW1ib2wgJiYgdHlwZW9mIHN5bWJvbCA9PT0gJ3N0cmluZycKICAgIC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VzLmZpbmRPbmUoeyBhY2NvdW50LCAnc3ltYm9sJzogdG9rZW4uc3ltYm9sIH0pOwogICAgCiAgICAgIGlmIChiYWxhbmNlID09PSBudWxsKSB7CiAgICAgICAgYmFsYW5jZSA9IHsKICAgICAgICAgIGFjY291bnQsCiAgICAgICAgICAnc3ltYm9sJzogdG9rZW4uc3ltYm9sLAogICAgICAgICAgJ2JhbGFuY2UnOiBxdWFudGl0eQogICAgICAgIH0KICAgICAgICAKICAgICAgICBiYWxhbmNlcy5pbnNlcnQoYmFsYW5jZSk7CiAgICAgIH0gZWxzZSB7CiAgICAgICAgYmFsYW5jZS5iYWxhbmNlID0gY2FsY3VsYXRlQmFsYW5jZShiYWxhbmNlLmJhbGFuY2UsIHF1YW50aXR5LCB0b2tlbi5wcmVjaXNpb24sIHRydWUpOwogICAgCiAgICAgICAgYmFsYW5jZXMudXBkYXRlKGJhbGFuY2UpOwogICAgICB9CiAgICB9CiAgICAKICAgIGxldCBjYWxjdWxhdGVCYWxhbmNlID0gZnVuY3Rpb24gKGJhbGFuY2UsIHF1YW50aXR5LCBwcmVjaXNpb24sIGFkZCkgewogICAgICBpZiAocHJlY2lzaW9uID09PSAwKSB7CiAgICAgICAgcmV0dXJuIGFkZCA/IGJhbGFuY2UgKyBxdWFudGl0eSA6IGJhbGFuY2UgLSBxdWFudGl0eQogICAgICB9CiAgICAgIAogICAgICByZXR1cm4gYWRkID8gY3VycmVuY3koYmFsYW5jZSwgeyBwcmVjaXNpb24gfSkuc3VidHJhY3QocXVhbnRpdHkpIDogY3VycmVuY3koYmFsYW5jZSwgeyBwcmVjaXNpb24gfSkuc3VidHJhY3QocXVhbnRpdHkpOwogICAgfQogICAgCiAgICBsZXQgY291bnREZWNpbWFscyA9IGZ1bmN0aW9uICh2YWx1ZSkgewogICAgICBpZiAoTWF0aC5mbG9vcih2YWx1ZSkgPT09IHZhbHVlKSByZXR1cm4gMDsKICAgICAgcmV0dXJuIHZhbHVlLnRvU3RyaW5nKCkuc3BsaXQoJy4nKVsxXS5sZW5ndGggfHwgMDsKICAgIH0=" } } }
{ "id": "ssc-b8923f70-c1f7-497f-961l", "json": { "contractName": "token", "contractAction": "create", "contractPayload": { "symbol": "PKTC", "precision": 0, "maxSupply": 1000000 } } }
{ "id": "ssc-b8923f70-c1f7-497f-961j", "json": { "contractName": "contract", "contractAction": "deploy", "contractPayload": { "name": "account", "code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogIGRiLmNyZWF0ZVRhYmxlKCdhY2NvdW50cycpOwp9CgovLyByZWdpc3RlciBhbiBhY2NvdW50IGhlbHBzIG90aGVyIGNvbnRyYWN0cyB0byBrbm93IAovLyBpZiBhbiBhY2NvdW50IGV4aXN0cyBvbiB0aGUgU3RlZW0gYmxvY2tjaGFpbgphY3Rpb25zLnJlZ2lzdGVyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsKICBsZXQgYWNjb3VudHMgPSBkYi5nZXRUYWJsZSgnYWNjb3VudHMnKTsKCiAgbGV0IGFjY291bnQgPSBhY2NvdW50cy5maW5kT25lKHsgJ2lkJzogc2VuZGVyIH0pOwoKICBpZiAoYWNjb3VudCA9PT0gbnVsbCkgewogICAgY29uc3QgbmV3QWNjb3VudCA9IHsKICAgICAgJ2lkJzogc2VuZGVyCiAgICB9OwoKICAgIGFjY291bnRzLmluc2VydChuZXdBY2NvdW50KTsKICB9IAp9" } } }
{ "id": "ssc-b8923f70-c1f7-497f-961j", "json": { "contractName": "account", "contractAction": "register", "contractPayload": {} } }
{ "id": "ssc-b8923f70-c1f7-497f-961j", "json": { "contractName": "contract", "contractAction": "deploy", "contractPayload": { "name": "token", "code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogICAgICBkYi5jcmVhdGVUYWJsZSgndG9rZW5zJyk7CiAgICAgIGRiLmNyZWF0ZVRhYmxlKCdiYWxhbmNlcycpOwogICAgfQogICAgCiAgICBhY3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HJlYWR5IGV4aXN0cwogICAgICAgICAgbGV0IHRva2VuID0gdG9rZW5zLmZpbmRPbmUoeyBzeW1ib2wgfSk7CiAgICAKICAgICAgICAgIGlmIChhc3NlcnQodG9rZW4gPT09IG51bGwsICdzeW1ib2wgYWxyZWFkeSBleGlzdHMnKSkgewogICAgICAgICAgICBjb25zdCBuZXdUb2tlbiA9IHsKICAgICAgICAgICAgICAnaXNzdWVyJzogc2VuZGVyLAogICAgICAgICAgICAgIHN5bWJvbCwKICAgICAgICAgICAgICBwcmVjaXNpb24sCiAgICAgICAgICAgICAgbWF4U3VwcGx5LAogICAgICAgICAgICAgICdzdXBwbHknOiAwCiAgICAgICAgICAgIH07CiAgICAKICAgICAgICAgICAgdG9rZW5zLmluc2VydChuZXdUb2tlbik7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICAKICAgIGFjdGlvbnMuaXNzdWUgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogICAgICBjb25zdCB7IHRvLCBzeW1ib2wsIHF1YW50aXR5LCBpc1NpZ25lZFdpdGhBY3RpdmVLZXkgfSA9IHBheWxvYWQ7CiAgICAKICAgICAgaWYgKGFzc2VydChpc1NpZ25lZFdpdGhBY3RpdmVLZXkgPT09IHRydWUsICd5b3UgbXVzdCB1c2UgYSBjdXN0b21fanNvbiBzaWduZWQgd2l0aCB5b3VyIGFjdGl2ZSBrZXknKQogICAgICAgICYmIHRvICYmIHR5cGVvZiB0byA9PT0gJ3N0cmluZycKICAgICAgICAmJiBzeW1ib2wgJiYgdHlwZW9mIHN5bWJvbCA9PT0gJ3N0cmluZycKICAgICAgICAmJiBxdWFudGl0eSAmJiB0eXBlb2YgcXVhbnRpdHkgPT09ICdudW1iZXInKSB7CiAgICAKICAgICAgICBsZXQgdG9rZW5zID0gZGIuZ2V0VGFibGUoJ3Rva2VucycpOwogICAgICAgIGxldCB0b2tlbiA9IHRva2Vucy5maW5kT25lKHsgc3ltYm9sIH0pOwogICAgCiA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6IHRvIH0pOwogICAgCiAgICAgICAgICAvLyB0aGUgYWNjb3VudCBtdXN0IGhhdmUgYmVlbiByZWdpc3RlcmVkIGJlZm9yZQogICAgICAgICAgaWYgKGFzc2VydChhY2NvdW50ICE9PSBudWxsLCAndG8gYWNjb3VudCBkb2VzIG5vdCBleGlzdCcpKSB7CiAgICAgICAgICAgIGxldCB0b2tlbnMgPSBkYi5nZXRUYWJsZSgndG9rZW5zJyk7CiAgICAgICAgICAgIGxldCB0b2tlbiA9IHRva2Vucy5maW5kT25lKHsgc3ltYm9sIH0pOwogICAgCiAgICAgICAgICAgIC8vIHRoZSBzeW1ib2wgbXVzdCBleGlzdAogICAgICAgICAgICAvLyB0aGVuIHdlIG5lZWQgdG8gY2hlY2sgdGhhdCB0aGUgcXVhbnRpdHkgaXMgY29ycmVjdAogICAgICAgICAgICBpZiAoYXNzZXJ0KHRva2VuICE9PSBudWxsLCAnc3ltYm9sIGRvZXMgbm90IGV4aXN0JykKICAgICAgICAgICAgICAmJiBhc3NlcnQoY291bnREZWNpbWFscyhxdWFudGl0eSkgPD0gdG9rZW4ucHJlY2lzaW9uLCAnc3ltYm9sIHByZWNpc2lvbiBtaXNtYXRjaCcpCiAgICAgICAgICAgICAgJiYgYXNzZXJ0KHF1YW50aXR5ID4gMCwgJ211c3QgdHJhbnNmZXIgcG9zaXRpdmUgcXVhbnRpdHknKSkgewogICAgCiAgICAgICAgICAgICAgaWYgKHN1YkJhbGFuY2Uoc2VuZGVyLCB0b2tlbiwgcXVhbnRpdHkpKSB7CiAgICAgICAgICAgICAgICBhZGRCYWxhbmNlKHRvLCB0b2tlbiwgcXVhbnRpdHkpOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfQogICAgfQogICAgCiAgICBsZXQgc3ViQmFsYW5jZSA9IGZ1bmN0aW9uIChhY2NvdW50LCB0b2tlbiwgcXVhbnRpdHkpIHsKICAgICAgbGV0IGJhbGFuY2Vz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sLAogICAgICAgICAgJ2JhbGFuY2UnOiBxdWFudGl0eQogICAgICAgIH0KICAgICAgICAKICAgICAgICBiYWxhbmNlcy5pbnNlcnQoYmFsYW5jZSk7CiAgICAgIH0gZWxzZSB7CiAgICAgICAgYmFsYW5jZS5iYWxhbmNlID0gY2FsY3VsYXRlQmFsYW5jZShiYWxhbmNlLmJhbGFuY2UsIHF1YW50aXR5LCB0b2tlbi5wcmVjaXNpb24sIHRydWUpOwogICAgCiAgICAgICAgYmFsYW5jZXMudXBkYXRlKGJhbGFuY2UpOwogICAgICB9CiAgICB9CiAgICAKICAgIGxldCBjYWxjdWxhdGVCYWxhbmNlID0gZnVuY3Rpb24gKGJhbGFuY2UsIHF1YW50aXR5LCBwcmVjaXNpb24sIGFkZCkgewogICAgICBpZiAocHJlY2lzaW9uID09PSAwKSB7CiAgICAgICAgcmV0dXJuIGFkZCA/IGJhbGFuY2UgKyBxdWFudGl0eSA6IGJhbGFuY2UgLSBxdWFudGl0eQogICAgICB9CgogICAgICByZXR1cm4gYWRkID8gY3VycmVuY3koYmFsYW5jZSwgeyBwcmVjaXNpb24gfSkuYWRkKHF1YW50aXR5KSA6IGN1cnJlbmN5KGJhbGFuY2UsIHsgcHJlY2lzaW9uIH0pLnN1YnRyYWN0KHF1YW50aXR5KTsKICAgIH0KICAgIAogICAgbGV0IGNvdW50RGVjaW1hbHMgPSBmdW5jdGlvbiAodmFsdWUpIHsKICAgICAgaWYgKE1hdGguZmxvb3IodmFsdWUpID09PSB2YWx1ZSkgcmV0dXJuIDA7CiAgICAgIHJldHVybiB2YWx1ZS50b1N0cmluZygpLnNwbGl0KCcuJylbMV0ubGVuZ3RoIHx8IDA7CiAgICB9" } } }
{ "id": "ssc-b8923f70-c1f7-497f-961j", "json": { "contractName": "token", "contractAction": "create", "contractPayload": { "symbol": "PKTC", "precision": 0, "maxSupply": 1000000 } } }
{ "id": "ssc-b8923f70-c1f7-497f-961j", "json": { "contractName": "token", "contractAction": "create", "contractPayload": { "symbol": "SMMT", "precision": 0, "maxSupply": 1000000 } } }
{ "id": "ssc-b8923f70-c1f7-497f-961j", "json": { "contractName": "contract", "contractAction": "deploy", "contractPayload": { "name": "smmt", "code": "Y29uc3QgVE9LRU5TWU1CT0wgPSAnU01NVCc7CmFjdGlvbnMuY3JlYXRlU1NDID0gZnVuY3Rpb24gKHBheWxvYWQpIHsKICBkYi5jcmVhdGVUYWJsZSgnYmFsYW5jZXMnKTsKICBsZXQgcmV3YXJkcyA9IGRiLmNyZWF0ZVRhYmxlKCdyZXdhcmRzJyk7CiAgcmV3YXJkcy5pbnNlcnQoewogICAgJ3BlbmRpbmdSZXdhcmRzJzogMCwKICAgICdyZXdhcmRzRGlzdHJpYnV0aW9uSW50ZXJ2YWwnOiAzMDAwMCwKICAgICdsYXN0QmxvY2tSZXdhcmQnOiAwLAogICAgJ3Rva2VuSXNzdWFuY2VSYXRlJzogMSwKICAgICduZXh0SGFsdmluZyc6IDUwMDAwMCwKICAgICdiZW5lZmljaWFyaWVzJzogWydzdGVlbW1vbnN0ZXJzJywgJ2hhcnBhZ29uJ10KICB9KQp9CgphY3Rpb25zLnVwZGF0ZVJld2FyZHNEaXN0cmlidXRpb25JbnRlcnZhbCA9IGZ1bmN0aW9uIChwYXlsb2FkKSB7CiAgaWYgKHNlbmRlciAhPT0gb3duZXIpIHJldHVybjsKCiAgY29uc3QgeyBuYkJsb2NrcyB9ID0gcGF5bG9hZDsKCiAgaWYgKE51bWJlci5pc0ludGVnZXIobmJCbG9ja3MpKSB7CiAgICBsZXQgcmV3YXJkcyA9IGRiLmdldFRhYmxlKCdyZXdhcmRzJyk7CiAgICBsZXQgcmVjID0gcmV3YXJkcy5maW5kT25lKHt9KTsKICAgIHJlYy5yZXdhcmRzRGlzdHJpYnV0aW9uSW50ZXJ2YWwgPSBuYkJsb2NrczsKICAgIHJld2FyZHMudXBkYXRlKHJlYyk7CiAgfQp9CgphY3Rpb25zLnVwZGF0ZUJlbmVmaWNpYXJpZXMgPSB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gPT09IHZhbHVlKSByZXR1cm4gMDsKICByZXR1cm4gdmFsdWUudG9TdHJpbmcoKS5zcGxpdCgnLicpWzFdLmxlbmd0aCB8fCAwOwp9" } } }
{ "id": "ssc-b8923f70-c1f7-497f-961j", "json": { "contractName": "token", "contractAction": "create", "contractPayload": { "symbol": "SMMKT", "precision": 3, "maxSupply": 1000000 } } }
{ "id": "ssc-b8923f70-c1f7-497f-961j", "json": { "contractName": "contract", "contractAction": "deploy", "contractPayload": { "name": "smmkt", "code": "Y29uc3QgVE9LRU5TWU1CT0wgPSAnU01NS1QnOwphY3Rpb25zLmNyZWF0ZVNTQyA9IGZ1bmN0aW9uIChwYXlsb2FkKSB7CiAgZGIuY3JlYXRlVGFibGUoJ2JhbGFuY2VzJyk7CiAgbGV0IHJld2FyZHMgPSBkYi5jcmVhdGVUYWJsZSgncmV3YXJkcycpOwogIHJld2FyZHMuaW5zZXJ0KHsKICAgICdwZW5kaW5nUmV3YXJkcyc6IDAsCiAgICAncmV3YXJkc0Rpc3RyaWJ1dGlvbkludGVydmFsJzogMzAwMDAsCiAgICAnbGFzdEJsb2NrUmV3YXJkJzogcmVmU3RlZW1CbG9ja051bWJlciwKICAgICd0b2tlbklzc3VhbmNlUmF0ZSc6IDEsCiAgICAnbmV4dEhhbHZpbmcnOiA1MDAwMDAsCiAgICAnYmVuZWZpY2lhcmllcyc6IFsnc21tYXJrZXR0b2tlbiddCiAgfSkKfQoKYWN0aW9ucy51cGRhdGVSZXdhcmRzRGlzdHJpYnV0aW9uSW50ZXJ2YWwgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogIGlmIChzZW5kZXIgIT09IG93bmVyKSByZXR1cm47CgogIGNvbnN0IHsgbmJCbG9ja3MgfSA9IHBheWxvYWQ7CgogIGlmIChOdW1iZXIuaXNJbnRlZ2VyKG5iQmxvY2tzKSkgewogICAgbGV0IHJld2FyZHMgPSBkYi5nZXRUYWJsZSgncmV3YXJkcycpOwogICAgbGV0IHJlYyA9IHJld2F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yZXR1cm4gcmVzID4gMCA/IHJlcy50b0ZpeGVkKDMpIDogMDsKICByZXR1cm4gY3VycmVuY3koYSwgeyBwcmVjaXNpb246IDMgfSkuc3VidHJhY3QoYik7Cn0KCmxldCBjb3VudERlY2ltYWxzID0gZnVuY3Rpb24gKHZhbHVlKSB7CiAgaWYgKE1hdGguZmxvb3IodmFsdWUpID09PSB2YWx1ZSkgcmV0dXJuIDA7CiAgcmV0dXJuIHZhbHVlLnRvU3RyaW5nKCkuc3BsaXQoJy4nKVsxXS5sZW5ndGggfHwgMDsKfQ==" } } }
comment pruned due to size
{ "id": "ssc-00000000000000000002", "json": { "contractName": "contract", "contractAction": "deploy", "contractPayload": { "name": "test", "params": "", "code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBhc3luYyAocGF5bG9hZCkgPT4gewogICAgICAgICAgYXdhaXQgYXBpLmRiLmNyZWF0ZVRhYmxlKCd0ZXN0VXBkYXRlVGFibGUnKTsKICAgICAgICB9" } } }
{ "id": "ssc-testnet1", "json": { "contractName": "contract", "contractAction": "deploy", "contractPayload": { "name": "inflation", "params": "", "code": "LyogZXNsaW50LWRpc2FibGUgbm8tYXdhaXQtaW4tbG9vcCAqLwovKiBnbG9iYWwgYWN0aW9ucywgYXBpICovCgovLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tdGVtcGxhdGUtY3VybHktaW4tc3RyaW5nCmNvbnN0IFVUSUxJVFlfVE9LRU5fU1lNQk9MID0gIlNTQyI7CgphY3Rpb25zLmNyZWF0ZVNTQyA9IGFzeW5jICgpID0+IHsKCn07CgphY3Rpb25zLmlzc3VlTmV3VG9rZW5zID0gYXN5bmMgKCkgPT4gewogIGlmIChhcGkuc2VuZGVyICE9PSAnbnVsbCcpIHJldHVybjsKCiAgLy8gaXNzdWUgdG9rZW5zIHRvIHN0ZWVtc2MKICAvLyAxMDBrIHRva2VucyBwZXIgeWVhciA9IDExLjQxNTUyNTExIHRva2VucyBwZXIgaG91ciAoYW4gaG91ciA9IDEyMDAgYmxvY2tzKQogIGxldCBuYlRva2VucyA9ICcxMS40MTU1MjUxMSc7CiAgYXdhaXQgYXBpLmV4ZWN1dGVTbWFydENvbnRyYWN0KCd0b2tlbnMnLCAnaXNzdWUnLCB7IHN5bWJvbDogVVRJTElUWV9UT0tFTl9TWU1CT0wsIHF1YW50aXR5OiBuYlRva2VucywgdG86ICdzdGVlbXNjJyB9KTsKCiAgLy8gaXNzdWUgdG9rZW5zIHRvIGVuZ3Bvb2wKICAvLyAxMDBrIHRva2VucyBwZXIgeWVhciA9IDExLjQxNTUyNTExIHRva2VucyBwZXIgaG91ciAoYW4gaG91ciA9IDEyMDAgYmxvY2tzKQogIG5iVG9rZW5zID0gJzExLjQxNTUyNTExJzsKICBhd2FpdCBhcGkuZXhlY3V0ZVNtYXJ0Q29udHJhY3QoJ3Rva2VucycsICdpc3N1ZScsIHsgc3ltYm9sOiBVVElMSVRZX1RPS0VOX1NZTUJPTCwgcXVhbnRpdHk6IG5iVG9rZW5zLCB0bzogJ2VuZ3Bvb2wnIH0pOwoKICAvLyBpc3N1ZSB0b2tlbnMgdG8gIndpdG5lc3NlcyIgY29udHJhY3QKICAvLyAyMDBrIHRva2VucyBwZXIgeWVhciA9IDIyLjgzMTA1MDIyIHRva2VucyBwZXIgaG91ciAoYW4gaG91ciA9IDEyMDAgYmxvY2tzKQogIG5iVG9rZW5zID0gJzIyLjgzMTA1MDIyJzsKICBhd2FpdCBhcGkuZXhlY3V0ZVNtYXJ0Q29udHJhY3QoJ3Rva2VucycsICdpc3N1ZVRvQ29udHJhY3QnLCB7IHN5bWJvbDogVVRJTElUWV9UT0tFTl9TWU1CT0wsIHF1YW50aXR5OiBuYlRva2VucywgdG86ICd3aXRuZXNzZXMnIH0pOwp9Owo=" } } }
{ "id": "ssc-testnet1", "json": { "contractName": "contract", "contractAction": "deploy", "contractPayload": { "name": "crittermanager", "params": "", "code": "LyogZXNsaW50LWRpc2FibGUgbm8tYXdhaXQtaW4t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sKICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICB9CgogICAgICAgIC8vIHdlIHdpbGwgaXNzdWUgY3JpdHRlcnMgaW4gcGFja3Mgb2YgNSBhdCBvbmNlCiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBwYWNrczsgaSArPSAxKSB7CiAgICAgICAgICBjb25zdCBpbnN0YW5jZXMgPSBbXTsKICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgQ1JJVFRFUlNfUEVSX1BBQ0s7IGogKz0gMSkgewogICAgICAgICAgICBpbnN0YW5jZXMucHVzaChnZW5lcmF0ZVJhbmRvbUNyaXR0ZXIoZWRpdGlvbk1hcHBpbmdbcGFja1N5bWJvbF0sIGFwaS5zZW5kZXIpKTsKICAgICAgICAgIH0KCiAgICAgICAgICBhd2FpdCBhcGkuZXhlY3V0ZVNtYXJ0Q29udHJhY3QoJ25mdCcsICdpc3N1ZU11bHRpcGxlJywgewogICAgICAgICAgICBpbnN0YW5jZXMsCiAgICAgICAgICAgIGlzU2lnbmVkV2l0aEFjdGl2ZUtleSwKICAgICAgICAgIH0pOwogICAgICAgIH0KICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgfQogICAgfQogIH0KICByZXR1cm4gZmFsc2U7Cn07Cg==" } } }
##STEEMCONTRACTSBEGIN##test_contract_users##addUser##{ "username": "AwesomeUsername" }##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
test comment 5
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
It's hard to say, but The ENIAC is regarded as the first 'real' computer. It was developed at University of Pennsylvania in 1946.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
another comment
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
yes, marx had made some interesting observations.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
test
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
test 7
test 73
test 75
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
test !zè§!èz
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
etrtrt
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
post test comment
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
***test
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
test dffdgerter
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
test
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
test comment
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
test comment
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##CONTRACTNAME##CONTRACTACTION##PAYLOAD##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##test_contract'##hello##{ "name": "Harpagon" }##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##test_contract##hello##{ "name": "Harpagon" }##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##contract##deploy##if(payload&&payload.name&&'string'==typeof payload.name){const a='Hello '+payload.name;db.greetings=db.greetings?db.greetings:db.greetings=[],db.greetings.push(a)}##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract", "code": "if(payload&&payload.name&&'string'==typeof payload.name){const a='Hello '+payload.name;db.greetings=db.greetings?db.greetings:db.greetings=[],db.greetings.push(a)}"}##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##test_contract##hello##{ "name": "Harpagon" }##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": "actions.addUser=function(a){const{username:b}=a;if(b&&'string'==typeof b){let c=db.getTable('users'),d=db.findJsonPath(c,
$..[?(@.id == '\${sender}')]
);if(d);else{const e={id:sender,username:b};c.push(e)}}},actions.updateUser=function(a){const{username:b}=a;if(b&&'string'==typeof b){let c=db.getTable('users'),d=db.findJsonPath(c,$..[?(@.id == '\${sender}')]
);d&&(d.username=b)}},actions.removeUser=function(a){if(sender==owner){const{userId:b}=a;if(b&&'string'==typeof b){let c=db.getTable('users');const d=c.findIndex(e=>e.id===b);-1!=d&&c.splice(d,1)}}};"}##STEEMCONTRACTSEND##Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##test_contract_users##addUser##{ "username": "AwesomeUsername" }##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": "actions.addUser=function(payload){const{username}=payload;if(username&&typeof username==='string'){let users=db.getTable('users');let user=db.findJsonPath(users,`$..[?(@.id=='${sender}')]`);if(user){}else{const newUser={'id':sender,'username':username};users.push(newUser)}}}actions.updateUser=function(payload){const{username}=payload;if(username&&typeof username==='string'){let users=db.getTable('users');let user=db.findJsonPath(users,`$..[?(@.id=='${sender}')]`);if(user)user.username=username}}actions.removeUser=function(payload){if(sender!=owner)return;const{userId}=payload;if(userId&&typeof userId==='string'){let users=db.getTable('users');const index=users.findIndex(user=>user.id===userId);if(index!=-1)users.splice(index,1)}}"}##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961d",
"json": {
"contractName": "contract",
"contractAction": "deploy",
"contractPayload": {
"name": "account",
"code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogIGRiLmNyZWF0ZVRhYmxlKCdhY2NvdW50cycpOwp9CgovLyByZWdpc3RlciBhbiBhY2NvdW50IGhlbHBzIG90aGVyIGNvbnRyYWN0cyB0byBrbm93IAovLyBpZiBhbiBhY2NvdW50IGV4aXN0cyBvbiB0aGUgU3RlZW0gYmxvY2tjaGFpbgphY3Rpb25zLnJlZ2lzdGVyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsKICBsZXQgYWNjb3VudHMgPSBkYi5nZXRUYWJsZSgnYWNjb3VudHMnKTsKCiAgbGV0IGFjY291bnQgPSBhY2NvdW50cy5maW5kT25lKHsgJ2lkJzogc2VuZGVyIH0pOwoKICBpZiAoYWNjb3VudCA9PT0gbnVsbCkgewogICAgY29uc3QgbmV3QWNjb3VudCA9IHsKICAgICAgJ2lkJzogc2VuZGVyCiAgICB9OwoKICAgIGFjY291bnRzLmluc2VydChuZXdBY2NvdW50KTsKICB9IAp9"
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961d",
"json": {
"contractName": "contract",
"contractAction": "deploy",
"contractPayload": {
"name": "token",
"code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogICAgICBkYi5jcmVhdGVUYWJsZSgndG9rZW5zJyk7CiAgICAgIGRiLmNyZWF0ZVRhYmxlKCdiYWxhbmNlcycpOwogICAgfQogICAgCiAgICBhY3Rpb25zLmNyZWF0ZSA9IGZ1bmN0aW9uIChwYXlsb2FkKSB7CiAgICAgIGNvbnN0IHsgc3ltYm9sLCBwcmVjaXNpb24sIG1heFN1cHBseSB9ID0gcGF5bG9hZDsKICAgIAogICAgICBpZiAoc3ltYm9sICYmIHR5cGVvZiBzeW1ib2wgPT09ICdzdHJpbmcnCiAgICAgICAgJiYgKHByZWNpc2lvbiAmJiB0eXBlb2YgcHJlY2lzaW9uID09PSAnbnVtYmVyJyB8fCBwcmVjaXNpb24gPT09IDApC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WJvbCwKICAgICAgICAgICAgICAgIHByZWNpc2lvbiwKICAgICAgICAgICAgICAgIG1heFN1cHBseSwKICAgICAgICAgICAgICAgICdzdXBwbHknOiAwCiAgICAgICAgICAgICAgfTsKICAgICAgICAgIAogICAgICAgICAgICAgIHRva2Vucy5pbnNlcnQobmV3VG9rZW4pOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICAKICAgIGFjdGlvbnMuaXNzdWUgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogICAgICBjb25zdCB7IHRvLCBzeW1ib2wsIHF1YW50aXR5IH0gPSBwYXlsb2FkOwogICAgCiAgICAgIGlmICh0byAmJiB0eXBlb2YgdG8gPT09ICdzdHJpbmcnCiAgICAgICAgICAmJiBzeW1ib2wgJiYgdHlwZW9mIHN5bWJvbCA9PT0gJ3N0cmluZycKICAgICAgICAgICYmIHF1YW50aXR5ICYmIHR5cGVvZiBxdWFudGl0eSA9PT0gJ251bWJlcicpIHsKICAgICAgICAKICAgICAgICBsZXQgdG9rZW5zID0gZGIuZ2V0VGFibGUoJ3Rva2VucycpOwogICAgICAgIGxldCB0b2tlbiA9IHRva2Vucy5maW5kT25lKHsgc3ltYm9sIH0pOwogICAgCiAgICAgICAgLy8gdGhlIHN5bWJvbCBtdXN0IGV4aXN0CiAgICAgICAgLy8gdGhlIHNlbmRlciBtdXN0IGJlIHRoZSBpc3N1ZXIKICAgICAgICAvLyB0aGVuIHdlIG5lZWQgdG8gY2hlY2sgdGhhdCB0aGUgcXVhbnRpdHkgaXMgY29ycmVjdAogICAgICAgIGlmIChhc3NlcnQodG9rZW4gIT09IG51bGwsICdzeW1ib2wgZG9lcyBub3QgZXhpc3QnKQogICAgICAgICAgICAmJiBhc3NlcnQodG9rZW4uaXNzdWVyID09PSBzZW5kZXIsICdub3QgYWxsb3dlZCB0byBpc3N1ZSB0b2tlbnMnKSAKICAgICAgICAgICAgJiYgYXNzZXJ0KGNvdW50RGVjaW1hbHMocXVhbn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gICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICAKICAgIGFjdGlvbnMudHJhbnNmZXIgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogICAgICBjb25zdCB7IHRvLCBzeW1ib2wsIHF1YW50aXR5IH0gPSBwYXlsb2FkOwogICAgCiAgICAgIGlmICh0byAmJiB0eXBlb2YgdG8gPT09ICdzdHJpbmcnCiAgICAgICAgICAmJiBzeW1ib2wgJiYgdHlwZW9mIHN5bWJvbCA9PT0gJ3N0cmluZycKICAgICAgICAgICYmIHF1YW50aXR5ICYmIHR5cGVvZiBxdWFudGl0eSA9PT0gJ251bWJlcicpIHsKICAgIAogICAgICAgIGlmIChhc3NlcnQodG8gIT09IHNlbmRlciwgJ2Nhbm5vdCB0cmFuc2ZlciB0byBzZWxmJykpIHsKICAgICAgICAgIGxldCBhY2NvdW50ID0gZGIuZmluZE9uZUluVGFibGUoJ2FjY291bnQnLCAnYWNjb3VudHMnLCB7ICdpZCc6IHRvIH0pOwogICAgCiAgICAgICAgICAvLyB0aGUgYWNjb3VudCBtdXN0IGhhdmUgYmVlbiByZWdpc3RlcmVkIGJlZm9yZQogICAgICAgICAgaWYgKGFzc2VydChhY2NvdW50ICE9PSBudWxsLCAndG8gYWNjb3VudCBkb2VzIG5vdCBleGlzdCcpKSB7CiAgICAgICAgICAgIGxldCB0b2tlbnMgPSBkYi5nZXRUYWJsZSgndG9rZW5zJyk7CiAgICAgICAgICAgIGxldCB0b2tlbiA9IHRva2Vucy5maW5kT25lKHsgc3ltYm9sIH0pOwogICAgCiAgICAgICAgICAgIC8vIHRoZSBzeW1ib2wgbXVzdCBleGlzdAogICAgICAgICAgICAvLyB0aGVuIHdlIG5lZWQgdG8gY2hlY2sgdGhhdCB0aGUgcXVhbnRpdHkgaXMgY29ycmVjdAogICAgICAgICAgICBpZiAoYXNzZXJ0KHRva2VuICE9PSBudWxsLCAnc3ltYm9sIGRvZXMgbm90IGV4aXN0JykKICAgICAgICAgICAgICAgICYmIGFzc2VydChjb3VudERlY2ltYWxzKHF1YW50aXR5KSA8PSB0b2tlbi5wcmVjaXNpb24sICdzeW1ib2wgcHJlY2lzaW9uIG1pc21hdGNoJykKICAgICAgICAgICAgICAgICYmIGFzc2VydChxdWFudGl0eSA+IDAsICdtdXN0IHRyYW5zZmVyIHBvc2l0aXZlIHF1YW50aXR5JykpIHsKICAgICAgICAgICAgICAKICAgICAgICAgICAgICBpZiAoc3ViQmFsYW5jZShzZW5kZXIsIHRva2VuLCBxdWFudGl0eSkpIHsKICAgICAgICAgICAgICAgIGFkZEJhbGFuY2UodG8sIHRva2VuLCBxdWFudGl0eSk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICAKICAgIGxldCBzdWJCYWxhbmNlID0gZnVuY3Rpb24gKGFjY291bnQsIHRva2VuLCBxdWFudGl0eSkgewogICAgICBsZXQgYmFsYW5jZXMgPSBkYi5nZXRUYWJsZSgnYmFsYW5jZXMnKTsKICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlcy5maW5kT25lKHsgYWNjb3VudCwgJ3N5bWJvbCc6IHRva2VuLnN5bWJvbCB9KTsKICAgICAgZGVidWcoYmFsYW5jZXMuY291bnQoKSkKICAgICAgaWYgKGFzc2VydChiYWxhbmNlICE9PSBudWxsLCAnYmFsYW5jZSBkb2VzIG5vdCBleGlzdCcpICYmCiAgICAgICAgYXNzZXJ0KGJhbGFuY2UuYmFsYW5jZSA+PSBxdWFudGl0eSwgJ292ZXJkcmF3biBiYWxhbmNlJykpIHsKICAgIAogICAgICAgIGJhbGFuY2UuYmFsYW5jZSA9IGNhbGN1bGF0ZUJhbGFuY2UoYmFsYW5jZS5iYWxhbmNlLCBxdWFudGl0eSwgdG9rZW4ucHJlY2lzaW9uLCBmYWxzZSk7CiAgICAKICAgICAgICBpZiAoYmFsYW5jZS5iYWxhbmNlIDw9ID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eSA6IGJhbGFuY2UgLSBxdWFudGl0eSAKICAgICAgfQoKICAgICAgbGV0IHJhdGUgPSBNYXRoLnBvdygxMCwgcHJlY2lzaW9uKTsKICAgICAgbGV0IHRtcFF0eSA9IHF1YW50aXR5ICogcmF0ZTsKICAgICAgbGV0IHRtcEJhbGFuY2U9IGJhbGFuY2UgKiByYXRlOwoKICAgICAgcmV0dXJuIGFkZCA/ICh0bXBCYWxhbmNlICsgdG1wUXR5KSAvIHJhdGUgOiAodG1wQmFsYW5jZSAtIHRtcFF0eSkgLyByYXRlOwogICAgfQogICAgCiAgICBsZXQgY291bnREZWNpbWFscyA9IGZ1bmN0aW9uICh2YWx1ZSkgewogICAgICBpZihNYXRoLmZsb29yKHZhbHVlKSA9PT0gdmFsdWUpIHJldHVybiAwOwogICAgICByZXR1cm4gdmFsdWUudG9TdHJpbmcoKS5zcGxpdCgnLicpWzFdLmxlbmd0aCB8fCAwOyAKICAgIH0="
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961d",
"json": {
"contractName": "account2",
"contractAction": "register",
"contractPayload": {}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961g",
"json": {
"contractName": "contract",
"contractAction": "deploy",
"contractPayload": {
"name": "account",
"code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogIGRiLmNyZWF0ZVRhYmxlKCdhY2NvdW50cycpOwp9CgovLyByZWdpc3RlciBhbiBhY2NvdW50IGhlbHBzIG90aGVyIGNvbnRyYWN0cyB0byBrbm93IAovLyBpZiBhbiBhY2NvdW50IGV4aXN0cyBvbiB0aGUgU3RlZW0gYmxvY2tjaGFpbgphY3Rpb25zLnJlZ2lzdGVyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsKICBsZXQgYWNjb3VudHMgPSBkYi5nZXRUYWJsZSgnYWNjb3VudHMnKTsKCiAgbGV0IGFjY291bnQgPSBhY2NvdW50cy5maW5kT25lKHsgJ2lkJzogc2VuZGVyIH0pOwoKICBpZiAoYWNjb3VudCA9PT0gbnVsbCkgewogICAgY29uc3QgbmV3QWNjb3VudCA9IHsKICAgICAgJ2lkJzogc2VuZGVyCiAgICB9OwoKICAgIGFjY291bnRzLmluc2VydChuZXdBY2NvdW50KTsKICB9IAp9"
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961g",
"json": {
"contractName": "account",
"contractAction": "register",
"contractPayload": {}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961d",
"json": {
"contractName": "account",
"contractAction": "register",
"contractPayload": {}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961d",
"json": {
"contractName": "token",
"contractAction": "create",
"contractPayload": {
"symbol": "PKTC",
"precision": 0,
"maxSupply": 1000000
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961d",
"json": {
"contractName": "token",
"contractAction": "issue",
"contractPayload": {
"symbol": "PKTC",
"to": "harpagon",
"quantity": 100
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961d",
"json": {
"contractName": "token",
"contractAction": "issue",
"contractPayload": {
"symbol": "PKTC",
"to": "harpagon",
"quantity": 900
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961g",
"json": {
"contractName": "contract",
"contractAction": "deploy",
"contractPayload": {
"name": "token",
"code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogIGRiLmNyZWF0ZVRhYmxlKCd0b2tlbnMnKTsKICBkYi5jc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IDA7CiAgcmV0dXJuIHZhbHVlLnRvU3RyaW5nKCkuc3BsaXQoJy4nKVsxXS5sZW5ndGggfHwgMDsKfQ=="
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961d-g",
"json": {
"contractName": "token",
"contractAction": "create",
"contractPayload": {
"symbol": "PKTC",
"precision": 0,
"maxSupply": 1000000
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##test_contract_users##addUser##{ "username": "AwesomeUsername" }##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": "actions.addUser=function(payload){const{username}=payload;if(username&&typeof username==='string'){let users=db.getTable('users');let user=db.findJsonPath(users,"$..[?(@.id == '"+sender+"')]");if(user){}else{const newUser={'id':sender,'username':username};users.push(newUser)}}}actions.updateUser=function(payload){const{username}=payload;if(username&&typeof username==='string'){let users=db.getTable('users');let user=db.findJsonPath(users,"$..[?(@.id == '"+sender+"')]");if(user)user.username=username}}actions.removeUser=function(payload){if(sender!=owner)return;const{userId}=payload;if(userId&&typeof userId==='string'){let users=db.getTable('users');const index=users.findIndex(user=>user.id===userId);if(index!=-1)users.splice(index,1)}}"}##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##test_contract_users##addUser##{ "username": "AwesomeUsername" }##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": "actions.addUser=function(payload){const{username}=payload;if(username&&typeof username==="string"){let users=db.getTable("users");let user=db.findJsonPath(users,"$..[?(@.id == '"+sender+"')]");if(user){}else{const newUser={"id":sender,"username":username};users.push(newUser)}}}actions.updateUser=function(payload){const{username}=payload;if(username&&typeof username==="string"){let users=db.getTable("users");let user=db.findJsonPath(users,"$..[?(@.id == '"+sender+"')]");if(user)user.username=username}}actions.removeUser=function(payload){if(sender!=owner)return;const{userId}=payload;if(userId&&typeof userId==="string"){let users=db.getTable("users");const index=users.findIndex(user=>user.id===userId);if(index!=-1)users.splice(index,1)}}"}##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##test_contract_users##addUser##{ "username": "AwesomeUsername" }##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": 'actions.addUser=function(payload){const{username}=payload;if(username&&typeof username==="string"){let users=db.getTable("users");let user=db.findJsonPath(users,"$..[?(@.id == '"+sender+"')]");if(user){}else{const newUser={"id":sender,"username":username};users.push(newUser)}}}actions.updateUser=function(payload){const{username}=payload;if(username&&typeof username==="string"){let users=db.getTable("users");let user=db.findJsonPath(users,"$..[?(@.id == '"+sender+"')]");if(user)user.username=username}}actions.removeUser=function(payload){if(sender!=owner)return;const{userId}=payload;if(userId&&typeof userId==="string"){let users=db.getTable("users");const index=users.findIndex(user=>user.id===userId);if(index!=-1)users.splice(index,1)}}'}##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
test comment
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
test comment 2
edited comment
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
test reply
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": "actions.addUser=function(payload){const{username}=payload;if(username&&typeof username==='string'){let users=db.getTable('users');let user=db.findJsonPath(users,'$..[?(@.id == ''+sender+'')]');if(user){}else{const newUser={'id':sender,'username':username};users.push(newUser)}}}actions.updateUser=function(payload){const{username}=payload;if(username&&typeof username==='string'){let users=db.getTable('users');let user=db.findJsonPath(users,'$..[?(@.id == ''+sender+'')]');if(user)user.username=username}}actions.removeUser=function(payload){if(sender!=owner)return;const{userId}=payload;if(userId&&typeof userId==='string'){let users=db.getTable('users');const index=users.findIndex(user=>user.id===userId);if(index!=-1)users.splice(index,1)}}"}##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##test_contract_users##addUser##{ "username": "AwesomeUsername" }##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": "actions.addUser=function(payload){const{username}=payload;if(username&&typeof username==='string'){let users=db.getTable('users');let user=db.findJsonPath(users,'$..[?(@.id == ''+sender+'')]');if(user){}else{const newUser={'id':sender,'username':username};users.push(newUser)}}}actions.updateUser=function(payload){const{username}=payload;if(username&&typeof username==='string'){let users=db.getTable('users');let user=db.findJsonPath(users,'$..[?(@.id == ''+sender+'')]');if(user)user.username=username}}actions.removeUser=function(payload){if(sender!=owner)return;const{userId}=payload;if(userId&&typeof userId==='string'){let users=db.getTable('users');const index=users.findIndex(user=>user.id===userId);if(index!=-1)users.splice(index,1)}}"}##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##test_contract_users##addUser##{ "username": "AwesomeUsername" }##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": "YWN0aW9ucy5hZGRVc2VyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsNCiAgICBjb25zdCB7IHVzZXJuYW1lIH0gPSBwYXlsb2FkOw0KICAgIGlmICh1c2VybmFtZSAmJiB0eXBlb2YgdXNlcm5hbWUgPT09ICdzdHJpbmcnKXsNCg0KICAgICAgbGV0IHVzZXJzID0gZGIuZ2V0VGFib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bnN0IGluZGV4ID0gdXNlcnMuZmluZEluZGV4KHVzZXIgPT4gdXNlci5pZCA9PT0gdXNlcklkKTsNCiAgICAgIGlmIChpbmRleCAhPSAtMSkNCiAgICAgICAgdXNlcnMuc3BsaWNlKGluZGV4LCAxKTsNCiAgICB9DQogIH0="}##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##test_contract_users##addUser##{ "username": "AwesomeUsername" }##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "users_contract", "code": "YWN0aW9ucy5jcmVhdGUgPSBmdW5jdGlvbiAocGF5bG9hZCkgew0KICAgICAgZGIuY3JlYXRlVGFibGUoJ3VzZXJzJyk7DQogICAgfQ0KDQogICAgYWN0aW9ucy5hZGRVc2VyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsNCiAgICAgIGNvbnN0IHsgdXNlcm5hbWUgfSA9IHBheWxvYWQ7DQogICAgICBpZiAodXNlcm5hbWUgJiYgdHlwZW9mIHVzZXJuYW1lID09PSAnc3RyaW5nJyl7DQoNCiAgICAgICAgbGV0IHVzZXJzID0gZGIuZ2V0VGFibGUoJ3VzZXJzJyk7DQoNCiAgICAgICAgbGV0IHVzZXIgPSB1c2Vycy5maW5kT25lKHsgJ2lkJzogc2VuZGVyIH0pOw0KDQogICAgICAgIGlmICh1c2VyID09PSBudWxsKSB7DQogICAgICAgICAgY29uc3QgbmV3VXNlciA9IHsNCiAgICAgICAgICAgICdpZCc6IHNlbmRlciwNCiAgICAgICAgICAgICd1c2VybmFtZSc6IHVzZXJuYW1lLA0KICAgICAgICAgICAgJ3ZlcmlmaWVkJzogZmFsc2UsDQogICAgICAgICAgfTsNCg0KICAgICAgICAgIHVzZXJzLmluc2VydChuZXdVc2VyKTsNCiAgICAgICAgICBlbWl0KCduZXdVc2VyQ3JlYXRlZCcsIG5ld1VzZXIpOw0KICAgICAgICB9IA0KICAgICAgfQ0KICAgIH0NCg0KICAgIGFjdGlvbnMudXBkYXRlVXNlciA9IGZ1bmN0aW9uIChwYXlsb2FkKSB7DQogICAgICBjb25zdCB7IHVzZXJuYW1lIH0gPSBwYXlsb2FkOw0KICAgICAgaWYgKHVzZXJuYW1lICYmIHR5cGVvZiB1c2VybmFtZSA9PT0gJ3N0cmluZycpew0KDQogICAgICAgIGxldCB1c2VycyA9IGRiLmdldFRhYmxlKCd1c2VycycpOw0KICAgICAgICBsZXQgdXNlciA9IHVzZXJzLmZpbmRPbmUoeyAnaWQnOiBzZW5kZXIgfSk7DQogICAgICAgIGlmICh1c2VyKSB7DQogICAgICAgICAgdXNlci51c2VybmFtZSA9IHVzZXJuYW1lOw0KICAgICAgICAgIHVzZXJzLnVwZGF0ZSh1c2VyKTsNCiAgICAgICAgfQ0KICAgICAgfQ0KICAgIH0="##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##users_contract##addUser##{ "username": "AwesomeUsername" }##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "users_contract", "code": "YWN0aW9ucy5jcmVhdGUgPSBmdW5jdGlvbiAocGF5bG9hZCkgew0KICAgICAgZGIuY3JlYXRlVGFibGUoJ3VzZXJzJyk7DQogICAgfQ0KDQogICAgYWN0aW9ucy5hZGRVc2VyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsNCiAgICAgIGNvbnN0IHsgdXNlcm5hbWUgfSA9IHBheWxvYWQ7DQogICAgICBpZiAodXNlcm5hbWUgJiYgdHlwZW9mIHVzZXJuYW1lID09PSAnc3RyaW5nJyl7DQoNCiAgICAgICAgbGV0IHVzZXJzID0gZGIuZ2V0VGFibGUoJ3VzZXJzJyk7DQoNCiAgICAgICAgbGV0IHVzZXIgPSB1c2Vycy5maW5kT25lKHsgJ2lkJzogc2VuZGVyIH0pOw0KDQogICAgICAgIGlmICh1c2VyID09PSBudWxsKSB7DQogICAgICAgICAgY29uc3QgbmV3VXNlciA9IHsNCiAgICAgICAgICAgICdpZCc6IHNlbmRlciwNCiAgICAgICAgICAgICd1c2VybmFtZSc6IHVzZXJuYW1lLA0KICAgICAgICAgICAgJ3ZlcmlmaWVkJzogZmFsc2UsDQogICAgICAgICAgfTsNCg0KICAgICAgICAgIHVzZXJzLmluc2VydChuZXdVc2VyKTsNCiAgICAgICAgICBlbWl0KCduZXdVc2VyQ3JlYXRlZCcsIG5ld1VzZXIpOw0KICAgICAgICB9IA0KICAgICAgfQ0KICAgIH0NCg0KICAgIGFjdGlvbnMudXBkYXRlVXNlciA9IGZ1bmN0aW9uIChwYXlsb2FkKSB7DQogICAgICBjb25zdCB7IHVzZXJuYW1lIH0gPSBwYXlsb2FkOw0KICAgICAgaWYgKHVzZXJuYW1lICYmIHR5cGVvZiB1c2VybmFtZSA9PT0gJ3N0cmluZycpew0KDQogICAgICAgIGxldCB1c2VycyA9IGRiLmdldFRhYmxlKCd1c2VycycpOw0KICAgICAgICBsZXQgdXNlciA9IHVzZXJzLmZpbmRPbmUoeyAnaWQnOiBzZW5kZXIgfSk7DQogICAgICAgIGlmICh1c2VyKSB7DQogICAgICAgICAgdXNlci51c2VybmFtZSA9IHVzZXJuYW1lOw0KICAgICAgICAgIHVzZXJzLnVwZGF0ZSh1c2VyKTsNCiAgICAgICAgfQ0KICAgICAgfQ0KICAgIH0="}##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##users_contract##addUser##{ "username": "AwesomeUsername" }##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "users_test_contract", "code": "YWN0aW9ucy5jcmVhdGUgPSBmdW5jdGlvbiAocGF5bG9hZCkgew0KICAgICAgZGI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AgICAgICAgIHVzZXJzLnVwZGF0ZSh1c2VyKTsNCiAgICAgICAgfQ0KICAgICAgfQ0KICAgIH0="}##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##users_contract##addUser##{ "username": "AwesomeUsername" }##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
##STEEMCONTRACTSBEGIN##users_test_contract##addUser##{ "username": "AwesomeUsername" }##STEEMCONTRACTSEND##
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961d",
"json": {
"contractName": "contract",
"contractAction": "deploy",
"contractPayload": {
"name": "account2",
"code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogIGRiLmNyZWF0ZVRhYmxlKCdhY2NvdW50cycpOwp9CgovLyByZWdpc3RlciBhbiBhY2NvdW50IGhlbHBzIG90aGVyIGNvbnRyYWN0cyB0byBrbm93IAovLyBpZiBhbiBhY2NvdW50IGV4aXN0cyBvbiB0aGUgU3RlZW0gYmxvY2tjaGFpbgphY3Rpb25zLnJlZ2lzdGVyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsKICBsZXQgYWNjb3VudHMgPSBkYi5nZXRUYWJsZSgnYWNjb3VudHMnKTsKCiAgbGV0IGFjY291bnQgPSBhY2NvdW50cy5maW5kT25lKHsgJ2lkJzogc2VuZGVyIH0pOwoKICBpZiAoYWNjb3VudCA9PT0gbnVsbCkgewogICAgY29uc3QgbmV3QWNjb3VudCA9IHsKICAgICAgJ2lkJzogc2VuZGVyCiAgICB9OwoKICAgIGFjY291bnRzLmluc2VydChuZXdBY2NvdW50KTsKICB9IAp9"
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961l",
"json": {
"contractName": "contract",
"contractAction": "deploy",
"contractPayload": {
"name": "account",
"code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogIGRiLmNyZWF0ZVRhYmxlKCdhY2NvdW50cycpOwp9CgovLyByZWdpc3RlciBhbiBhY2NvdW50IGhlbHBzIG90aGVyIGNvbnRyYWN0cyB0byBrbm93IAovLyBpZiBhbiBhY2NvdW50IGV4aXN0cyBvbiB0aGUgU3RlZW0gYmxvY2tjaGFpbgphY3Rpb25zLnJlZ2lzdGVyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsKICBsZXQgYWNjb3VudHMgPSBkYi5nZXRUYWJsZSgnYWNjb3VudHMnKTsKCiAgbGV0IGFjY291bnQgPSBhY2NvdW50cy5maW5kT25lKHsgJ2lkJzogc2VuZGVyIH0pOwoKICBpZiAoYWNjb3VudCA9PT0gbnVsbCkgewogICAgY29uc3QgbmV3QWNjb3VudCA9IHsKICAgICAgJ2lkJzogc2VuZGVyCiAgICB9OwoKICAgIGFjY291bnRzLmluc2VydChuZXdBY2NvdW50KTsKICB9IAp9"
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961l",
"json": {
"contractName": "account",
"contractAction": "register",
"contractPayload": {}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961l",
"json": {
"contractName": "contract",
"contractAction": "deploy",
"contractPayload": {
"name": "token",
"code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogICAgICBkYi5jcmVhdGVUYWJsZSgndG9rZW5zJyk7CiAgICAgIGRiLmNyZWF0ZVRhYmxlKCdiYWxhbmNlcycpOwogICAgfQogICAgCiAgICBhY3Rpb25zLmNyZWF0ZSA9IGZ1bmN0aW9uIChwYXlsb2FkKSB7CiAgICAgIGNvbnN0IHsgc3ltYm9sLCBwcmVjaXNpb24sIG1heFN1cHBseSB9ID0gcGF5bG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4gPT09IG51bGwsICdzeW1ib2wgYWxyZWFkeSBleGlzdHMnKSkgewogICAgICAgICAgICBjb25zdCBuZXdUb2tlbiA9IHsKICAgICAgICAgICAgICAnaXNzdWVyJzogc2VuZGVyLAogICAgICAgICAgICAgIHN5bWJvbCwKICAgICAgICAgICAgICBwcmVjaXNpb24sCiAgICAgICAgICAgICAgbWF4U3VwcGx5LAogICAgICAgICAgICAgICdzdXBwbHknOiAwCiAgICAgICAgICAgIH07CiAgICAKICAgICAgICAgICAgdG9rZW5zLmluc2VydChuZXdUb2tlbik7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICAKICAgIGFjdGlvbnMuaXNzdWUgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogICAgICBjb25zdCB7IHRvLCBzeW1ib2wsIHF1YW50aXR5LCBpc1NpZ25lZFdpdGhBY3RpdmVLZXkgfSA9IHBheWxvYWQ7CiAgICAKICAgICAgaWYgKGFzc2VydChpc1NpZ25lZFdpdGhBY3RpdmVLZXkgPT09IHRydWUsICd5b3UgbXVzdCB1c2UgYSBjdXN0b21fanNvbiBzaWduZWQgd2l0aCB5b3VyIGFjdGl2ZSBrZXknKQogICAgICAgICYmIHRvICYmIHR5cGVvZiB0byA9PT0gJ3N0cmluZycKICAgICAgICAmJiBzeW1ib2wgJiYgdHlwZW9mIHN5bWJvbCA9PT0gJ3N0cmluZycKICAgICAgICAmJiBxdWFudGl0eSAmJiB0eXBlb2YgcXVhbnRpdHkgPT09ICdudW1iZXInKSB7CiAgICAKICAgICAgICBsZXQgdG9rZW5zID0gZGIuZ2V0VGFibGUoJ3Rva2VucycpOwogICAgICAgIGxldCB0b2tlbiA9IHRva2Vucy5maW5kT25lKHsgc3ltYm9sIH0pOwogICAgCiAgICAgICAgLy8gdGhlIHN5bWJvbCBtdXN0IGV4aXN0CiAgICAgICAgLy8gdGhlIHNlbmRlciBtdXN0IGJlIHRoZSBpc3N1ZXIKICAgICAgICAvLyB0aGVuIHd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RydWUpOwogICAgICAgICAgICB0b2tlbnMudXBkYXRlKHRva2VuKTsKICAgIAogICAgICAgICAgICBhZGRCYWxhbmNlKHRva2VuLmlzc3VlciwgdG9rZW4sIHF1YW50aXR5KTsKICAgIAogICAgICAgICAgICBpZiAodG8gIT09IHRva2VuLmlzc3VlcikgewogICAgICAgICAgICAgIGFjdGlvbnMudHJhbnNmZXIocGF5bG9hZCk7CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0KICAgIH0KICAgIAogICAgYWN0aW9ucy50cmFuc2ZlciA9IGZ1bmN0aW9uIChwYXlsb2FkKSB7CiAgICAgIGNvbnN0IHsgdG8sIHN5bWJvbCwgcXVhbnRpdHksIGlzU2lnbmVkV2l0aEFjdGl2ZUtleSB9ID0gcGF5bG9hZDsKICAgIAogICAgICBpZiAoYXNzZXJ0KGlzU2lnbmVkV2l0aEFjdGl2ZUtleSA9PT0gdHJ1ZSwgJ3lvdSBtdXN0IHVzZSBhIGN1c3RvbV9qc29uIHNpZ25lZCB3aXRoIHlvdXIgYWN0aXZlIGtleScpCiAgICAgICAgJiYgdG8gJiYgdHlwZW9mIHRvID09PSAnc3RyaW5nJwogICAgICAgICYmIHN5bWJvbCAmJiB0eXBlb2Ygc3ltYm9sID09PSAnc3RyaW5nJwogICAgICAgICYmIHF1YW50aXR5ICYmIHR5cGVvZiBxdWFudGl0eSA9PT0gJ251bWJlcicpIHsKICAgIAogICAgICAgIGlmIChhc3NlcnQodG8gIT09IHNlbmRlciwgJ2Nhbm5vdCB0cmFuc2ZlciB0byBzZWxmJykpIHsKICAgICAgICAgIGxldCBhY2NvdW50ID0gZGIuZmluZE9uZUluVGFibGUoJ2FjY291bnQnLCAnYWNjb3VudHMnLCB7ICdpZCc6IHRvIH0pOwogICAgCiAgICAgICAgICAvLyB0aGUgYWNjb3VudCBtdXN0IGhhdmUgYmVlbiByZWdpc3RlcmVkIGJlZm9yZQogICAgICAgICAgaWYgKGFzc2VydChhY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xzZSB7CiAgICAgICAgYmFsYW5jZS5iYWxhbmNlID0gY2FsY3VsYXRlQmFsYW5jZShiYWxhbmNlLmJhbGFuY2UsIHF1YW50aXR5LCB0b2tlbi5wcmVjaXNpb24sIHRydWUpOwogICAgCiAgICAgICAgYmFsYW5jZXMudXBkYXRlKGJhbGFuY2UpOwogICAgICB9CiAgICB9CiAgICAKICAgIGxldCBjYWxjdWxhdGVCYWxhbmNlID0gZnVuY3Rpb24gKGJhbGFuY2UsIHF1YW50aXR5LCBwcmVjaXNpb24sIGFkZCkgewogICAgICBpZiAocHJlY2lzaW9uID09PSAwKSB7CiAgICAgICAgcmV0dXJuIGFkZCA/IGJhbGFuY2UgKyBxdWFudGl0eSA6IGJhbGFuY2UgLSBxdWFudGl0eQogICAgICB9CiAgICAgIAogICAgICByZXR1cm4gYWRkID8gY3VycmVuY3koYmFsYW5jZSwgeyBwcmVjaXNpb24gfSkuc3VidHJhY3QocXVhbnRpdHkpIDogY3VycmVuY3koYmFsYW5jZSwgeyBwcmVjaXNpb24gfSkuc3VidHJhY3QocXVhbnRpdHkpOwogICAgfQogICAgCiAgICBsZXQgY291bnREZWNpbWFscyA9IGZ1bmN0aW9uICh2YWx1ZSkgewogICAgICBpZiAoTWF0aC5mbG9vcih2YWx1ZSkgPT09IHZhbHVlKSByZXR1cm4gMDsKICAgICAgcmV0dXJuIHZhbHVlLnRvU3RyaW5nKCkuc3BsaXQoJy4nKVsxXS5sZW5ndGggfHwgMDsKICAgIH0="
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961l",
"json": {
"contractName": "token",
"contractAction": "create",
"contractPayload": {
"symbol": "PKTC",
"precision": 0,
"maxSupply": 1000000
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961j",
"json": {
"contractName": "contract",
"contractAction": "deploy",
"contractPayload": {
"name": "account",
"code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogIGRiLmNyZWF0ZVRhYmxlKCdhY2NvdW50cycpOwp9CgovLyByZWdpc3RlciBhbiBhY2NvdW50IGhlbHBzIG90aGVyIGNvbnRyYWN0cyB0byBrbm93IAovLyBpZiBhbiBhY2NvdW50IGV4aXN0cyBvbiB0aGUgU3RlZW0gYmxvY2tjaGFpbgphY3Rpb25zLnJlZ2lzdGVyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsKICBsZXQgYWNjb3VudHMgPSBkYi5nZXRUYWJsZSgnYWNjb3VudHMnKTsKCiAgbGV0IGFjY291bnQgPSBhY2NvdW50cy5maW5kT25lKHsgJ2lkJzogc2VuZGVyIH0pOwoKICBpZiAoYWNjb3VudCA9PT0gbnVsbCkgewogICAgY29uc3QgbmV3QWNjb3VudCA9IHsKICAgICAgJ2lkJzogc2VuZGVyCiAgICB9OwoKICAgIGFjY291bnRzLmluc2VydChuZXdBY2NvdW50KTsKICB9IAp9"
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961j",
"json": {
"contractName": "account",
"contractAction": "register",
"contractPayload": {}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961j",
"json": {
"contractName": "contract",
"contractAction": "deploy",
"contractPayload": {
"name": "token",
"code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogICAgICBkYi5jcmVhdGVUYWJsZSgndG9rZW5zJyk7CiAgICAgIGRiLmNyZWF0ZVRhYmxlKCdiYWxhbmNlcycpOwogICAgfQogICAgCiAgICBhY3Rpb25zLmNyZWF0ZSA9IGZ1bmN0aW9uIChwYXlsb2FkKSB7CiAgICAgIGNvbnN0IHsgc3ltYm9sLCBwcmVjaXNpb24sIG1heFN1cHBseSB9ID0gcGF5bG9hZDsKICAgIAogICAgICB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1ib2wgYWxyZWFkeSBleGlzdHMnKSkgewogICAgICAgICAgICBjb25zdCBuZXdUb2tlbiA9IHsKICAgICAgICAgICAgICAnaXNzdWVyJzogc2VuZGVyLAogICAgICAgICAgICAgIHN5bWJvbCwKICAgICAgICAgICAgICBwcmVjaXNpb24sCiAgICAgICAgICAgICAgbWF4U3VwcGx5LAogICAgICAgICAgICAgICdzdXBwbHknOiAwCiAgICAgICAgICAgIH07CiAgICAKICAgICAgICAgICAgdG9rZW5zLmluc2VydChuZXdUb2tlbik7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICAKICAgIGFjdGlvbnMuaXNzdWUgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogICAgICBjb25zdCB7IHRvLCBzeW1ib2wsIHF1YW50aXR5LCBpc1NpZ25lZFdpdGhBY3RpdmVLZXkgfSA9IHBheWxvYWQ7CiAgICAKICAgICAgaWYgKGFzc2VydChpc1NpZ25lZFdpdGhBY3RpdmVLZXkgPT09IHRydWUsICd5b3UgbXVzdCB1c2UgYSBjdXN0b21fanNvbiBzaWduZWQgd2l0aCB5b3VyIGFjdGl2ZSBrZXknKQogICAgICAgICYmIHRvICYmIHR5cGVvZiB0byA9PT0gJ3N0cmluZycKICAgICAgICAmJiBzeW1ib2wgJiYgdHlwZW9mIHN5bWJvbCA9PT0gJ3N0cmluZycKICAgICAgICAmJiBxdWFudGl0eSAmJiB0eXBlb2YgcXVhbnRpdHkgPT09ICdudW1iZXInKSB7CiAgICAKICAgICAgICBsZXQgdG9rZW5zID0gZGIuZ2V0VGFibGUoJ3Rva2VucycpOwogICAgICAgIGxldCB0b2tlbiA9IHRva2Vucy5maW5kT25lKHsgc3ltYm9sIH0pOwogICAgCiAgICAgICAgLy8gdGhlIHN5bWJvbCBtdXN0IGV4aXN0CiAgICAgICAgLy8gdGhlIHNlbmRlciBtdXN0IGJlIHRoZSBpc3N1ZXIKICAgICAgICAvLyB0aGVuIHdlIG5lZWQgdG8gY2hl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mFsYW5jZS5iYWxhbmNlID0gY2FsY3VsYXRlQmFsYW5jZShiYWxhbmNlLmJhbGFuY2UsIHF1YW50aXR5LCB0b2tlbi5wcmVjaXNpb24sIHRydWUpOwogICAgCiAgICAgICAgYmFsYW5jZXMudXBkYXRlKGJhbGFuY2UpOwogICAgICB9CiAgICB9CiAgICAKICAgIGxldCBjYWxjdWxhdGVCYWxhbmNlID0gZnVuY3Rpb24gKGJhbGFuY2UsIHF1YW50aXR5LCBwcmVjaXNpb24sIGFkZCkgewogICAgICBpZiAocHJlY2lzaW9uID09PSAwKSB7CiAgICAgICAgcmV0dXJuIGFkZCA/IGJhbGFuY2UgKyBxdWFudGl0eSA6IGJhbGFuY2UgLSBxdWFudGl0eQogICAgICB9CgogICAgICByZXR1cm4gYWRkID8gY3VycmVuY3koYmFsYW5jZSwgeyBwcmVjaXNpb24gfSkuYWRkKHF1YW50aXR5KSA6IGN1cnJlbmN5KGJhbGFuY2UsIHsgcHJlY2lzaW9uIH0pLnN1YnRyYWN0KHF1YW50aXR5KTsKICAgIH0KICAgIAogICAgbGV0IGNvdW50RGVjaW1hbHMgPSBmdW5jdGlvbiAodmFsdWUpIHsKICAgICAgaWYgKE1hdGguZmxvb3IodmFsdWUpID09PSB2YWx1ZSkgcmV0dXJuIDA7CiAgICAgIHJldHVybiB2YWx1ZS50b1N0cmluZygpLnNwbGl0KCcuJylbMV0ubGVuZ3RoIHx8IDA7CiAgICB9"
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961j",
"json": {
"contractName": "token",
"contractAction": "create",
"contractPayload": {
"symbol": "PKTC",
"precision": 0,
"maxSupply": 1000000
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961j",
"json": {
"contractName": "token",
"contractAction": "create",
"contractPayload": {
"symbol": "SMMT",
"precision": 0,
"maxSupply": 1000000
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961j",
"json": {
"contractName": "contract",
"contractAction": "deploy",
"contractPayload": {
"name": "smmt",
"code": "Y29uc3QgVE9LRU5TWU1CT0wgPSAnU01NVCc7CmFjdGlvbnMuY3JlYXRlU1NDID0gZnVuY3Rpb24gKHBheWxvYWQpIHsKICBkYi5jcmVhdGVUYWJsZSgnYmFsYW5jZXMnKTsKICBsZXQgcmV3YXJkcyA9IGRiLmNyZWF0ZVRhYmxlKCdyZXdhcmRzJyk7CiAgcmV3YXJkcy5pbnNlcnQoewogICAgJ3BlbmRpbmdSZXdhcmRzJzogMCwKICAgICdyZXdhcmRzRGlzdHJpYnV0aW9uSW50ZXJ2YWwnOiAzMDAwMCwKICAgICdsYXN0QmxvY2tSZXdhcmQnOiAwLAogICAgJ3Rva2VuSXNzdWFuY2VSYXRlJzogMSwKICAgICduZXh0SGFsdmluZyc6IDUwMDAwMCwKICAgICdiZW5lZmljaWFyaWVzJzogWydzdGVlbW1vbnN0ZXJzJywgJ2hhcnBhZ29uJ10KICB9KQp9CgphY3Rpb25zLnVwZGF0ZVJld2FyZHNEaXN0cmlidXRpb25JbnRlcnZhbCA9IGZ1bmN0aW9uIChwYXlsb2FkKSB7CiAgaWYgKHNlbmRlciAhPT0gb3duZXIpIHJldHVybjsKCiAgY29uc3QgeyBuYkJsb2NrcyB9ID0gcGF5bG9hZDsKCiAgaWYgKE51bWJlci5pc0ludGVnZXIobmJCbG9ja3MpKSB7CiAgICBsZXQgcmV3YXJkcyA9IGRiLmdldFRhYmxlKCdyZXdhcmRzJyk7CiAgICBsZXQgcmVjID0gcmV3YXJkcy5maW5kT25lKHt9KTsKICAgIHJlYy5yZXdhcmRzRGlzdHJpYnV0aW9uSW50ZXJ2YWwgPSBuYkJsb2NrczsKICAgIHJld2FyZHMudXBkYXRlKHJlYyk7CiAgfQp9CgphY3Rpb25zLnVwZGF0ZUJlbmVmaWNpYXJpZXMgPSBm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PT09IHZhbHVlKSByZXR1cm4gMDsKICByZXR1cm4gdmFsdWUudG9TdHJpbmcoKS5zcGxpdCgnLicpWzFdLmxlbmd0aCB8fCAwOwp9"
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961j",
"json": {
"contractName": "token",
"contractAction": "create",
"contractPayload": {
"symbol": "SMMKT",
"precision": 3,
"maxSupply": 1000000
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-b8923f70-c1f7-497f-961j",
"json": {
"contractName": "contract",
"contractAction": "deploy",
"contractPayload": {
"name": "smmkt",
"code": "Y29uc3QgVE9LRU5TWU1CT0wgPSAnU01NS1QnOwphY3Rpb25zLmNyZWF0ZVNTQyA9IGZ1bmN0aW9uIChwYXlsb2FkKSB7CiAgZGIuY3JlYXRlVGFibGUoJ2JhbGFuY2VzJyk7CiAgbGV0IHJld2FyZHMgPSBkYi5jcmVhdGVUYWJsZSgncmV3YXJkcycpOwogIHJld2FyZHMuaW5zZXJ0KHsKICAgICdwZW5kaW5nUmV3YXJkcyc6IDAsCiAgICAncmV3YXJkc0Rpc3RyaWJ1dGlvbkludGVydmFsJzogMzAwMDAsCiAgICAnbGFzdEJsb2NrUmV3YXJkJzogcmVmU3RlZW1CbG9ja051bWJlciwKICAgICd0b2tlbklzc3VhbmNlUmF0ZSc6IDEsCiAgICAnbmV4dEhhbHZpbmcnOiA1MDAwMDAsCiAgICAnYmVuZWZpY2lhcmllcyc6IFsnc21tYXJrZXR0b2tlbiddCiAgfSkKfQoKYWN0aW9ucy51cGRhdGVSZXdhcmRzRGlzdHJpYnV0aW9uSW50ZXJ2YWwgPSBmdW5jdGlvbiAocGF5bG9hZCkgewogIGlmIChzZW5kZXIgIT09IG93bmVyKSByZXR1cm47CgogIGNvbnN0IHsgbmJCbG9ja3MgfSA9IHBheWxvYWQ7CgogIGlmIChOdW1iZXIuaXNJbnRlZ2VyKG5iQ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bmN0aW9uIChhLCBiKSB7CiAgLy9sZXQgcmVzID0gKChhICogMTAwMCkgLSAoYiAqIDEwMDApKSAvIDEwMDA7CiAgLy9yZXR1cm4gcmVzID4gMCA/IHJlcy50b0ZpeGVkKDMpIDogMDsKICByZXR1cm4gY3VycmVuY3koYSwgeyBwcmVjaXNpb246IDMgfSkuc3VidHJhY3QoYik7Cn0KCmxldCBjb3VudERlY2ltYWxzID0gZnVuY3Rpb24gKHZhbHVlKSB7CiAgaWYgKE1hdGguZmxvb3IodmFsdWUpID09PSB2YWx1ZSkgcmV0dXJuIDA7CiAgcmV0dXJuIHZhbHVlLnRvU3RyaW5nKCkuc3BsaXQoJy4nKVsxXS5sZW5ndGggfHwgMDsKfQ=="
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
comment pruned due to size
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-00000000000000000002",
"json": {
"contractName": "contract",
"contractAction": "deploy",
"contractPayload": {
"name": "test",
"params": "",
"code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBhc3luYyAocGF5bG9hZCkgPT4gewogICAgICAgICAgYXdhaXQgYXBpLmRiLmNyZWF0ZVRhYmxlKCd0ZXN0VXBkYXRlVGFibGUnKTsKICAgICAgICB9"
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
comment pruned due to size
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-00000000000000000002",
"json": {
"contractName": "contract",
"contractAction": "deploy",
"contractPayload": {
"name": "test",
"params": "",
"code": "YWN0aW9ucy5jcmVhdGVTU0MgPSBhc3luYyAocGF5bG9hZCkgPT4gewogICAgICAgICAgYXdhaXQgYXBpLmRiLmNyZWF0ZVRhYmxlKCd0ZXN0VXBkYXRlVGFibGUnKTsKICAgICAgICB9"
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
comment pruned due to size
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-testnet1",
"json": {
"contractName": "contract",
"contractAction": "deploy",
"contractPayload": {
"name": "inflation",
"params": "",
"code": "LyogZXNsaW50LWRpc2FibGUgbm8tYXdhaXQtaW4tbG9vcCAqLwovKiBnbG9iYWwgYWN0aW9ucywgYXBpICovCgovLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tdGVtcGxhdGUtY3VybHktaW4tc3RyaW5nCmNvbnN0IFVUSUxJVFlfVE9LRU5fU1lNQk9MID0gIlNTQyI7CgphY3Rpb25zLmNyZWF0ZVNTQyA9IGFzeW5jICgpID0+IHsKCn07CgphY3Rpb25zLmlzc3VlTmV3VG9rZW5zID0gYXN5bmMgKCkgPT4gewogIGlmIChhcGkuc2VuZGVyICE9PSAnbnVsbCcpIHJldHVybjsKCiAgLy8gaXNzdWUgdG9rZW5zIHRvIHN0ZWVtc2MKICAvLyAxMDBrIHRva2VucyBwZXIgeWVhciA9IDExLjQxNTUyNTExIHRva2VucyBwZXIgaG91ciAoYW4gaG91ciA9IDEyMDAgYmxvY2tzKQogIGxldCBuYlRva2VucyA9ICcxMS40MTU1MjUxMSc7CiAgYXdhaXQgYXBpLmV4ZWN1dGVTbWFydENvbnRyYWN0KCd0b2tlbnMnLCAnaXNzdWUnLCB7IHN5bWJvbDogVVRJTElUWV9UT0tFTl9TWU1CT0wsIHF1YW50aXR5OiBuYlRva2VucywgdG86ICdzdGVlbXNjJyB9KTsKCiAgLy8gaXNzdWUgdG9rZW5zIHRvIGVuZ3Bvb2wKICAvLyAxMDBrIHRva2VucyBwZXIgeWVhciA9IDExLjQxNTUyNTExIHRva2VucyBwZXIgaG91ciAoYW4gaG91ciA9IDEyMDAgYmxvY2tzKQogIG5iVG9rZW5zID0gJzExLjQxNTUyNTExJzsKICBhd2FpdCBhcGkuZXhlY3V0ZVNtYXJ0Q29udHJhY3QoJ3Rva2VucycsICdpc3N1ZScsIHsgc3ltYm9sOiBVVElMSVRZX1RPS0VOX1NZTUJPTCwgcXVhbnRpdHk6IG5iVG9rZW5zLCB0bzogJ2VuZ3Bvb2wnIH0pOwoKICAvLyBpc3N1ZSB0b2tlbnMgdG8gIndpdG5lc3NlcyIgY29udHJhY3QKICAvLyAyMDBrIHRva2VucyBwZXIgeWVhciA9IDIyLjgzMTA1MDIyIHRva2VucyBwZXIgaG91ciAoYW4gaG91ciA9IDEyMDAgYmxvY2tzKQogIG5iVG9rZW5zID0gJzIyLjgzMTA1MDIyJzsKICBhd2FpdCBhcGkuZXhlY3V0ZVNtYXJ0Q29udHJhY3QoJ3Rva2VucycsICdpc3N1ZVRvQ29udHJhY3QnLCB7IHN5bWJvbDogVVRJTElUWV9UT0tFTl9TWU1CT0wsIHF1YW50aXR5OiBuYlRva2VucywgdG86ICd3aXRuZXNzZXMnIH0pOwp9Owo="
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
comment pruned due to size
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
{
"id": "ssc-testnet1",
"json": {
"contractName": "contract",
"contractAction": "deploy",
"contractPayload": {
"name": "crittermanager",
"params": "",
"code": "LyogZXNsaW50LWRpc2FibGUgbm8tYXdhaXQtaW4tbG9vcCAqLwovKiBlc2xpbnQtZGlzYWJsZSBtYXgtbGVuICovCi8qIGdsb2JhbCBhY3Rpb25zLCBhcGkgKi8KCi8vIHRlc3QgY29udHJhY3QgdG8gZGVtb25zdHJhdGUgU3BsaW50ZXJsYW5kcyBzdHlsZQovLyBwYWNrIGlzc3VhbmNlIG9mIGNvbGxlY3RhYmxlIGNyaXR0ZXJzCmNvbnN0IENPTlRSQUNUX05BTUUgPSAnY3JpdHRlcm1hbmFnZXInOwoKLy8gbm9ybWFsbHkgd2Ugd291bGQgdXNlIGFwaS5vd25lciB0byByZWZlciB0byB0aGUgY29udHJhY3QKLy8gb3duZXIgKHRoZSBhY2NvdW50IHRoYXQgZGVwbG95ZWQgdGhlIGNvbnRyYWN0KSwgYnV0IGZv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ICAgIH0KCiAgICAgICAgICBhd2FpdCBhcGkuZXhlY3V0ZVNtYXJ0Q29udHJhY3QoJ25mdCcsICdpc3N1ZU11bHRpcGxlJywgewogICAgICAgICAgICBpbnN0YW5jZXMsCiAgICAgICAgICAgIGlzU2lnbmVkV2l0aEFjdGl2ZUtleSwKICAgICAgICAgIH0pOwogICAgICAgIH0KICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgfQogICAgfQogIH0KICByZXR1cm4gZmFsc2U7Cn07Cg=="
}
}
}
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
comment pruned due to size
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit