is there a way to get current block # in starknet in a smart contract code?
You have a syscall for getting the current block number. See here.