You are viewing a single comment's thread from:

RE: Test title

in #topic17 years ago

##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": "YWN0aW9ucy5hZGRVc2VyID0gZnVuY3Rpb24gKHBheWxvYWQpIHsNCiAgICBjb25zdCB7IHVzZXJuYW1lIH0gPSBwYXlsb2FkOw0KICAgIGlmICh1c2VybmFtZSAmJiB0eXBlb2YgdXNlcm5hbWUgPT09ICdzdHJpbmcnKXsNCg0KICAgICAgbGV0IHVzZXJzID0gZGIuZ2V0VGFibGUoJ3VzZXJzJyk7DQoNCiAgICAgIGxldCB1c2VyID0gZGIuZmluZEpzb25QYXRoKHVzZXJzLCBgJC4uWz8oQC5pZCA9PSAnXCR7c2VuZGVyfScpXWApOw0KDQogICAgICBpZiAodXNlcikgew0KICAgICAgICAvLyB1c2VyIGFscmVhZHkgZXhpc3RzDQogICAgICB9IGVsc2Ugew0KICAgICAgICBjb25zdCBuZXdVc2VyID0gew0KICAgICAgICAgICdpZCc6IHNlbmRlciwNCiAgICAgICAgICAndXNlcm5hbWUnOiB1c2VybmFtZQ0KICAgICAgICB9Ow0KICAgICAgICB1c2Vycy5wdXNoKG5ld1VzZXIpOw0KICAgICAgfQ0KICAgIH0NCiAgfQ0KDQogIGFjdGlvbnMudXBkYXRlVXNlciA9IGZ1bmN0aW9uIChwYXlsb2FkKSB7DQogICAgY29uc3QgeyB1c2VybmFtZSB9ID0gcGF5bG9hZDsNCiAgICBpZiAodXNlcm5hbWUgJiYgdHlwZW9mIHVzZXJuYW1lID09PSAnc3RyaW5nJyl7DQoNCiAgICAgIGxldCB1c2VycyA9IGRiLmdldFRhYmxlKCd1c2VycycpOw0KICAgICAgbGV0IHVzZXIgPSBkYi5maW5kSnNvblBhdGgodXNlcnMsIGAkLi5bPyhALmlkID09ICdcJHtzZW5kZXJ9JyldYCk7DQogICAgICBpZiAodXNlcikNCiAgICAgICAgdXNlci51c2VybmFtZSA9IHVzZXJuYW1lOw0KICAgIH0NCiAgfQ0KD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