Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 217 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Withdraw | 6799956 | 2653 days ago | IN | 0 ETH | 0.00130237 | ||||
| Create Swap | 6799952 | 2653 days ago | IN | 0.17611912 ETH | 0.00127005 | ||||
| Refund | 6782810 | 2656 days ago | IN | 0 ETH | 0.0001318 | ||||
| Refund | 6782574 | 2656 days ago | IN | 0 ETH | 0.00015377 | ||||
| Refund | 6782325 | 2656 days ago | IN | 0 ETH | 0.00012936 | ||||
| Refund | 6782071 | 2656 days ago | IN | 0 ETH | 0.00012936 | ||||
| Refund | 6781740 | 2656 days ago | IN | 0 ETH | 0.00012936 | ||||
| Refund | 6781717 | 2656 days ago | IN | 0 ETH | 0.00012936 | ||||
| Refund | 6781505 | 2656 days ago | IN | 0 ETH | 0.00015377 | ||||
| Withdraw | 6781326 | 2656 days ago | IN | 0 ETH | 0.00030054 | ||||
| Create Swap | 6781321 | 2656 days ago | IN | 0.17311767 ETH | 0.0004854 | ||||
| Refund | 6781294 | 2656 days ago | IN | 0 ETH | 0.00015377 | ||||
| Refund | 6781272 | 2656 days ago | IN | 0 ETH | 0.00015377 | ||||
| Refund | 6781269 | 2656 days ago | IN | 0 ETH | 0.00017818 | ||||
| Refund | 6764386 | 2659 days ago | IN | 0 ETH | 0.00017818 | ||||
| Refund | 6764382 | 2659 days ago | IN | 0 ETH | 0.00015377 | ||||
| Refund | 6764363 | 2659 days ago | IN | 0 ETH | 0.00012936 | ||||
| Refund | 6764357 | 2659 days ago | IN | 0 ETH | 0.00012936 | ||||
| Refund | 6764122 | 2659 days ago | IN | 0 ETH | 0.00017818 | ||||
| Refund | 6764120 | 2659 days ago | IN | 0 ETH | 0.00017818 | ||||
| Refund | 6764096 | 2659 days ago | IN | 0 ETH | 0.00017818 | ||||
| Refund | 6763883 | 2659 days ago | IN | 0 ETH | 0.00015377 | ||||
| Refund | 6763880 | 2659 days ago | IN | 0 ETH | 0.00015377 | ||||
| Refund | 6763866 | 2659 days ago | IN | 0 ETH | 0.00017818 | ||||
| Refund | 6763862 | 2659 days ago | IN | 0 ETH | 0.00017818 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| - | 6799956 | 2653 days ago | 0.17611912 ETH | ||||
| Transfer | 6781326 | 2656 days ago | 0.17311767 ETH | ||||
| Transfer | 6763101 | 2659 days ago | 0.17930803 ETH | ||||
| Transfer | 6740923 | 2663 days ago | 0.16175994 ETH | ||||
| Transfer | 6733147 | 2664 days ago | 0.1133481 ETH | ||||
| Transfer | 6678564 | 2673 days ago | 0.45973493 ETH | ||||
| Transfer | 6660932 | 2676 days ago | 0.12699509 ETH | ||||
| Transfer | 6641498 | 2679 days ago | 0.15891527 ETH | ||||
| Transfer | 6641201 | 2679 days ago | 0.15882845 ETH | ||||
| Transfer | 6611351 | 2684 days ago | 0.15795756 ETH | ||||
| Transfer | 6605074 | 2685 days ago | 0.79720522 ETH | ||||
| Transfer | 6597532 | 2686 days ago | 0.31888208 ETH | ||||
| Transfer | 6586389 | 2688 days ago | 0.79739284 ETH | ||||
| Transfer | 6585583 | 2688 days ago | 0.15947856 ETH | ||||
| Transfer | 6584397 | 2688 days ago | 0.50435802 ETH | ||||
| Transfer | 6583397 | 2688 days ago | 0.16811934 ETH | ||||
| Transfer | 6576109 | 2690 days ago | 0.00246536 ETH | ||||
| Transfer | 6576062 | 2690 days ago | 0.16776684 ETH | ||||
| Transfer | 6564334 | 2692 days ago | 0.10048445 ETH | ||||
| Transfer | 6564209 | 2692 days ago | 0.05024222 ETH | ||||
| Transfer | 6563637 | 2692 days ago | 0.03015058 ETH | ||||
| Transfer | 6543374 | 2695 days ago | 0.15927064 ETH | ||||
| Transfer | 6543355 | 2695 days ago | 0.15927064 ETH | ||||
| Transfer | 6543220 | 2695 days ago | 0.15931776 ETH | ||||
| Transfer | 6543145 | 2695 days ago | 0.15947188 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
EthToSmthSwaps
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-07-27
*/
pragma solidity ^0.4.23;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns(uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns(uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns(uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns(uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract EthToSmthSwaps {
using SafeMath for uint;
address public owner;
address public ratingContractAddress;
uint256 SafeTime = 1 hours; // atomic swap timeOut
struct Swap {
bytes32 secret;
bytes20 secretHash;
uint256 createdAt;
uint256 balance;
}
// ETH Owner => BTC Owner => Swap
mapping(address => mapping(address => Swap)) public swaps;
mapping(address => mapping(address => uint)) public participantSigns;
constructor () public {
owner = msg.sender;
}
event CreateSwap(uint256 createdAt);
// ETH Owner creates Swap with secretHash
// ETH Owner make token deposit
function createSwap(bytes20 _secretHash, address _participantAddress) public payable {
require(msg.value > 0);
require(swaps[msg.sender][_participantAddress].balance == uint256(0));
swaps[msg.sender][_participantAddress] = Swap(
bytes32(0),
_secretHash,
now,
msg.value
);
CreateSwap(now);
}
function getBalance(address _ownerAddress) public view returns (uint256) {
return swaps[_ownerAddress][msg.sender].balance;
}
event Withdraw(bytes32 _secret,address addr, uint amount);
// BTC Owner withdraw money and adds secret key to swap
// BTC Owner receive +1 reputation
function withdraw(bytes32 _secret, address _ownerAddress) public {
Swap memory swap = swaps[_ownerAddress][msg.sender];
require(swap.secretHash == ripemd160(_secret));
require(swap.balance > uint256(0));
require(swap.createdAt.add(SafeTime) > now);
msg.sender.transfer(swap.balance);
swaps[_ownerAddress][msg.sender].balance = 0;
swaps[_ownerAddress][msg.sender].secret = _secret;
Withdraw(_secret,msg.sender,swap.balance);
}
// ETH Owner receive secret
function getSecret(address _participantAddress) public view returns (bytes32) {
return swaps[msg.sender][_participantAddress].secret;
}
event Close();
event Refund();
// ETH Owner refund money
// BTC Owner gets -1 reputation
function refund(address _participantAddress) public {
Swap memory swap = swaps[msg.sender][_participantAddress];
require(swap.balance > uint256(0));
require(swap.createdAt.add(SafeTime) < now);
msg.sender.transfer(swap.balance);
clean(msg.sender, _participantAddress);
Refund();
}
function clean(address _ownerAddress, address _participantAddress) internal {
delete swaps[_ownerAddress][_participantAddress];
delete participantSigns[_ownerAddress][_participantAddress];
}
//TESTNET only
function testnetWithdrawn(uint val) {
require(msg.sender == owner);
owner.transfer(val);
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":false,"inputs":[{"name":"val","type":"uint256"}],"name":"testnetWithdrawn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_secret","type":"bytes32"},{"name":"_ownerAddress","type":"address"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_participantAddress","type":"address"}],"name":"getSecret","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"participantSigns","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"swaps","outputs":[{"name":"secret","type":"bytes32"},{"name":"secretHash","type":"bytes20"},{"name":"createdAt","type":"uint256"},{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_secretHash","type":"bytes20"},{"name":"_participantAddress","type":"address"}],"name":"createSwap","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"ratingContractAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_ownerAddress","type":"address"}],"name":"getBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_participantAddress","type":"address"}],"name":"refund","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"createdAt","type":"uint256"}],"name":"CreateSwap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_secret","type":"bytes32"},{"indexed":false,"name":"addr","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[],"name":"Close","type":"event"},{"anonymous":false,"inputs":[],"name":"Refund","type":"event"}]Contract Creation Code
6080604052610e1060025534801561001657600080fd5b5060008054600160a060020a03191633179055610821806100386000396000f3006080604052600436106100a35763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630b02177f81146100a85780631b258d50146100c2578063284180fc146100e65780634d025fdf146101195780638da5cb5b1461014057806399caf97514610171578063a543bae7146101cc578063dcb5930a146101f2578063f8b2cb4f14610207578063fa89401a14610228575b600080fd5b3480156100b457600080fd5b506100c0600435610249565b005b3480156100ce57600080fd5b506100c0600435600160a060020a036024351661029d565b3480156100f257600080fd5b50610107600160a060020a036004351661045e565b60408051918252519081900360200190f35b34801561012557600080fd5b50610107600160a060020a0360043581169060243516610486565b34801561014c57600080fd5b506101556104a3565b60408051600160a060020a039092168252519081900360200190f35b34801561017d57600080fd5b50610198600160a060020a03600435811690602435166104b2565b604080519485526bffffffffffffffffffffffff199093166020850152838301919091526060830152519081900360800190f35b6100c06bffffffffffffffffffffffff1960043516600160a060020a03602435166104f2565b3480156101fe57600080fd5b50610155610602565b34801561021357600080fd5b50610107600160a060020a0360043516610611565b34801561023457600080fd5b506100c0600160a060020a0360043516610639565b600054600160a060020a0316331461026057600080fd5b60008054604051600160a060020a039091169183156108fc02918491818181858888f19350505050158015610299573d6000803e3d6000fd5b5050565b6102a56107ce565b50600160a060020a0381166000908152600360208181526040808420338552825280842081516080810183528154815260018201546c01000000000000000000000000026bffffffffffffffffffffffff19168185015260028201548184015290840154606082015281518781529151909482840193928290038301908290865af1158015610338573d6000803e3d6000fd5b505050604051516c01000000000000000000000000026bffffffffffffffffffffffff191681602001516bffffffffffffffffffffffff191614151561037d57600080fd5b606081015160001061038e57600080fd5b426103a8600254836040015161074a90919063ffffffff16565b116103b257600080fd5b6060810151604051339180156108fc02916000818181858888f193505050501580156103e2573d6000803e3d6000fd5b50600160a060020a03821660009081526003602081815260408084203380865290835281852093840194909455918690556060848101518351888152928301949094528183019390935290517fe7284ffe0c70ad2f3b0aa15cde1cfe95f736935651a138725b21fd168edc5d6a929181900390910190a1505050565b336000908152600360209081526040808320600160a060020a03949094168352929052205490565b600460209081526000928352604080842090915290825290205481565b600054600160a060020a031681565b60036020818152600093845260408085209091529183529120805460018201546002830154929093015490926c0100000000000000000000000002919084565b600034116104ff57600080fd5b336000908152600360208181526040808420600160a060020a038616855290915290912001541561052f57600080fd5b6040805160808101825260008082526bffffffffffffffffffffffff19851660208084019182524284860181815234606087019081523386526003808552888720600160a060020a038b16885285529588902096518755935160018701805473ffffffffffffffffffffffffffffffffffffffff19166c0100000000000000000000000090920491909117905551600286015591519390920192909255825191825291517f75e08a17287037df5e6f71989e369f532836e26f5ee121161a3dc370b8064764929181900390910190a15050565b600154600160a060020a031681565b600160a060020a03166000908152600360208181526040808420338552909152909120015490565b6106416107ce565b50336000908152600360208181526040808420600160a060020a0386168552825280842081516080810183528154815260018201546c01000000000000000000000000026bffffffffffffffffffffffff19169381019390935260028101549183019190915290910154606082018190529091106106be57600080fd5b426106d8600254836040015161074a90919063ffffffff16565b106106e257600080fd5b6060810151604051339180156108fc02916000818181858888f19350505050158015610712573d6000803e3d6000fd5b5061071d3383610760565b6040517f5d26862916391bf49478b2f5103b0720a842b45ef145a268f2cd1fb2aed5517890600090a15050565b60008282018381101561075957fe5b9392505050565b600160a060020a0391821660008181526003602081815260408084209590961680845294815285832083815560018101805473ffffffffffffffffffffffffffffffffffffffff19169055600281018490559091018290559181526004825283812092815291905290812055565b604080516080810182526000808252602082018190529181018290526060810191909152905600a165627a7a72305820abbe3207ce0f5fda21d6aafbf77d83c33dc293cabb1c139a487424469b184b710029
Deployed Bytecode
0x6080604052600436106100a35763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630b02177f81146100a85780631b258d50146100c2578063284180fc146100e65780634d025fdf146101195780638da5cb5b1461014057806399caf97514610171578063a543bae7146101cc578063dcb5930a146101f2578063f8b2cb4f14610207578063fa89401a14610228575b600080fd5b3480156100b457600080fd5b506100c0600435610249565b005b3480156100ce57600080fd5b506100c0600435600160a060020a036024351661029d565b3480156100f257600080fd5b50610107600160a060020a036004351661045e565b60408051918252519081900360200190f35b34801561012557600080fd5b50610107600160a060020a0360043581169060243516610486565b34801561014c57600080fd5b506101556104a3565b60408051600160a060020a039092168252519081900360200190f35b34801561017d57600080fd5b50610198600160a060020a03600435811690602435166104b2565b604080519485526bffffffffffffffffffffffff199093166020850152838301919091526060830152519081900360800190f35b6100c06bffffffffffffffffffffffff1960043516600160a060020a03602435166104f2565b3480156101fe57600080fd5b50610155610602565b34801561021357600080fd5b50610107600160a060020a0360043516610611565b34801561023457600080fd5b506100c0600160a060020a0360043516610639565b600054600160a060020a0316331461026057600080fd5b60008054604051600160a060020a039091169183156108fc02918491818181858888f19350505050158015610299573d6000803e3d6000fd5b5050565b6102a56107ce565b50600160a060020a0381166000908152600360208181526040808420338552825280842081516080810183528154815260018201546c01000000000000000000000000026bffffffffffffffffffffffff19168185015260028201548184015290840154606082015281518781529151909482840193928290038301908290865af1158015610338573d6000803e3d6000fd5b505050604051516c01000000000000000000000000026bffffffffffffffffffffffff191681602001516bffffffffffffffffffffffff191614151561037d57600080fd5b606081015160001061038e57600080fd5b426103a8600254836040015161074a90919063ffffffff16565b116103b257600080fd5b6060810151604051339180156108fc02916000818181858888f193505050501580156103e2573d6000803e3d6000fd5b50600160a060020a03821660009081526003602081815260408084203380865290835281852093840194909455918690556060848101518351888152928301949094528183019390935290517fe7284ffe0c70ad2f3b0aa15cde1cfe95f736935651a138725b21fd168edc5d6a929181900390910190a1505050565b336000908152600360209081526040808320600160a060020a03949094168352929052205490565b600460209081526000928352604080842090915290825290205481565b600054600160a060020a031681565b60036020818152600093845260408085209091529183529120805460018201546002830154929093015490926c0100000000000000000000000002919084565b600034116104ff57600080fd5b336000908152600360208181526040808420600160a060020a038616855290915290912001541561052f57600080fd5b6040805160808101825260008082526bffffffffffffffffffffffff19851660208084019182524284860181815234606087019081523386526003808552888720600160a060020a038b16885285529588902096518755935160018701805473ffffffffffffffffffffffffffffffffffffffff19166c0100000000000000000000000090920491909117905551600286015591519390920192909255825191825291517f75e08a17287037df5e6f71989e369f532836e26f5ee121161a3dc370b8064764929181900390910190a15050565b600154600160a060020a031681565b600160a060020a03166000908152600360208181526040808420338552909152909120015490565b6106416107ce565b50336000908152600360208181526040808420600160a060020a0386168552825280842081516080810183528154815260018201546c01000000000000000000000000026bffffffffffffffffffffffff19169381019390935260028101549183019190915290910154606082018190529091106106be57600080fd5b426106d8600254836040015161074a90919063ffffffff16565b106106e257600080fd5b6060810151604051339180156108fc02916000818181858888f19350505050158015610712573d6000803e3d6000fd5b5061071d3383610760565b6040517f5d26862916391bf49478b2f5103b0720a842b45ef145a268f2cd1fb2aed5517890600090a15050565b60008282018381101561075957fe5b9392505050565b600160a060020a0391821660008181526003602081815260408084209590961680845294815285832083815560018101805473ffffffffffffffffffffffffffffffffffffffff19169055600281018490559091018290559181526004825283812092815291905290812055565b604080516080810182526000808252602082018190529181018290526060810191909152905600a165627a7a72305820abbe3207ce0f5fda21d6aafbf77d83c33dc293cabb1c139a487424469b184b710029
Swarm Source
bzzr://abbe3207ce0f5fda21d6aafbf77d83c33dc293cabb1c139a487424469b184b71
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.