So I am currently implementing a Hash-Time-Lock using a given Interface for my contract.
The interface requires to give a duration as a uint(256) but then wants the produced deadline (duration + block.timestamp) to be a uint32.
This made me wonder why it is so easy to cast a uint into a uint32 in Solidity. Coming from Rust where it is a big No-Go to cast say a usize to a u16 (in fact not possible unless you use unsafe code), I was thinking if Solidity had any inbuilt checks for these things. After all its a big security risk, as far as I understand. E.g. in a Hashtimelock contract by inputing a duration that (in combination with the timestamp of the block) that would be downcast to unwanted.
Also I could not find anything about the (un-)safety of downcasting in Solidity anywhere on the Internet. Thanks in advance!