Cyfrin / solidity-by-example.github.io

Solidity By Example
https://solidity-by-example.org/
MIT License
605 stars 191 forks source link

Update UserDefinedValueTypes.sol #278

Open panditdhamdhere opened 3 days ago

panditdhamdhere commented 3 days ago

In User Define Types Contract this should be external view otherwise it is giving warning. This updated

 function example_no_uvdt() external {
        // Without UDVT
        uint128 clock;
        uint64 d = 1;
        uint64 t = uint64(block.timestamp);
        clock = LibClockBasic.wrap(d, t);
        // Oops! wrong order of inputs but still compiles
        clock = LibClockBasic.wrap(t, d);
    }