From faabfe1b4eb0e7eb95f057296916541ecc84d71d Mon Sep 17 00:00:00 2001 From: Gusarich Date: Tue, 26 Mar 2024 14:42:53 +0300 Subject: [PATCH 1/4] 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 { From d71ded5b97bac3b8fe21aaca506d673ee09a5bea Mon Sep 17 00:00:00 2001 From: Gusarich Date: Tue, 26 Mar 2024 14:45:50 +0300 Subject: [PATCH 2/4] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96296a660..80f02580c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Update the `dump` function to handle addresses: PR [#175](https://github.com/tact-lang/tact/pull/175) - The implicit empty `init` function is now present by default in the contract if not declared: PR [#167](https://github.com/tact-lang/tact/pull/167) +- `@stdlib/stoppable` now imports `@stdlib/ownable` by itself: PR [#193](https://github.com/tact-lang/tact/pull/193) ### Fixed From b1b7cbef048a7f8a649e93da22e11427834e5c73 Mon Sep 17 00:00:00 2001 From: Anton Trunov Date: Wed, 27 Mar 2024 21:59:08 +0300 Subject: [PATCH 3/4] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80f02580c..8cef2a470 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Update the `dump` function to handle addresses: PR [#175](https://github.com/tact-lang/tact/pull/175) - The implicit empty `init` function is now present by default in the contract if not declared: PR [#167](https://github.com/tact-lang/tact/pull/167) -- `@stdlib/stoppable` now imports `@stdlib/ownable` by itself: PR [#193](https://github.com/tact-lang/tact/pull/193) +- `@stdlib/stoppable` now imports `@stdlib/ownable` so the programmer of does not have to do it separately: PR [#193](https://github.com/tact-lang/tact/pull/193) ### Fixed From 8c6602747ba7658eaced0d0345e60c3000986793 Mon Sep 17 00:00:00 2001 From: Anton Trunov Date: Wed, 27 Mar 2024 21:59:25 +0300 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cef2a470..da8ef070a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Update the `dump` function to handle addresses: PR [#175](https://github.com/tact-lang/tact/pull/175) - The implicit empty `init` function is now present by default in the contract if not declared: PR [#167](https://github.com/tact-lang/tact/pull/167) -- `@stdlib/stoppable` now imports `@stdlib/ownable` so the programmer of does not have to do it separately: PR [#193](https://github.com/tact-lang/tact/pull/193) +- `@stdlib/stoppable` now imports `@stdlib/ownable` so the programmer does not have to do it separately: PR [#193](https://github.com/tact-lang/tact/pull/193) ### Fixed