Does ERC20Permit work on BSC etc?

It uses ECDSA.sol, which uses hash functions like

    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

Do chains like BSC etc also use this string for the hash value?

Good question, I don't really know but I would assume they do.

This is a standard to avoid making the users sign a message that can be resent as a transaction to the network. The Ethereum ... is just what the EIP states to need as a prefix, and is not a protocol level enforcement.

Almost every EVM compatible chain (as BSC) have Metamask compatibility, which by default signs messages with the same Ethereum Signed Message prefix. So you can assume users interacting with BSC are using the same prefix, thus, the contract function should work the same.

Hope it helps!

1 Like