More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 34 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Swap | 6479525 | 2228 days ago | IN | 0.01 ETH | 0.00359539 | ||||
Swap | 6479519 | 2228 days ago | IN | 2.95 ETH | 0.00359676 | ||||
Swap | 6479154 | 2228 days ago | IN | 0.52 ETH | 0.00359676 | ||||
Swap | 6479096 | 2228 days ago | IN | 1.29 ETH | 0.00359445 | ||||
Swap | 6479048 | 2228 days ago | IN | 1.6 ETH | 0.00359791 | ||||
Swap | 6478882 | 2228 days ago | IN | 0.86 ETH | 0.00386791 | ||||
Swap | 6477423 | 2228 days ago | IN | 0.11 ETH | 0.00333063 | ||||
Swap | 6473964 | 2229 days ago | IN | 0.001 ETH | 0.00459558 | ||||
Swap | 6433923 | 2235 days ago | IN | 0.3 ETH | 0.00582335 | ||||
Swap | 6421008 | 2237 days ago | IN | 0.12 ETH | 0.00517699 | ||||
Swap | 6417746 | 2238 days ago | IN | 0.8 ETH | 0.00537687 | ||||
Swap | 6402658 | 2240 days ago | IN | 0.26741 ETH | 0.00361979 | ||||
Swap | 6393091 | 2242 days ago | IN | 0.003159 ETH | 0.00389087 | ||||
Swap | 6392451 | 2242 days ago | IN | 0.03147 ETH | 0.00400477 | ||||
Swap | 6389842 | 2243 days ago | IN | 0.02234232 ETH | 0.00145813 | ||||
Swap | 6388463 | 2243 days ago | IN | 0.001 ETH | 0.00401742 | ||||
Swap | 6387665 | 2243 days ago | IN | 0.29 ETH | 0.00407632 | ||||
Swap | 6387563 | 2243 days ago | IN | 0.79 ETH | 0.00407632 | ||||
Swap | 6377073 | 2245 days ago | IN | 0.00842679 ETH | 0.00425591 | ||||
Swap | 6376792 | 2245 days ago | IN | 4.05 ETH | 0.00434065 | ||||
Swap | 6374692 | 2245 days ago | IN | 0.484 ETH | 0.0044146 | ||||
Swap | 6373931 | 2245 days ago | IN | 0.0488 ETH | 0.00455257 | ||||
Swap | 6345368 | 2250 days ago | IN | 0.00010611 ETH | 0.00361536 | ||||
Swap | 6329977 | 2252 days ago | IN | 0.01 ETH | 0.00309681 | ||||
Swap | 6328638 | 2253 days ago | IN | 0.01 ETH | 0.0033996 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
6479525 | 2228 days ago | 0.01 ETH | ||||
6479519 | 2228 days ago | 2.95 ETH | ||||
6479154 | 2228 days ago | 0.52 ETH | ||||
6479096 | 2228 days ago | 1.29 ETH | ||||
6479048 | 2228 days ago | 1.6 ETH | ||||
6478882 | 2228 days ago | 0.86 ETH | ||||
6477423 | 2228 days ago | 0.11 ETH | ||||
6473964 | 2229 days ago | 0.001 ETH | ||||
6433923 | 2235 days ago | 0.3 ETH | ||||
6421008 | 2237 days ago | 0.12 ETH | ||||
6417746 | 2238 days ago | 0.8 ETH | ||||
6402658 | 2240 days ago | 0.26741 ETH | ||||
6393091 | 2242 days ago | 0.003159 ETH | ||||
6392451 | 2242 days ago | 0.03147 ETH | ||||
6389842 | 2243 days ago | 0.02234232 ETH | ||||
6388463 | 2243 days ago | 0.001 ETH | ||||
6387665 | 2243 days ago | 0.29 ETH | ||||
6387563 | 2243 days ago | 0.79 ETH | ||||
6377073 | 2245 days ago | 0.00842679 ETH | ||||
6376792 | 2245 days ago | 4.05 ETH | ||||
6374692 | 2245 days ago | 0.484 ETH | ||||
6373931 | 2245 days ago | 0.0488 ETH | ||||
6345368 | 2250 days ago | 0.00010611 ETH | ||||
6329977 | 2252 days ago | 0.01 ETH | ||||
6328638 | 2253 days ago | 0.01 ETH |
Loading...
Loading
Contract Name:
HydroSwap
Compiler Version
v0.4.24+commit.e67f0147
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2018-09-07 */ /* Copyright 2018 HydroProtocol. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.24; contract ERC20 { function transfer(address to, uint tokens) public; function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); } contract Exchange { function fillOrder(address[5], uint[6], uint, bool, uint8, bytes32, bytes32) public returns (uint); } contract WETH { function deposit() public payable; function withdraw(uint) public; } contract HydroSwap { address exchangeAddress; address tokenProxyAddress; address wethAddress; uint256 constant MAX_UINT = 2 ** 256 - 1; event LogSwapSuccess(bytes32 indexed id); constructor(address _exchangeAddress, address _tokenProxyAddress, address _wethAddress) public { exchangeAddress = _exchangeAddress; tokenProxyAddress = _tokenProxyAddress; wethAddress = _wethAddress; } function swap( bytes32 id, address[5] orderAddresses, uint[6] orderValues, uint8 v, bytes32 r, bytes32 s) external payable returns (uint256 takerTokenFilledAmount) { address makerTokenAddress = orderAddresses[2]; address takerTokenAddress = orderAddresses[3]; uint makerTokenAmount = orderValues[0]; uint takerTokenAmount = orderValues[1]; if (takerTokenAddress == wethAddress) { require(takerTokenAmount == msg.value, "WRONG_ETH_AMOUNT"); WETH(wethAddress).deposit.value(takerTokenAmount)(); } else { require(ERC20(takerTokenAddress).transferFrom(msg.sender, this, takerTokenAmount), "TOKEN_TRANSFER_FROM_ERROR"); } require(ERC20(takerTokenAddress).approve(tokenProxyAddress, takerTokenAmount), "TOKEN_APPROVE_ERROR"); require( Exchange(exchangeAddress).fillOrder(orderAddresses, orderValues, takerTokenAmount, true, v, r, s) == takerTokenAmount, "FILL_ORDER_ERROR" ); if (makerTokenAddress == wethAddress) { WETH(wethAddress).withdraw(makerTokenAmount); msg.sender.transfer(makerTokenAmount); } else { ERC20(makerTokenAddress).transfer(msg.sender, makerTokenAmount); } emit LogSwapSuccess(id); return takerTokenAmount; } // Need payable fallback function to accept the WETH withdraw funds. function() public payable {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":false,"inputs":[{"name":"id","type":"bytes32"},{"name":"orderAddresses","type":"address[5]"},{"name":"orderValues","type":"uint256[6]"},{"name":"v","type":"uint8"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"}],"name":"swap","outputs":[{"name":"takerTokenFilledAmount","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"inputs":[{"name":"_exchangeAddress","type":"address"},{"name":"_tokenProxyAddress","type":"address"},{"name":"_wethAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"bytes32"}],"name":"LogSwapSuccess","type":"event"}]
Contract Creation Code
608060405234801561001057600080fd5b506040516060806106c483398101604090815281516020830151919092015160008054600160a060020a0319908116600160a060020a0395861617825560018054821694861694909417909355600280549093169390911692909217905561064690819061007e90396000f3006080604052600436106100405763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166362c1f3898114610042575b005b610060600435602460c460ff61018435166101a4356101c435610072565b60408051918252519081900360200190f35b600254600090600160a060020a036040880135811691606089013582169188359160208a01359116831415610182573481146100f8576040805160e560020a62461bcd02815260206004820152601060248201527f57524f4e475f4554485f414d4f554e5400000000000000000000000000000000604482015290519081900360640190fd5b600260009054906101000a9004600160a060020a0316600160a060020a031663d0e30db0826040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016000604051808303818588803b15801561016457600080fd5b505af1158015610178573d6000803e3d6000fd5b5050505050610272565b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018390529051600160a060020a038516916323b872dd9160648083019260209291908290030181600087803b1580156101f057600080fd5b505af1158015610204573d6000803e3d6000fd5b505050506040513d602081101561021a57600080fd5b50511515610272576040805160e560020a62461bcd02815260206004820152601960248201527f544f4b454e5f5452414e534645525f46524f4d5f4552524f5200000000000000604482015290519081900360640190fd5b600154604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519185169163095ea7b3916044808201926020929091908290030181600087803b1580156102e157600080fd5b505af11580156102f5573d6000803e3d6000fd5b505050506040513d602081101561030b57600080fd5b50511515610363576040805160e560020a62461bcd02815260206004820152601360248201527f544f4b454e5f415050524f56455f4552524f5200000000000000000000000000604482015290519081900360640190fd5b6000546040517fbc61394a0000000000000000000000000000000000000000000000000000000081528291600160a060020a03169063bc61394a908d908d9085906001908f908f908f90600401808860a08082843790910190508760c080828437909101968752505092151560208086019190915260ff90921660408086019190915260608501919091526080840192909252905160a08084019550919350918290030181600087803b15801561041957600080fd5b505af115801561042d573d6000803e3d6000fd5b505050506040513d602081101561044357600080fd5b50511461049a576040805160e560020a62461bcd02815260206004820152601060248201527f46494c4c5f4f524445525f4552524f5200000000000000000000000000000000604482015290519081900360640190fd5b600254600160a060020a038581169116141561056157600254604080517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018590529051600160a060020a0390921691632e1a7d4d9160248082019260009290919082900301818387803b15801561051657600080fd5b505af115801561052a573d6000803e3d6000fd5b505060405133925084156108fc02915084906000818181858888f1935050505015801561055b573d6000803e3d6000fd5b506105e1565b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018490529051600160a060020a0386169163a9059cbb91604480830192600092919082900301818387803b1580156105c857600080fd5b505af11580156105dc573d6000803e3d6000fd5b505050505b6040518b907f963ef0ecf379b815c892a12de830d9e78624ccbd332b264e0b781072fb61158490600090a29a99505050505050505050505600a165627a7a723058201abdda7c98001a65cb6a7fa96d798727ad1337726b1926a726469d77e9d611be002900000000000000000000000012459c951127e0c374ff9105dda097662a0270930000000000000000000000008da0d80f5007ef1e431dd2127178d224e32c2ef4000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Deployed Bytecode
0x6080604052600436106100405763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166362c1f3898114610042575b005b610060600435602460c460ff61018435166101a4356101c435610072565b60408051918252519081900360200190f35b600254600090600160a060020a036040880135811691606089013582169188359160208a01359116831415610182573481146100f8576040805160e560020a62461bcd02815260206004820152601060248201527f57524f4e475f4554485f414d4f554e5400000000000000000000000000000000604482015290519081900360640190fd5b600260009054906101000a9004600160a060020a0316600160a060020a031663d0e30db0826040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016000604051808303818588803b15801561016457600080fd5b505af1158015610178573d6000803e3d6000fd5b5050505050610272565b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018390529051600160a060020a038516916323b872dd9160648083019260209291908290030181600087803b1580156101f057600080fd5b505af1158015610204573d6000803e3d6000fd5b505050506040513d602081101561021a57600080fd5b50511515610272576040805160e560020a62461bcd02815260206004820152601960248201527f544f4b454e5f5452414e534645525f46524f4d5f4552524f5200000000000000604482015290519081900360640190fd5b600154604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519185169163095ea7b3916044808201926020929091908290030181600087803b1580156102e157600080fd5b505af11580156102f5573d6000803e3d6000fd5b505050506040513d602081101561030b57600080fd5b50511515610363576040805160e560020a62461bcd02815260206004820152601360248201527f544f4b454e5f415050524f56455f4552524f5200000000000000000000000000604482015290519081900360640190fd5b6000546040517fbc61394a0000000000000000000000000000000000000000000000000000000081528291600160a060020a03169063bc61394a908d908d9085906001908f908f908f90600401808860a08082843790910190508760c080828437909101968752505092151560208086019190915260ff90921660408086019190915260608501919091526080840192909252905160a08084019550919350918290030181600087803b15801561041957600080fd5b505af115801561042d573d6000803e3d6000fd5b505050506040513d602081101561044357600080fd5b50511461049a576040805160e560020a62461bcd02815260206004820152601060248201527f46494c4c5f4f524445525f4552524f5200000000000000000000000000000000604482015290519081900360640190fd5b600254600160a060020a038581169116141561056157600254604080517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018590529051600160a060020a0390921691632e1a7d4d9160248082019260009290919082900301818387803b15801561051657600080fd5b505af115801561052a573d6000803e3d6000fd5b505060405133925084156108fc02915084906000818181858888f1935050505015801561055b573d6000803e3d6000fd5b506105e1565b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018490529051600160a060020a0386169163a9059cbb91604480830192600092919082900301818387803b1580156105c857600080fd5b505af11580156105dc573d6000803e3d6000fd5b505050505b6040518b907f963ef0ecf379b815c892a12de830d9e78624ccbd332b264e0b781072fb61158490600090a29a99505050505050505050505600a165627a7a723058201abdda7c98001a65cb6a7fa96d798727ad1337726b1926a726469d77e9d611be0029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000012459c951127e0c374ff9105dda097662a0270930000000000000000000000008da0d80f5007ef1e431dd2127178d224e32c2ef4000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
-----Decoded View---------------
Arg [0] : _exchangeAddress (address): 0x12459C951127e0c374FF9105DdA097662A027093
Arg [1] : _tokenProxyAddress (address): 0x8da0D80f5007ef1e431DD2127178d224E32C2eF4
Arg [2] : _wethAddress (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000012459c951127e0c374ff9105dda097662a027093
Arg [1] : 0000000000000000000000008da0d80f5007ef1e431dd2127178d224e32c2ef4
Arg [2] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Swarm Source
bzzr://1abdda7c98001a65cb6a7fa96d798727ad1337726b1926a726469d77e9d611be
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.