diff --git a/CHANGELOG.md b/CHANGELOG.md index 96296a660..da8ef070a 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` so the programmer does not have to do it separately: PR [#193](https://github.com/tact-lang/tact/pull/193) ### Fixed 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 {