Questions tagged [time]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

How can I advance time when testing on Rinkeby network?

I've successfully deployed my contract to Rinkeby. Testing on Remix everything worked fine. I'm now writing some tests in Javascript but I don't know how to advance time to test functions in a ...
1
vote
1answer
15 views

Is it better practice to use smaller uint sizes when applicable?

My understanding of uint sizes is that smaller sizes will decrease gas costs. In my current dapp I'm building, I am dealing with time, for which it seems that uint32 will be plenty for my purposes (...
0
votes
0answers
11 views

Fast forwarding time in hardhat testing?

My contract is calling a method on a different contract to track how the response changes. I am unit testing with a forking mainnet network in hardhat, which allows me to interact with that other ...
0
votes
1answer
34 views

Use scheduler in smart contract solidity

I am looking for a way to automate the execution of a function. Here is a very simple example of a function that will change the state of a boolean variable. pragma solidity ^0.8.2; contract Test{ ...
0
votes
1answer
22 views

Execute instructions later

I'm looking to create a function that executes instructions in a time frame. For example I want to call a function that will change my variable in 50 seconds. I have searched but I saw that I need to ...
0
votes
0answers
13 views

How long does it take an experienced developer to deploy a simple auction smart contract with front end?

I'm currently vetting eth devs for a nifty personal platform but I'm not a developerand don't have much of a concept for the complexity for time involved for Solidity development. Ballpark estimates ...
0
votes
0answers
35 views

Managing time increments in Solidity

Say I want to do a simple operation where a value x is automatically doubled after 1 hour. I want the contract to automatically check that it is time to double the value without needing to explicitly ...
0
votes
0answers
28 views

Get hour of day in Solidity?

What is the most simple way to get hour of the day in Solidity? Will this work? for example creating a condition that works only when it's past 17:00 during that day? if(hour > 17) { //yay this is ...
0
votes
1answer
468 views

Is it possible to create a time based nft where there is a fixed expiry date?

I'm looking to create a set where after a set period of time (a week, a month, a year) the token expires and all its value is wiped. Is it possible to do this and if so how?
0
votes
1answer
27 views

I need to understand a line of code inside a contract => startTime: _startTime == 0 ? currentTime() : _startTime

I am reading a contract from this location : https://gist.github.com/rstormsf/7cfb0c6b7a835c0c67b4a394b4fd9383 I am not able to understand the logic in the code line 72 startTime: _startTime == 0 ? ...
0
votes
0answers
13 views

How critical is timing to the Proof of Stake system?

I’m imagining that in the future it may be profitable for attackers to try to undermine consensus using novel means that are yet unanticipated. So I would like to contribute to speculation on possible ...
0
votes
0answers
20 views

JIT events on ethereum

I would like to write a contract, that fetches data from the oracle at a specific point of time (or later) Is there any option to pop up an event at some point in the future in the Ethereum contract? ...
0
votes
0answers
17 views

How does time work in a smart contract? [duplicate]

I have seen this question and answers but they do not answer my question. Let say I want to create a smart contract that releases ether when a certain time reaches. How does the blockchain know that ...
1
vote
1answer
253 views

Can block.timestamp value change during execution?

I'm facing a doubt while developing an Smart Contract. I was getting current date from block.timestamp several times inside a function. Could this value change during an Smart Contract execution? Or ...
0
votes
2answers
1k views

how estimate average time for transactions to smart contract

I have created a decentralized application on the Ethereum Blockchain network. This application receives data from different addresses on the blockchain network and saves this data in the blockchain ...
21
votes
5answers
9k views

Time-dependent tests with Hardhat?

For Ganache, there are several solutions. What about Hardhat? They implemented their own local blockchain, Hardhat Network, which is different to Ganache.
1
vote
1answer
58 views

Why does Solidity not use the years keyword?

Solidity has keywords like seconds, minutes, hours, days and weeks that are used to specify units of time. Why do they not have years?
3
votes
1answer
456 views

Can the block number be set back in ganache?

I know about tools like ganache-time-traveler that let you advance the block number. But is it possible to go back to a lower value?
0
votes
1answer
61 views

What are some practical considerations for leap seconds?

From the solidity docs on time units: Take care if you perform calendar calculations using these units, because not every year equals 365 days and not even every day has 24 hours because of leap ...
0
votes
1answer
630 views

How do I add 7 years to a current time expressed as a block.timestamp?

Being new to solidity, I find the docs on the Internet very confusing. I simply want to add 7 years to a uint timeInSevenYearsFromNow = (block.timestamp).add(????); What is the value of ???? and ...
2
votes
1answer
1k views

Is there any library to estimate timestamp of future block?

I am in need of a library that estimates a date or some sort of timestamp when fed with a future block number (on mainnet or any major testnet). For instance, https://etherscan.io/block/countdown/...
3
votes
1answer
605 views

In truffle5, how to manipulate time with evm_increaseTime?

I am using truffle 5 and ganache-cli. I've imported increaseTime as import increaseTime from './helper/increaseTime'; and the increaseTime.js file is like this export default function increaseTime(...