Unlike the Exchange, we decode and translate the calldata from the external function call to the internal (onlySelf) version, where we can override the taker address, rather than just delegatecalling the raw calldata.
SignatureValidator
We only support EIP712 and eth_sign signatures right now.
And one new fixin:
FixinEIP712
Utilities for generating EIP712 hashes.
Other stuff:
Refactor address immutable _implementation state variable into FixinCommon
Refactor _implementation = address(this) out of feature constructors into FixinCommon.
Add a registerFeatureFunction(selector) function to FixinCommon. This is shorthand for ISimpleFunctionRegistry(address(this)).extend(selector, _implementation).
Tweak the flow of initial migration/bootstrapping slightly.
The ZeroEx contract is now deployed in a separate step and passed into InitialMigration.migrate(), whereas before InitialMigration would deploy that contract itself.
Added tooling to @0x/order-utils, etc., for hashing and signing this new ExchangeProxyMetaTransaction type.
post-merge TODO:
Publish new ganache snapshot.
Update EP spec for updated initial migration/bootstrap process.
Testing instructions
Types of changes
Checklist:
[x] Feature has updated version information.
[x] implements IFeature interface.
[x] Feature contracts are stateless (including inherited contracts).
[x] onlySelf feature functions are prefixed with _.
[x] Feature functions are added to full_migration_tests.
[x] No delegatecalls from inside a feature. Call other features through the router.
[x] No self-destruct in features.
[x] No intentionally persistent (non-atomic) balances on the Exchange Proxy.
[x] No allowances to be set on Exchange Proxy by users.
[x] No direct access to another feature’s storage bucket without strong justification.
[x] No direct access to AllowanceTarget (must go through TokenSpender).
[x] No executing arbitrary calldata from the context of the Exchange Proxy.
[x] Features use unique StorageIds.
[x] Document functions with execution contexts outside of the Exchange Proxy.
[x] Document feature dependencies in checklist doc.
[x] Document reentrant functions in checklist doc.
Description
Introduces two new features:
MetaTransactions
onlySelf
) version, where we can override the taker address, rather than just delegatecalling the raw calldata.SignatureValidator
And one new fixin:
FixinEIP712
Other stuff:
address immutable _implementation
state variable intoFixinCommon
_implementation = address(this)
out of feature constructors intoFixinCommon
.registerFeatureFunction(selector)
function toFixinCommon
. This is shorthand forISimpleFunctionRegistry(address(this)).extend(selector, _implementation)
.ZeroEx
contract is now deployed in a separate step and passed intoInitialMigration.migrate()
, whereas beforeInitialMigration
would deploy that contract itself.@0x/order-utils
, etc., for hashing and signing this newExchangeProxyMetaTransaction
type.post-merge TODO:
Testing instructions
Types of changes
Checklist: