Skip to main content

UniswapV2Ward

UniswapV2Ward

Handles the all ZeroExExchange trades for the primary contract

Methods

owner

function owner() external view returns (address)

Returns the address of the current owner.

Returns

NameTypeDescription
_0addressundefined

performOrder

function performOrder(bytes genericPayload, uint256 availableToSpend, uint256 targetAmount) external payable returns (uint256 amountSpentOnOrder, uint256 amountReceivedFromOrder)

Fills the input order.

Parameters

NameTypeDescription
genericPayloadbytesEncoded data for this order. This is specific to exchange and is done by encoding a per-exchange struct
availableToSpenduint256The amount of assets that are available for the ward to spend.
targetAmountuint256The target for amount of assets to spend - it may spend less than this and return the change.

Returns

NameTypeDescription
amountSpentOnOrderuint256The amount of source asset spent on this order.
amountReceivedFromOrderuint256The amount of destination asset received from this order.

renounceOwnership

function renounceOwnership() external nonpayable

Leaves the contract without owner. It will not be possible to call onlyOwner functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

transferOwnership

function transferOwnership(address newOwner) external nonpayable

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

Parameters

NameTypeDescription
newOwneraddressundefined

withdrawETH

function withdrawETH(uint256 _amount) external nonpayable

Withdraw ether contained in this contract and send it back to owner

onlyOwner modifier only allows the contract owner to run the code

Parameters

NameTypeDescription
_amountuint256The amount of ether that the caller wants to withdraw

withdrawToken

function withdrawToken(address _token, uint256 _amount) external nonpayable

Withdraw ether contained in this contract and send it back to owner

onlyOwner modifier only allows the contract owner to run the code

Parameters

NameTypeDescription
_tokenaddressThe address of the token that the user wants to withdraw
_amountuint256The amount of tokens that the caller wants to withdraw

Events

OwnershipTransferred

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters

NameTypeDescription
previousOwner indexedaddressundefined
newOwner indexedaddressundefined