From 46a1dd8b40b9b6bdebe80f553bb4b25934e82b1a Mon Sep 17 00:00:00 2001 From: Gusarich Date: Tue, 26 Mar 2024 14:42:53 +0300 Subject: [PATCH] add import of ownable lib into stoppable lib --- examples/rugpull.tact | 1 - src/imports/stdlib.ts | 18 +++++++++--------- stdlib/libs/stoppable.tact | 2 ++ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/examples/rugpull.tact b/examples/rugpull.tact index b9385622b..b2219f51f 100644 --- a/examples/rugpull.tact +++ b/examples/rugpull.tact @@ -1,4 +1,3 @@ -import "@stdlib/ownable"; import "@stdlib/stoppable"; struct RugParams { diff --git a/src/imports/stdlib.ts b/src/imports/stdlib.ts index 852d602fc..7a89c2659 100644 --- a/src/imports/stdlib.ts +++ b/src/imports/stdlib.ts @@ -97,15 +97,15 @@ files['libs/ownable.tact'] = 'ZXBseSByZXN1bHQKICAgICAgICBzZWxmLnJlcGx5KENoYW5nZU93bmVyT2t7IHF1ZXJ5SWQ6IG1zZy5xdWVyeUlkLCBuZXdPd25lcjptc2cubmV3T3duZXIgfS50b0Nl' + 'bGwoKSk7CiAgICB9Cn0='; files['libs/stoppable.tact'] = - 'QGludGVyZmFjZSgib3JnLnRvbi5zdG9wcGFibGUiKQp0cmFpdCBTdG9wcGFibGUgd2l0aCBPd25hYmxlIHsKICAgIAogICAgc3RvcHBlZDogQm9vbDsKICAgIG93bmVy' + - 'OiBBZGRyZXNzOwoKICAgIGZ1biByZXF1aXJlTm90U3RvcHBlZCgpIHsKICAgICAgICByZXF1aXJlKCFzZWxmLnN0b3BwZWQsICJDb250cmFjdCBzdG9wcGVkIik7CiAg' + - 'ICB9CgogICAgZnVuIHJlcXVpcmVTdG9wcGVkKCkgewogICAgICAgIHJlcXVpcmUoc2VsZi5zdG9wcGVkLCAiQ29udHJhY3Qgbm90IHN0b3BwZWQiKTsKICAgIH0KCiAg' + - 'ICByZWNlaXZlKCJTdG9wIikgewogICAgICAgIHNlbGYucmVxdWlyZU93bmVyKCk7CiAgICAgICAgc2VsZi5yZXF1aXJlTm90U3RvcHBlZCgpOwogICAgICAgIHNlbGYu' + - 'c3RvcHBlZCA9IHRydWU7CiAgICAgICAgc2VsZi5yZXBseSgiU3RvcHBlZCIuYXNDb21tZW50KCkpOwogICAgfQoKICAgIGdldCBmdW4gc3RvcHBlZCgpOiBCb29sIHsK' + - 'ICAgICAgICByZXR1cm4gc2VsZi5zdG9wcGVkOwogICAgfQp9CgpAaW50ZXJmYWNlKCJvcmcudG9uLnJlc3VtYWJsZSIpCnRyYWl0IFJlc3VtYWJsZSB3aXRoIFN0b3Bw' + - 'YWJsZSB7CiAgICBzdG9wcGVkOiBCb29sOwogICAgb3duZXI6IEFkZHJlc3M7CgogICAgcmVjZWl2ZSgiUmVzdW1lIikgewogICAgICAgIHNlbGYucmVxdWlyZU93bmVy' + - 'KCk7CiAgICAgICAgc2VsZi5yZXF1aXJlU3RvcHBlZCgpOwogICAgICAgIHNlbGYuc3RvcHBlZCA9IGZhbHNlOwogICAgICAgIHNlbGYucmVwbHkoIlJlc3VtZWQiLmFz' + - 'Q29tbWVudCgpKTsKICAgIH0KfQ=='; + 'aW1wb3J0ICIuL293bmFibGUiOwoKQGludGVyZmFjZSgib3JnLnRvbi5zdG9wcGFibGUiKQp0cmFpdCBTdG9wcGFibGUgd2l0aCBPd25hYmxlIHsKICAgIAogICAgc3Rv' + + 'cHBlZDogQm9vbDsKICAgIG93bmVyOiBBZGRyZXNzOwoKICAgIGZ1biByZXF1aXJlTm90U3RvcHBlZCgpIHsKICAgICAgICByZXF1aXJlKCFzZWxmLnN0b3BwZWQsICJD' + + 'b250cmFjdCBzdG9wcGVkIik7CiAgICB9CgogICAgZnVuIHJlcXVpcmVTdG9wcGVkKCkgewogICAgICAgIHJlcXVpcmUoc2VsZi5zdG9wcGVkLCAiQ29udHJhY3Qgbm90' + + 'IHN0b3BwZWQiKTsKICAgIH0KCiAgICByZWNlaXZlKCJTdG9wIikgewogICAgICAgIHNlbGYucmVxdWlyZU93bmVyKCk7CiAgICAgICAgc2VsZi5yZXF1aXJlTm90U3Rv' + + 'cHBlZCgpOwogICAgICAgIHNlbGYuc3RvcHBlZCA9IHRydWU7CiAgICAgICAgc2VsZi5yZXBseSgiU3RvcHBlZCIuYXNDb21tZW50KCkpOwogICAgfQoKICAgIGdldCBm' + + 'dW4gc3RvcHBlZCgpOiBCb29sIHsKICAgICAgICByZXR1cm4gc2VsZi5zdG9wcGVkOwogICAgfQp9CgpAaW50ZXJmYWNlKCJvcmcudG9uLnJlc3VtYWJsZSIpCnRyYWl0' + + 'IFJlc3VtYWJsZSB3aXRoIFN0b3BwYWJsZSB7CiAgICBzdG9wcGVkOiBCb29sOwogICAgb3duZXI6IEFkZHJlc3M7CgogICAgcmVjZWl2ZSgiUmVzdW1lIikgewogICAg' + + 'ICAgIHNlbGYucmVxdWlyZU93bmVyKCk7CiAgICAgICAgc2VsZi5yZXF1aXJlU3RvcHBlZCgpOwogICAgICAgIHNlbGYuc3RvcHBlZCA9IGZhbHNlOwogICAgICAgIHNl' + + 'bGYucmVwbHkoIlJlc3VtZWQiLmFzQ29tbWVudCgpKTsKICAgIH0KfQ=='; files['std/base.tact'] = 'dHJhaXQgQmFzZVRyYWl0IHsKICAgIHZpcnR1YWwgY29uc3Qgc3RvcmFnZVJlc2VydmU6IEludCA9IDA7CiAgICAKICAgIHZpcnR1YWwgaW5saW5lIGZ1biByZXBseShi' + 'b2R5OiBDZWxsPykgewogICAgICAgIHNlbGYuZm9yd2FyZChzZW5kZXIoKSwgYm9keSwgdHJ1ZSwgbnVsbCk7CiAgICB9CgogICAgdmlydHVhbCBpbmxpbmUgZnVuIG5v' + diff --git a/stdlib/libs/stoppable.tact b/stdlib/libs/stoppable.tact index 2f87f50a4..7fb712f34 100644 --- a/stdlib/libs/stoppable.tact +++ b/stdlib/libs/stoppable.tact @@ -1,3 +1,5 @@ +import "./ownable"; + @interface("org.ton.stoppable") trait Stoppable with Ownable {