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
0answers
16 views

How can I call TX Timestamp info via Web3.JS

How can I call the timestamp information of the pending tx datas I tried everything I could not.?
1
vote
1answer
11 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 ...
1
vote
1answer
68 views

Ethereum block timestamp

Is the timestamp of a block referring to the time that block is created or when it's mined by a miner? Suppose I subscribe to new incoming blocks using the following NodeJS code (with web3): web3.eth....
0
votes
1answer
18 views

Time-dependent test unexpected behavior at 1st attempt, expected behavior at 2nd attempt

I'm trying to test a contract in which functions should require certain timestamps. Parts of code are eliminated for readability: Here's the problematic part of the contract : PCE_Contract.sol pragma ...
0
votes
2answers
89 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 ...
1
vote
1answer
30 views

best way to get transaction timestamps?

I'm building an analytics app that tracks transactions on Ethereum and wondering how to get the most accurate timestamp for each transaction. Using the web3.js library I'm able to see the following ...
0
votes
0answers
31 views

auto call function after specific time limit [duplicate]

I want to run a solidity function in my contract to automatically call/execute after 21 days. How can I do that? I am not able to find any specific resource to execute this thing. It would be awesome ...
0
votes
1answer
46 views

What is the proper way to store timestamp in blockchain?

I am trying to store the timestamp in the blockchain using block.timestamp or now. But that keeps throwing warning as Use of "block.timestamp": "block.timestamp" can be influenced ...
1
vote
1answer
28 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?
0
votes
0answers
27 views

How does Etherscan compute mining times?

Etherscan identifies the miner that mined a block and the corresponding mining time. How does Etherscan compute the mining time? It seems that the mining time of a block is not the difference between ...
0
votes
1answer
149 views

How could I measure the total delay (time) to confirm the transaction?

First of all, I'm new to the Erthereum world, I need some help in measuring the total delay (time) require for confirming the transaction. I have a decentralized application over a Rinkeby network, ...
2
votes
1answer
47 views

How to Calculate How Long an Address Has Held A Token? (for paying interest/rewards)

I'm writing a smart contract function that rewards users some rate of interest/reward for holding my stablecoin over owning competitors (Dai, Tether, etc). What is the most efficient manner to ...
0
votes
2answers
102 views

Unit testing time sensitive Provable smart contracts

I'm currently using Provable (formerly Oraclize) to make a CRON job : constructor() public payable { OAR = OracleAddrResolverI(0x6F486C8BD6fc43eA212E93CCF8ce047C7f1Cb475); provable_query(7 ...
0
votes
1answer
109 views

How to get block size and block mining time while using ganache and truffle

I am using truffle framework and Ganache (GUI) as emulator. I want to know the size of the generated block. Also I want to know the time required to mine/generate/create a block after the command. I ...
0
votes
1answer
19 views

Block.timestamp returning multiple values

I have a function inside my smart contract that fetches the timestamp of the block it's in: function getTime() public returns (uint256 time){ return block.timestamp;; } According to how I ...
0
votes
1answer
38 views

Gas Estimation Failed error when scheduling Aion call

I am trying to understand the Aion scheduling system, so I tried their code example from here. Below is the code snippet: pragma solidity ^0.4.24; // interface Aion contract Aion { uint256 ...
0
votes
0answers
14 views

Do something when epoch time is [duplicate]

This is my struct where I have: timeBeforeRenew. The idea is that, if a customer does not deposit x amount of token before the time expires, his address then automatically sends all the tokens ...
0
votes
1answer
69 views

In web3, how can I fetch a range of block timestamps most efficiently?

Given a range of block numbers, how can I most efficiently fetch the timestamps for those blocks? I couldn't find a simple call to fetch the timestamp at a certain height other than fetching the full ...
0
votes
1answer
244 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 ...
3
votes
1answer
104 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
36 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
24 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
75 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
53 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 ...
2
votes
1answer
98 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
27 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
43 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
34 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
31 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 ...
2
votes
2answers
321 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
61 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
104 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 ...
4
votes
1answer
163 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
52 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
51 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
352 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
26 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
228 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 ...
1
vote
1answer
264 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
260 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
295 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
31 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
34 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
192 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 ...
1
vote
2answers
247 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
124 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
152 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
152 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
392 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
368 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 ...