429
https://smartpy.io/ https://twitter.com/smartpy_io
yes, I have already created a lot of contract in smartpy for that paper, now I'm refactoring using modern syntax
Читать полностью…
You'll push that to rosetta smart contracts? Thank you!
Читать полностью…
Here is a SmartPy version of the constructor.
Notice that I did: self.data._payees = reversed(payees) outside of the _addPayee function as it's less strange. SmartPy doesn't have any append.
An easier version to read could be this one. The performance is reduced but we don't really care as it's in the constructor.
I managed to this:
counter_p = 0Читать полностью…
counter_s= 0
done = False
for payee in payees:
done = False
counter_s = 0
for share in shares:
if not done:
for i in range(payees_len):
if i == counter_s and i == counter_p:
assert payee != sp.address("0"), "PaymentSplitter: account is the zero address"
assert share > 0, "PaymentSplitter: shares are 0"
assert not self.data.shares.contains(payee), "PaymentSplitter: account already has shares"
self.data.shares[payee] = share
self.data.total_shares += share
done = True
counter_s += 1
counter_p += 1
🥳🎉Announcing - SmartPy alpha release v0.24.0a1 🎄☃️
https://releases.smartpy.io/0.24.0a1/
This is the alpha release for the next Tezos protocol update Tallinn.
New Features
* Added Tallinn as the default protocol,
* Updated to octez-client version 24.0-rc1,
* Added support for sp.index_address (implements Michelson instruction INDEX_ADDRESS),
* Added support for sp.get_address_index(implements Michelson instruction GET_ADDRESS_INDEX),
* Added a new Boolean effect with_index_address ,
* Added support for the Python in operation in contract code,
* Added support for shadownet ,
and more ...
Please see https://releases.smartpy.io/0.24.0a1/releases#v0-24-0a1 - also available as a Jupyter Notebook: https://releases.smartpy.io/0.24.0a1/experimental-notebook/lab/index.html?path=releases%2F0.24.ipynb.
🎄🎁❄️
i am trying to test balances of accounts interacting with contracts. below an example with comments. can you confirm that this is expected behavior and what is the reasoning behind that?
also, is there a more elegant and consistent way to test such behaviour using test accounts?
https://smartpy.io/ide?code=eJyVUlFLwzAQfu@vOLqHpTgKnW9CYXOILzpBhD2G2GYskKYxSZX6602aVBtXwR2UJpe7@7777hLWyFYZ0A1RRvZANGiZJBst86atO06Tmh6hIUyg7CYBaxUnWsNjv2uFUaQyyIaO5xDizKVhzAQzGCNN@XHy5kzaKsm3x@FRW6OXLRMGZVEZSfq5CrYAdcxl_ko4ERWFsnQ3Qz9Rka0gPTw_7e_x7fZhu9_dpf8EU_Sto9rMAdo0TUWNwp@q1Q9cFkUmE6UOhHP6l0obiLhETOxHOj7LZBDvHHAYG6lrbFwH2TA6f_TpuqKCKNZC0EkbPLrQ8sVel1kUl58KlFZF6r2EM6fxsAx56GryYjUxw7wZ4ThMBAV91kGfqhjzJ_sTY8JVacPOXAOE73IBAQXGuTMN65j4O1Xs2CNP7Hw9HB@vmGeVuxXDfqilT7IyKqr1CjBp2k6Y8teoF_Bx6kG0BorLoUfYcdlmoX_jXNbitcX5AgqwHaE-
Hey there, sounds like you need to set the with_operations=True effects decorator:
https://smartpy.tezos.com/manual/data-types/effects.html
📣 We have released a minor upgrade - SmartPy v0.23.1 📣
https://smartpy.tezos.com
This is a bugfix release which includes:
# Documentation
- Corrected the SmartPy documentation example for calling auxillary functions,
- Added SmartPy documentation for sp.to_bytes.
# Bug fixes
- Fixed match/case return type check - assert all cases are unit,
- Fixed frontend contract link share,
- Fixed frontend search bug,
- Fixed frontend origination/explorer page render problem,
- Fixed TZcomet link,
- Fixed import issue for installing when IPython is present.
Please see the release notes (https://smartpy.tezos.com/releases.html) for more details. 🚀🔥🎉
Do you have things you'd want us to do? Are you expecting sapling, global constants or anything else?
Читать полностью…
What about things like global constants, sapling etc? Closer alignment with python meaning brining back some meta programming capabilities? Also i feel compilation testing is quite awkward currently and in general to use it requires quite a bit of boilerplate.
Читать полностью…
Hi, there is no public roadmap. At a high level, our focus for SmartPy will remain on closer alignment with Python, continued improvements to the developer experience, and maintaining alignment with the evolution of Tezos.
Читать полностью…
You're right, do you mind adding this in /Users/timothy/projects/repro-test/.venv/lib/python3.13/site-packages/smartpy/static/ for now? We'll ship a fix latter.
s.verify is already asserting, you don't need an assert. The error is not great, thank you for the report. Just remove the assert
@TheMastroDev I just read the specification.
I don't think it's a good idea to create a contract as close as Solidity I just did or maybe as close as you did.
I think the constructor can perfectly receive things in a better shape so it simplifies everything.
I edited my example. I added reversed around the result of the function, otherwise we return it in the wrong order.
Here is an example on how to implement a zip.
Let me now adapt it to your example.
💡 Ju announces a $30 million AI-focused investment fund.
Backed by listed companies and industrial capital, aiming for real impact, not hype.
Kennethwils Mchrraursobez has been banned! Reason: CAS ban.
Читать полностью…
You're right, that's an error from our simulator. Sorry for that. I'll come back with a fix and a more elegant way of testing that.
Notice that it's only the test system that has a problem, the contracts will behave as expected on-chain.
I don't know if that's clear but setting a contract as the sender doesn't correspond to anything on-chain, that's more a convenient way of writing tests without plumbing the whole.
If you really want to test this way before the fix, you can have add an entrypoint to Wallet that calls MyContract.
im trying to call sp.send and sp.transfer in auxiliary functions and i keep getting __operations__ is not defined.. how to fix this?
Yes I mean I would expect smartpy to support all features of Tezos. Especially since some of them were supported in the past
Читать полностью…
For example provide "if x in y" instead of "if y.contains(x)".
Also being more integrated with Python tools and services.
Also having a simpler interaction with the test scenarios.
There is no plan for metaprogramming.
Hi, wondering if there is there any sort of public roadmap for smartpy? In general just what's next for smartpy
Читать полностью…
hi guys I get conflicts when installing pytezos and smartpy-tezos (0.23.0) but not with tezos-smartpy (0.22). To reproduce:
this works:
python3.13 -m venv .venv && source .venv/bin/activate && pip install tezos-smartpy pytezos > /dev/null && python -c "import smartpy"
python3.13 -m venv .venv && source .venv/bin/activate && pip install smartpy-tezos pytezos > /dev/null && python -c "import smartpy"
Traceback (most recent call last):
File "<string>", line 1, in <module>
import smartpy
File "/Users/timothy/projects/repro-test/.venv/lib/python3.13/site-packages/smartpy/__init__.py", line 47, in <module>
init_runtime()
~~~~~~~~~~~~^^
File "/Users/timothy/projects/repro-test/.venv/lib/python3.13/site-packages/smartpy/platform/runtime.py", line 202, in init_runtime
_init_jupyter_standard()
~~~~~~~~~~~~~~~~~~~~~~^^
File "/Users/timothy/projects/repro-test/.venv/lib/python3.13/site-packages/smartpy/platform/runtime.py", line 164, in _init_jupyter_standard
js_content = get_wheel_file("jupyter-web-components.js")
File "/Users/timothy/projects/repro-test/.venv/lib/python3.13/site-packages/smartpy/internal/utils.py", line 10, in get_wheel_file
with open(file_path, "r") as file:
~~~~^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/Users/timothy/projects/repro-test/.venv/lib/python3.13/site-packages/smartpy/static/jupyter-web-components.js'
Uncaught exception:
End_of_file
Raised at Stdlib.input_line.scan in file "stdlib.ml", line 456, characters 14-31
Called from Oasis_lib__Smartpy_oasis.loop in file "oasis/main/smartpy_oasis.ml", line 8, characters 7-19
Called from Oasis_lib__Smartpy_oasis.Main.main in file "oasis/main/smartpy_oasis.ml", line 16, characters 4-23
Called from Dune__exe__Smartpy_oasis_native in file "oasis/main/smartpy_oasis_native.ml", line 3, characters 8-58
I can't get it to work even with the correct value. not even with this:
Читать полностью…
import smartpy as sp
@sp.module
def dummy_utils():
def dummy_function(param) -> sp.nat:
return sp.nat(1)
@sp.add_test()
def _():
s = sp.test_scenario("simple assert")
assert s.verify(dummy_utils.dummy_function(()) == sp.nat(1))