Skip to content

[Bug] There is a bug in MetadataRenderer.sol in the _generateSeed function #129

@spennyp

Description

@spennyp

There is a bug in MetadataRenderer.sol in the _generateSeed function which impacts psuedo-randomness:

return uint256(keccak256(abi.encode(_tokenId, blockhash(block.number), block.coinbase, block.timestamp)));

blockhash(block.number) will always return0x0000000000000000000000000000000000000000000000000000000000000000, since the hash of the current block cannot be known when the transaction is being executed.

Instead, blockhash(block.number - 1) should be used.

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