I have a question:
How to calculate this function for both Ethereum networks mainnet and ropsten getBlockTimestamp().add(delay)?
I installed web3.eth and tried web3.eth.getBlockTimestamp().add(delay) but it did not work. I would appreciate it if you could help me in this.
Hi, welcome!
Do you mean you want to call this function by the web3.js? And I think the function getBlockTimestamp() and the variable delay are in your contract, right? If so, I think you should call like this:
web3.js
getBlockTimestamp()
delay
const yourContract = new web3.eth.Contract(contract_abi, contract_address); const delay = await yourContract.methods.delay(); const blockTimestamp = await yourContract.methods. getBlockTimestamp();
Then add the two numbers together.