NEWTON
Asked
4 months ago
52
views
0
This question has a bounty of $0.00 in testnet ETH. Answers to this question are eligible to win that bounty.
These are testnet contracts. Not real ETH.
$0.00
What is the maximum value a uint
can store?
I need to understand a couple of things:
a felt
and uint
can store?This question is participating in Newton Bounties | Incentivized Test Program Every verified valid question gets $10 USDC (mainnet)
Newton
asked
4 months ago
0
Accepted answer
Hi,
I'm not sure to what uint
is referring to. If you're referring to uint256
, the "base" type of Solidity, then no, felt
and uint256
are not equivalent.
A felt
corresponds to the size of the field on StarkNet, which is 2^251 + 17 * 2^192 + 1. You need to subtract 1
to this number to get biggest number that fits in a felt (since you need to account for the 0
number).
A uint256
is 256 bits, i.e the biggest number that will fit in it will be 2^256 - 1
(again, subtracting 1 because of 0).
So to answer:
uint256_max > felt_max
0x5EF2...46c5dd
answered
4 months ago
How do you optimize gas in Cairo with Uint256/felt?
How to use Kakarot for my Solidity Contracts?
Cairo error "Expected expression of type 'starkware.cairo.common.uint256.Uint256' to have an address."
Cairo Error: 'range_check_ptr' cannot be used as an implicit return value. Consider using a 'with' statement.
Cairo: How to reassign Uint256 in a conditional
Is uint256 math operators like uint256_le safe? Why do I need to use uint256_check?
Fixed Point pow operation error
Does Account Abstraction (StarkNet) support bundling multiple operations at once?
How can I send a Uint256 amount of ERC20 tokens from L1 to starknet? And how should I build my payload for "sendMessageToL2" to match the Uint256 format of Cairo?
Cairo: How to return true from a function?
Why there is no fee for deploying an account contract (creating account)?
How do I transform data from javascript to Cairo?
How to use await in StarkNet.py?
Does anybody have an idea what is `get_caller_address` returning on an L1 handler call?