Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- contract Exchange is Owned {
- function depositToken(address token, address target, uint256 amount) public returns (bool) {
- if (target == 0x0) target = msg.sender;
- require(acceptDeposit(token, target, amount));
- require(Token(token).transferFrom(msg.sender, this, amount));
- return true;
- }
- function deposit(address target) public payable returns (bool) {
- if (target == 0x0) target = msg.sender;
- require(acceptDeposit(0x0, target, msg.value));
- return true;
- }
- function trade(uint256[8] tradeValues, address[4] tradeAddresses, uint8[2] v, bytes32[4] rs) public onlyAdmin returns (bool) {
- /* amount is in amountBuy terms */
- /* tradeValues
- [0] amountBuy
- [1] amountSell
- [2] expires
- [3] nonce
- [4] amount
- [5] tradeNonce
- [6] feeMake
- [7] feeTake
- tradeAddressses
- [0] tokenBuy
- [1] tokenSell
- [2] maker
- [3] taker
- */
- ...
- bytes32 orderHash = keccak256(this, tradeAddresses[0], tradeValues[0], tradeAddresses[1], tradeValues[1], tradeValues[2], tradeValues[3], tradeAddresses[2]);
- bytes32 tradeHash = keccak256(orderHash, tradeValues[4], tradeAddresses[3], tradeValues[5]);
- ...
- }
- }
Add Comment
Please, Sign In to add comment