-
-
Save cheekybastard/b5d4053a5f13551f61d79a656cf17f2a to your computer and use it in GitHub Desktop.
Revisions
-
banteg revised this gist
May 8, 2021 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ from brownie import accounts, chain, Contract, Wei from eth_abi.packed import encode_abi_packed user = accounts[0] @@ -16,6 +16,7 @@ path = encode_abi_packed(['address', 'uint24', 'address', 'uint24', 'address'], [str(weth), 3000, dai, 500, rai]) quote = quoter.quoteExactInput.call(path, amount) deadline = chain.time() + 600 tx = router.exactInput((path, user, deadline, amount, quote * 0.99)) tx.info() -
banteg created this gist
May 8, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ from brownie import accounts, Contract, Wei from eth_abi.packed import encode_abi_packed user = accounts[0] weth = Contract('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', owner=user) dai = '0x6B175474E89094C44Da98b954EedeAC495271d0F' rai = '0x03ab458634910AaD20eF5f1C8ee96F1D6ac54919' # https://github.com/Uniswap/uniswap-v3-periphery/blob/main/deploys.md quoter = Contract('0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6') router = Contract('0xE592427A0AEce92De3Edee1F18E0157C05861564', owner=user) amount = Wei('1 ether') weth.deposit({'amount': amount}) weth.approve(router, amount) path = encode_abi_packed(['address', 'uint24', 'address', 'uint24', 'address'], [str(weth), 3000, dai, 500, rai]) quote = quoter.quoteExactInput.call(path, amount) tx = router.exactInput((path, user, deadline, amount, quote * 0.99)) tx.info()