Skip to content

Commit

Permalink
deployed latest to kovan and ropsten - updated README.md and deployme…
Browse files Browse the repository at this point in the history
…nt.json
  • Loading branch information
Chris Hatch committed Jun 6, 2018
1 parent 60420ff commit 991c136
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@

[Hashed Timelock Contracts](https://en.bitcoin.it/wiki/Hashed_Timelock_Contracts) (HTLCs) for Ethereum:

* [HashedTimelock.sol](contracts/HashedTimelock.sol) - HTLC for native ETH token
* [HashedTimelockERC20.sol](contracts/HashedTimelockERC20.sol) - HTLC for ERC20 tokens
- [HashedTimelock.sol](contracts/HashedTimelock.sol) - HTLC for native ETH token
- [HashedTimelockERC20.sol](contracts/HashedTimelockERC20.sol) - HTLC for ERC20 tokens

Use these contracts for creating HTLCs on the Ethereum side of a cross chain atomic swap (for example the [xcat](https://github.com/chatch/xcat) project).

## Deployment

HashedTimelock:

* Ropsten: [0x0c0c3ec813a311acc37c8fc77d3cda0f32bcdd4b](https://ropsten.etherscan.io/address/0x0c0c3ec813a311acc37c8fc77d3cda0f32bcdd4b)
* Mainnet: <not deployed yet ...>
- Kovan: [0xc3ed16874bc9551b079c135eb27b10ee1348ac12](https://kovan.etherscan.io/address/0xc3ed16874bc9551b079c135eb27b10ee1348ac12)
- Ropsten:
[0xbb6883511ff318ba85b5745fb1a6083537bf914c](https://ropsten.etherscan.io/address/0xbb6883511ff318ba85b5745fb1a6083537bf914c)
- Mainnet: <not deployed yet ...>

HashedTimelockERC20:

* Ropsten: [0x42902c91ed93ac58f1c958806c8d22e7ea1835f8](https://ropsten.etherscan.io/address/0x42902c91ed93ac58f1c958806c8d22e7ea1835f8)
* Mainnet: <not deployed yet ...>
- Kovan: [0xfD4BEbA807E89E2cA209cd53c28471840446ddf2](https://kovan.etherscan.io/address/0xfD4BEbA807E89E2cA209cd53c28471840446ddf2)
- Ropsten: [0x6879e090240358f59fc5d212f87da63d3288749b](https://ropsten.etherscan.io/address/0x6879e090240358f59fc5d212f87da63d3288749b)
- Mainnet: <not deployed yet ...>

## Protocol - Native ETH

Expand All @@ -45,21 +48,21 @@ HashedTimelockERC20:

### HashedTimelock

1. `newContract(receiverAddress, hashlock, timelock)` create new HTLC with given receiver, hashlock and expiry; returns contractId bytes32
2. `withdraw(contractId, preimage)` claim funds revealing the preimage
3. `refund(contractId)` if withdraw was not called the contract creator can get a refund by calling this some time after the time lock has expired.
1. `newContract(receiverAddress, hashlock, timelock)` create new HTLC with given receiver, hashlock and expiry; returns contractId bytes32
2. `withdraw(contractId, preimage)` claim funds revealing the preimage
3. `refund(contractId)` if withdraw was not called the contract creator can get a refund by calling this some time after the time lock has expired.

See [test/htlc.js](test/htlc.js) for examples of interacting with the contract from javascript.

### HashedTimelockERC20

1. `newContract(receiverAddress, hashlock, timelock, tokenContract, amount)` create new HTLC with given receiver, hashlock, expiry, ERC20 token contract address and amount of tokens
2. `withdraw(contractId, preimage)` claim funds revealing the preimage
3. `refund(contractId)` if withdraw was not called the contract creator can get a refund by calling this some time after the time lock has expired.
1. `newContract(receiverAddress, hashlock, timelock, tokenContract, amount)` create new HTLC with given receiver, hashlock, expiry, ERC20 token contract address and amount of tokens
2. `withdraw(contractId, preimage)` claim funds revealing the preimage
3. `refund(contractId)` if withdraw was not called the contract creator can get a refund by calling this some time after the time lock has expired.

See [test/htlcERC20.js](test/htlcERC20.js) for examples of interacting with the contract from javascript.

## ABI and Bytecode

* [HashedTimelock.json](abi/HashedTimelock.json)
* [HashedTimelockERC20.json](abi/HashedTimelockERC20.json)
- [HashedTimelock.json](abi/HashedTimelock.json)
- [HashedTimelockERC20.json](abi/HashedTimelockERC20.json)
6 changes: 4 additions & 2 deletions deployment.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"htlc": {
"ropsten": "0x0c0c3ec813a311acc37c8fc77d3cda0f32bcdd4b",
"kovan": "0xc3ed16874bc9551b079c135eb27b10ee1348ac12",
"ropsten": "0xbb6883511ff318ba85b5745fb1a6083537bf914c",
"testrpc": "0x345ca3e014aaf5dca488057592ee47305d9b3e10"
},
"htlcERC20": {
"ropsten": "0x42902c91ed93ac58f1c958806c8d22e7ea1835f8",
"kovan": "0xfD4BEbA807E89E2cA209cd53c28471840446ddf2",
"ropsten": "0x6879e090240358f59fc5d212f87da63d3288749b",
"testrpc": "0xf25186b5081ff5ce73482ad761db0eb0d25abfbf"
}
}

0 comments on commit 991c136

Please sign in to comment.