Quantcast
Channel: How can a Solana Rust smart contract get block height or Unix time? - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 5

How can a Solana Rust smart contract get block height or Unix time?

$
0
0

I know how to pass the current Unix time from the frontend:

web3.js:

anchor.web3.SYSVAR_CLOCK_PUBKEY

Rust:

let current_time = ctx.accounts.clock.unix_timestamp;

I do not want that. I need the smart contract itself to get the current time.


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images