This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Token, WETH9, CurrencyAmount, TradeType } = require('@uniswap/sdk-core') | |
const { Route, Trade, Pair } = require('@uniswap/v2-sdk') | |
const ethers = require('ethers') | |
;(async () => { | |
const CHAIN_ID = 1 | |
const daiAddress = '0x6B175474E89094C44Da98b954EedeAC495271d0F' | |
const tokenA = WETH9[CHAIN_ID] | |
const tokenB = new Token(CHAIN_ID, daiAddress, 18, 'DAI', 'DAI') | |
const pairAddress = Pair.getAddress(tokenA, tokenB) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
// optimize=true&runs=200&evmVersion=null&version=soljson-v0.7.4+commit.3f05b770.js | |
pragma solidity ^0.7.4; | |
interface ERC20 { | |
function balanceOf(address tokenOwner) external view returns (uint balance); | |
function transfer(address to, uint tokens) external returns (bool success); | |
} | |
contract HTLC { | |
address payable recipientAddress = 0x1111111111111111111111111111111111111111; | |
address payable refundAddress = 0x2222222222222222222222222222222222222222; |