Skip to content

RANDOM() isn't random #5

@Oni-giri

Description

@Oni-giri

The built-in RANDOM() function uses a "PRNG seeded on BLID,SCID,TXID".

This does not result in a truly random number, as it's possible to manipulate the seeds to predict it beforehand. Maybe it should be clearer in the docs? It's a very classic door for exploits, and developers inexperienced with smart contracts may not know it.

From my experience on the EVM, I'd prefer removing it and exposing the underlying hash function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions