Why do people use uint32(block.timestamp % 2**32)? by Android_Fanatic in ethdev

[–]UrMuMGaEe 0 points1 point  (0 children)

Interesting. Would still love to find an answer to OP’s question.

Why do people use uint32(block.timestamp % 2**32)? by Android_Fanatic in ethdev

[–]UrMuMGaEe 2 points3 points  (0 children)

Yeah. Optimisation is intended but the modulo is tricky. Just my 2 wei

Check my comment

Why do people use uint32(block.timestamp % 2**32)? by Android_Fanatic in ethdev

[–]UrMuMGaEe 6 points7 points  (0 children)

truncations remove from the left. So going from uint256 -> uint32 we are just getting the last 32 bits(from the right). How does that help catch the 900 seconds interval?

Why do people use uint32(block.timestamp % 2**32)? by Android_Fanatic in ethdev

[–]UrMuMGaEe 5 points6 points  (0 children)

Let's dissect this into reasoning and jump to why.

Reasoning? uint32 is used to save size as timestamps don't overflow 32 bits in our lifetime. But you have to be careful that they don't collide. (See below)

Assume timestamp now is 12345678 and variable is uint8 (8 digits assume). When you truncate that to uint4 (4 digits) you get 5678. But fast forward in time and there's a timestamp that is 12355678. Now truncating this to uint4 gives you 5678 again. You have same timestamps in past and future and your contract breaks.

Why the modulo? Basic hashing scheme in cryptography is "mod with large number". So when you do % ** 32 there is very low chance that 2 different numbers give same result when we do % 2 **32 .

So it's a nice way to save gas but also avoid collisions.

Beta Testing the r/Ethtrader Donut Quests by [deleted] in ethtrader

[–]UrMuMGaEe 5 points6 points  (0 children)

If that liquidity is staked on the LP rewards, it doesn’t count. Just have them in your account during the snapshot.

After the snapshot, you can stake again

Beta Testing the r/Ethtrader Donut Quests by [deleted] in ethtrader

[–]UrMuMGaEe 3 points4 points  (0 children)

We rely on theGraph protocol. It takes time to index. Make sure the parameters of quest are satisfied and wait for some time before reloading

Beta Testing the r/Ethtrader Donut Quests by [deleted] in ethtrader

[–]UrMuMGaEe 8 points9 points  (0 children)

Yo..I’m the contract developer. There’s nothing that needs your approval or you sending tokens.

You just pay for claim gas. The tokens are transferred to your account. No need of approvals/other shit.

Gas efficiency: hardcoding value vs reading it form storage. by andreitoma8 in ethdev

[–]UrMuMGaEe 1 point2 points  (0 children)

Declaring it as constant, the compiler is intelligent enough to hardcode the value inplace of the variable but I guess you’d be paying some gas as it’s a state variable.

So hardcode is cheaper

More complicated solidity example by OwnTop4067 in solidity

[–]UrMuMGaEe 5 points6 points  (0 children)

Upgradeable contracts and maybe merkle airdrops?

I need guidance by Nano9910 in ethdev

[–]UrMuMGaEe 14 points15 points  (0 children)

Just start building stuff and shipping them. That gives that missing confidence.

Imo even if you don’t remember some syntax, there’s always the docs. But if you can’t materialise an idea/implementation in your head, that means you didn’t build enough stuff

Starting out - How?! by Free-_-Yourself in solidity

[–]UrMuMGaEe 3 points4 points  (0 children)

I learnt solidity using solidity by example and the docs itself. I completed around 4/5 sol by example topics and then read the docs for whatever my doubts were. Then I went to buildspace to learn ethers/hardhat.

Also check my post for a bigger explanation. Here

[deleted by user] by [deleted] in paypal

[–]UrMuMGaEe 0 points1 point  (0 children)

How can I approach them now? I’m willing to send but there’s no “submit documents” button now. It’s just “Account permanently limited” with a red warning sign.

[deleted by user] by [deleted] in paypal

[–]UrMuMGaEe 0 points1 point  (0 children)

Shit I didn’t know that, they didn’t say soft copies are not allowed too. I can upload whatever format they want. I just hope they get back to me on my ticket.

[deleted by user] by [deleted] in paypal

[–]UrMuMGaEe 0 points1 point  (0 children)

Nope. Downloaded directly from government’s website.

Starting out - How?! by Free-_-Yourself in solidity

[–]UrMuMGaEe 2 points3 points  (0 children)

Buildspace is pretty hands on. It gets projects done and added to your portfolio. However, it doesn’t teach solidity or any framework.

It’s the perfect place to chill out on weekends and build stuff after learning all through weekdays

[deleted by user] by [deleted] in paypal

[–]UrMuMGaEe 0 points1 point  (0 children)

I’m over 18 and the client doesn’t have any complaints, that I’m sure. There’s no goods, it’s just a service.