This PR makes it possible to sign orders with personal_sign and have them validate (i.e. keccak256("\x19Ethereum Signed Message:\n32ORDER_HASH_HERE")). When calling a function that takes signatures, one has to signal personal_sign was used by appending the byte 0x03 to the signature. It mimics the way 0xProtocol does it. However, if the extra byte is absent, validateOrderAuthorization() assumes EIP712/sign_typed_data was used. (Which is unlike 0xProtocol, as it requires the extra byte at the end.) The choice was made to ensure backwards compatibility. The personal_sign prefix can be set via the constructor of the WyvernExchange contract, so that it can be easily deployed on EVM-compatible chains that have a different prefix (like Klaytn). The prefix defaults to "\x19Ethereum Signed Message:\n".
Tests have been added/updated where needed.
There are also some miscellaneous fixes, and the StaticMarket contract now no longer inherits from StaticUtil nor depends on the atomicizer.
This PR makes it possible to sign orders with
personal_sign
and have them validate (i.e.keccak256("\x19Ethereum Signed Message:\n32ORDER_HASH_HERE")
). When calling a function that takes signatures, one has to signalpersonal_sign
was used by appending the byte0x03
to the signature. It mimics the way 0xProtocol does it. However, if the extra byte is absent,validateOrderAuthorization()
assumes EIP712/sign_typed_data
was used. (Which is unlike 0xProtocol, as it requires the extra byte at the end.) The choice was made to ensure backwards compatibility. Thepersonal_sign
prefix can be set via the constructor of the WyvernExchange contract, so that it can be easily deployed on EVM-compatible chains that have a different prefix (like Klaytn). The prefix defaults to"\x19Ethereum Signed Message:\n"
.Tests have been added/updated where needed.
There are also some miscellaneous fixes, and the StaticMarket contract now no longer inherits from StaticUtil nor depends on the atomicizer.