pscott
pscott
regarding `_uint_to_felt`: uint256 lib provides a [`uint256_check`](https://github.com/starkware-libs/cairo-lang/blob/2abd303e1808612b724bc1412b2b5babd04bb4e7/src/starkware/cairo/common/uint256.cairo#L20-L26). I *think* simply checking for `value.high` is not enough, because what happens if `value.low > 2**128` ?
@Th0rgal the way I understand it is: - A `felt` can be up to 2^251 bits (size of `P`). - A `uint256` can be up to 2^256 - The `Uint256`...
I don't think I follow here: 1. Take the number 2^129 2. If we store it using a `Uin256` struct then we will do two storage writes (`.low` and `.high`)...
Yes but from what I understand, for any number bigger or equal to `2^129`, the second element (`.high`) will get updated. Since a `felt` is `2^251`, it is indeed possible...
> Yes, correct. So then this whole optimization becomes moot if the use case never gets above 2^129. So it's not worth the low-level change at that point, because the...
@ilyalesokhin-starkware thanks for having a look at this! Here's a minimal working (failing) example. I'm trying to compile it with `0.8.2.1` and it's giving me the error I mentioned in...
Interesting... I'm using `0.1.0` of `openzeppelin-cairo-contracts` dependency. Are you running this version too? (installed via `pip3 install openzeppelin-cairo-contracts`) I have not added any `__execute__` entrypoint. Maybe someone else can reproduce?
Also it should be noted that I'm using the [`starknet hardhat plugin`](https://github.com/Shard-Labs/starknet-hardhat-plugin) and running `npx hardhat starknet-compile` in order to compile.
All right so I guess problem solved! So I guess you testing with a local clone of the OZ repo? @martriay @andrew-fleming do you think OZ could issue a `0.1.1`...
Yes I believe everything should fit in this PR. WIP!