Wrapper is a shim over the Swap contract. The Swap contract only supports tokens, so for ether (ETH) to be used it must first be wrapped into WETH. Orders can be submitted to the Wrapper, which deals with the wrapping and unwrapping of ETH, as well as passing the Order onwards to the Swap contract. Swaps through the wrapper cannot be performed with authorized senders or blank signatures (See Swap for more detail on these cases). View the code on GitHub.
Create a new
constructor(address wrapperSwapContract,address wrapperWethContract) public
Address of the Swap contract to settle trades.
Address of the wrapped ether (WETH) contract to use.
Performs wrapping and unwrapping if necessary and passes the Order onwards to the Swap contract using `wrapperSwapContract.swap().
function swap(Types.Order calldata order) external payable
Order struct as specified in Types.
✓ signerWallet must approve the Swap contract to transfer the signerToken.
✓ senderWallet must approve the Swap contract to transfer the senderToken.
✓ senderWallet must approve the Wrapper contract to transfer WETH.
✓ senderWallet must authorize the Wrapper contract on the Swap contract.
Order has been sent by an account that is not the order's
The signature field is blank. This is not allowed on the Wrapper.
No ETH was provided for an order that was expecting ETH to wrap.
ETH was provided for an order that was not expecting ETH to wrap.
Transferring ETH to recipient wallet failed.
ETH was sent to the contract directly. This contract can only receive ETH from the WETH contract.