-
Notifications
You must be signed in to change notification settings - Fork 3
Exchange
Mike edited this page Jan 9, 2019
·
3 revisions
deposit ETH to the exchange.
Sending funds to the contract, funds are recorded for the sender of the transaction
function() public payable
withdrawal ETH from the exchange
withdraw(
uint amount) // amount for withdrawal
deposit tokens to the exchange (for ERC20)
depositToken(
address token, // address of the token to enter the exchange
uint amount) // amount of tokens to enter the exchange
deposit tokens to the exchange (for ERC223)
tokenFallback(
address owner, // owner token
uint256 amount, // amount of tokens to enter the exchange
bytes data) // payload
withdrawal tokens from the exchange
withdrawToken(
address token, // address of tokens for withdrawal from the exchange
uint amount) // amount of tokens for withdrawal from the exchange
current balance of tokens on the exchange(address for ETH 0x0000000000000000000000000000000000000000)
balanceOf(
address token, // address of tokens
address user) // address user
the function allows you to make an exchange, checking all balances and additional parameters
trade(
address tokenBuy, // address of the token you want to buy
uint amountBuy, // amount of the token you want to buy
address tokenSell, // address of the token you want to sell
uint amountSell, // amount of the token you want to sell
uint expires, // the lifetime of the order to which the order is considered valid
uint nonce, // a number that you can include in your order to make it relatively unique
address user, // address of the user who made the order
uint8 v, // recovery
bytes32 r, // the normal output of an ECDSA signature
bytes32 s, // the normal output of an ECDSA signature
uint amount // amount is in tokenBuy terms
)
placing an order using a smart contract
order(
address tokenBuy, // address of the token you want to buy
uint amountBuy, // amount of the token you want to buy
address tokenSell, // address of the token you want to sell
uint amountSell, // amount of the token you want to sell
uint expires, // the lifetime of the order to which the order is considered valid
uint nonce // a number that you can include in your order to make it relatively unique
)
cancel an order using a smart contract
cancelOrder(
address tokenBuy, // address of the token you want to buy
uint amountBuy, // amount of the token you want to buy
address tokenSell, // address of the token you want to sell
uint amountSell, // amount of the token you want to sell
uint expires, // the lifetime of the order to which the order is considered valid
uint nonce // a number that you can include in your order to make it relatively unique
uint8 v, // recovery
bytes32 r, // the normal output of an ECDSA signature
bytes32 s, // the normal output of an ECDSA signature
)