Questions tagged [timestamp]

Questions related to the timestamp value of a block, or the use of Ethereum in timestamping.

Filter by
Sorted by
Tagged with
0
votes
1answer
36 views

Solidity: Is there any way to store the start time of solidity code? now() function returns block.timestamp only

I wanted to get a start time of solidity code, so I used now() previous which only returns block.timestamp whenever the solidity got started. Is there any way to store or know the start time of ...
0
votes
0answers
14 views

Where is AdjustTime in go-ethereum?

There are references to the go-ethereum simulated back-end to containing an "AdjustTime", e.g., here https://github.com/ethereum/go-ethereum/issues/16655. It doesn't seem to be part of the library ...
2
votes
1answer
24 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
31 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
15 views

How to check state of the contract after some time?

I am writing a contract where I need to check that if in 5 minutes no new token get purchased then the sale should be ended. What I mean exactly is that, lets say user A has purchased 100 tokens and ...
2
votes
3answers
49 views

How to get the actual time of occurrence for ethereum transaction in block

I used the API of Ethereum to download some transactions info. The timestamp is included, however I found the timestamp not mean the transaction time but the block which this transaction is located ...
0
votes
1answer
38 views

Conversion from calendar format into timestamp format

I see a lot of discussion about date and time, timestamp... But they don't answer to my question: How can i convert from calendar format into timestamp format for comparing datetime? e.g: I have this ...
1
vote
1answer
35 views

Are the timestamps of blocks for Ethereum only accepted when they are monotonically increasing?

Are the timestamps of blocks for Ethereum only accepted when they are monotonically increasing? If yes, why? And why other blockchains like Bitcoin and other blockchains with shorter block time can ...
0
votes
0answers
24 views

How to define non-exploitability in the difficulty update algorithm?

In enter link description here, it is said that "We have already determined that our current algorithm is highly suboptimal on low volatility and non-exploitability, and at the very least we plan to ...
1
vote
0answers
40 views

Why creating a block that has slightly higher difficulty can beat out any possible forks?

It is said that "The use of (block_timestamp - parent_timestamp) // 10 (* now 9)as the main input variable rather than the time difference directly serves to maintain the coarse-grained nature of the ...
0
votes
0answers
28 views

How can I use bitcoin block stamp as seed for random number generation?

I am trying to create an ethereum based smart contract that shall generate random number. After searching around, I get to know that ethereum block stamp is vulnerable to miners hacks and false ...
0
votes
1answer
16 views

Can I rely on certain oracle to know the precise and reliable timestamp?

I am learning the security impact of smart contract on system properties like block.timestamp and block.number. I understood that block.timestamp can be controlled by the miner to certain degree and ...
1
vote
2answers
61 views

Understanding ganache timestamps

Sometimes, when I use the ganache specific evm_increaseTime method and advance to the next block, the next timestamp is NOT: current timestamp + advanced time But instead: current timestamp + ...
1
vote
2answers
42 views

Decentralized Time server to get time in Dapps? [closed]

So basically i want to ask that how can we programmatically get the accurate, exact and current time in a DApp, without relying on the system's time or a centralized time server ? Is there a ...
0
votes
1answer
26 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 ...
0
votes
0answers
24 views

Time in blockchain and HTML

I'm trying to get time once data is submitted off-chain, since only way to get on-chain is via now to get the block time. Off-chain I'm using "document.getElementById("demo").innerHTML = Date()" to ...
4
votes
1answer
57 views

Timestamp in Ethereum

I have a smart contract where the user inputs temperature readings, I'd like to add a time stamp to relate those reading with a current time of submission. I understand that in Ethereum we only have ...
0
votes
1answer
29 views

How can I wait if it's not possible in smart contracts? [duplicate]

From my understanding, waiting in a solidity smart contract would create a total disaster for the whole Ethereum's blockchain. I can see in some circumstances that solidity offers block.timestamp ...
2
votes
1answer
35 views

Are block timestamps decentralized?

One thing I don't understand about the Ethereum protocol is how timestamps work. If I, as miner, have a reason to fiddle with timestamps (such as adding a few minutes to decrease the mining difficulty)...
3
votes
1answer
261 views

Is “now” UTC time in Solidity?

The now keyword in Solidity returns a uint256 with the current block timestamp. Is the timestamp in UTC time? (ie. the number of seconds since 1st January 1970)
0
votes
1answer
20 views

Understand the potential issue of miner controlled gaslimit

I am aware that smart contracts running on top of EVM can access certain system properties such as timestamp, block number, and gas limit. I am also aware that such properties can be controlled by ...
0
votes
1answer
49 views

How long does an ether transaction take until verification (and where do I get this data?)

I am wondering if data is stored in the ETH blockchain on the time the transaction got send to the mempool such that I can deduce the time until it got included in a public afterwards (not to be ...
0
votes
0answers
14 views

Transaction added to already mined block

i run a private blockchain and i have realized some strange behaviour there. Concret i started a transaction and save the timestamp, when it has been started. Then i wanted to figure out, how long ...
1
vote
1answer
152 views

How can i implement deadlines in smartContract?

Suppose I am running a gallery and ask participants to submit there paintings before a specific date. After passing that date participant should not be able to submit their entry. How can I implement ...
1
vote
1answer
145 views

Ethereum extract transactions based on timestamp

I am trying to extract all transactions of Ethereum using the eth scan API. But I need transactions for specific time periods only. I tried running the API for all the blocks to try and extract all ...
1
vote
1answer
175 views

Ethereum transactions timestamp

Is it possible to extract individual timestamps of the transactions' execution time in a given block? The Ether-scan API gives only the timestamps of the block collation, doesn't mention anything ...
0
votes
1answer
25 views

Is there any protection in the Ethereum consensus or network protocol to avoid a block being mined with a timestamp 1000 years ahead of UTC time? [duplicate]

Will other nodes refuse the mined block if the timestamp is too far apart from local or UTC timestamp or will they blindely accept the block if the PoW is correct?
0
votes
1answer
22 views

time order when calling functions of smart contract

How can I check that the miner actually execute the right order of smart contracts function calls, if there is a necessity of orders?
1
vote
1answer
162 views

Unable to schedule a call using Aion Recurring Contract

So here's the contract that I deployed on Ropsten Network. I took code refer from here. pragma solidity ^0.4.24; // interface Aion contract Aion { uint256 public serviceFee; function ...
0
votes
2answers
112 views

Can we assume that Ethereum Events (aka Logs) are in-sequence

Lets consider a simple Contract that is to track a variable. A client App needs to access this variable's history to show a graph. I can create an Array inside the Contract, and push() the value ...
0
votes
1answer
67 views

How to allow the owner of a contract to set a deadline in days (and not have it inserted as seconds) in the constructor?

thanks for taking the time to read this. I'm having a bit of trouble handling time in Solidity. I want the owner of a contract to be able to set a deadline in days (which will be used in the rest of ...
0
votes
2answers
104 views

Solidity can't modify block.timestamp due to lvalue xpression

I have a problem regarding modifying block.timestamp. I would like to modify timestamp in my network and change block.timestamp to unix timestamp, but I got an error at modification: TypeError: ...
2
votes
1answer
88 views

How can I increase EVM time in web3.py?

When working with web3.js, Truffle and Ganache, I can do this: web3.currentProvider.send({method: "evm_increaseTime", params: [numOfSeconds]}); How can I do the equivalent in web3.py? When I do: ...
1
vote
2answers
233 views

How to get multiple blocks timestamps with a single JSON RPC call?

Is there a way to get data similar to the ones provided by web3.eth.getBlock(blockNumber) but with multiple blocks at once? The goal is to get the timestamps for 100 blocks in a row without ...
0
votes
1answer
151 views

crypto-signing in a smart contract -> verify the identity of a smart contract

my Question in short is: -> is it possible to digitally sign some data by a smart contract (e.g. with a secret key of the contract) and thus confirm that it was exactly this smart contract, who ...
0
votes
1answer
204 views

How to map multiple time and index value on same address

I wish to map the time to the address key. But currently it is working on the index key only. I just want to map time as well. Means the current time. So that I can able to get the record with time as ...
0
votes
1answer
86 views

I want a function locked for a certain amount of time, what's the safest way to achieve this?

I want a store where someone can become tokenOwner for a certain amount of time. The following solutions seems the easiest: pragma solidity ^0.4.24; import "../node_modules/zeppelin-solidity/...
3
votes
1answer
199 views

Why time values should be used as uint256?

Is there a reason to use the time value as uint256? Is not uint128 enough? UnixTime...
3
votes
1answer
69 views

Setting time requirements in Solidity

I want a function to only be able to be called after a certain specific period of time has passed from the contract's inception. Generally, I was using block.number for that. As in: require(block....
1
vote
1answer
175 views

Receive data in a smart contract

How can a smart contract receive data (strings or int) from an html page? I would like to receive some information that a user con insert in a web page, in order to save them in the blockchain (for ...
2
votes
1answer
324 views

How Can I Convert Between A Solidity Timestamp And Year/Month/Day Hour:Minute:Second?

Solidity provides the uint256 now or block.timestamp Special Variable. How can I convert between this Solidity timestamp and year/month/day hour:minute:second?
2
votes
1answer
3k views

Block time and confirmation time

I have been reading in different papers and comments these two concepts and I would like to know the difference between them(if there is, sometimes it is a bit confusing). I understand that the block ...
1
vote
2answers
286 views

Slackness issue and time in smart contracts

At a high level, slackness issue says, it is not possible to guarantee that at any given point in time all honest miners see exactly the same blockchain length [1]. On the other hand, as we know the ...
0
votes
3answers
145 views

How to allow an account to withdraw from another one?

The goal is to create a contract which allows party B to withdraw from party A's account according to some formula. I don't want to use an escrow model, rather just to: Let A attest that they are ...
0
votes
1answer
16 views

Using unix timestamp and making clients get token

I'm trying to make a function that uses unix timestamp for setting a limited time and after the limited time is over I would like to make clients get their token by themselves Does anyone have any ...
1
vote
2answers
223 views

What does this code return? block.timestamp / 1 days

function today() private view returns (uint256) { return block.timestamp / 1 days; } Why do we need this function?
0
votes
1answer
107 views

converting “now” to “day”?

Consider we need to determine an expiry date for a contract such that after this date the contract will be destroyed as follows: uint256 public expiryDate; constructor(uint256 duration) ...
1
vote
1answer
31 views

How to find the first block after given timepoint in solidity?

function firstBlockAfter (uint timepoint) returns (uint) { // returns the first block number after timepoint } Is there any solution except iterating the latest 256 blocks?
1
vote
1answer
103 views

How to do performance evaluation?

How to do the performance evaluation in terms of secs or minutes? what is the command to use in solidity?
0
votes
1answer
216 views

Keccak256 of msg.sender and timestamp: what's the likelihood of an output coincidence?

Let's think about this code: function publishEtherBox (bytes32 _label, string _ownerUrl, uint _lifespan) external onlyWhenRunning() payable { require(ownerToEtherBoxes[msg.sender].length < ...