Reputation: 1386
Ho do I access storages or constants in a substrate chain from !ink smart contract? For example, in the chain, the timestamp(in Moment) is set as an extrinsic. How do I access the timestamp and put the variable in the smart contract?
let timestamp_now: u128: <access to chain when function is being called>
Upvotes: 1
Views: 322
Reputation: 461
You can check https://paritytech.github.io/ink/ink_env/ Which provides functions as block_number
and block_timestamp
ink! documentation in https://github.com/paritytech/ink#table-of-contents
Upvotes: 2