Replies: 13 comments 2 replies
-
Hello! |
Beta Was this translation helpful? Give feedback.
-
Hi, bro!
Have a look for my test wallet.
https://polygonscan.com/address/0x9b38c515a731f4a4e9b879fb2c288582e8685edb
Execute failed - via decoder data. Success - direct via uni UI
Nikita
PS. Your product is wonderful! write me your evm wallet - I want to thank
you
ср, 17 янв. 2024 г. в 20:58, Elnaril ***@***.***>:
… Hello!
It looks like these are just partial data. For what sub-command are they?
I'll need the whole data sent to the UR ...
Do you have a link to Etherscan?
—
Reply to this email directly, view it on GitHub
<#38 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARW7AQMLYAEQSZ4RKQ4DAMTYPAUOZAVCNFSM6AAAAABB7CC7CWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJWGU4TGMJWHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi!
The successful swap was done using a V3 pool (command: 0x00), while the failed one was done using a V2 pool (0x08) which does not exist.
Very happy you find it wonderful!! :) You will find an address in the wiki page footer: https://github.com/Elnaril/uniswap-universal-router-decoder/wiki |
Beta Was this translation helpful? Give feedback.
-
Thanks!
I'll try to manage chainging to v3 ))
чт, 18 янв. 2024 г. в 14:58, Elnaril ***@***.***>:
… Hi!
Have a look for my test wallet.
https://polygonscan.com/address/0x9b38c515a731f4a4e9b879fb2c288582e8685edb
The successful swap was done using a V3 pool (command: 0x00), while the
failed one was done using a V2 pool (0x08) which does not exist.
PS. Your product is wonderful! write me your evm wallet - I want to thank
you
Very happy you find it wonderful!! :) You will find an address in the wiki
page footer:
https://github.com/Elnaril/uniswap-universal-router-decoder/wiki
—
Reply to this email directly, view it on GitHub
<#38 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARW7AQOOW6O4UNUB4QEH2I3YPETBJAVCNFSM6AAAAABB7CC7CWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJYGUZTCMRVG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thank you for your interest in this lib and happy coding! :) |
Beta Was this translation helpful? Give feedback.
-
TNX BRO! |
Beta Was this translation helpful? Give feedback.
-
Thank you so much @Nick2Nik for these coffees! Very much appreciated! :) |
Beta Was this translation helpful? Give feedback.
-
Hi bro!
Not making a tiket, sorry.
Why i'm failing?
https://bscscan.com/tx/0x41360b24c9377aae19f31937a423209a93f21b5ce7b17b4d2a7ce1891fe13c9b
сб, 20 янв. 2024 г. в 08:01, Elnaril ***@***.***>:
… Thank you so much @Nick2Nik <https://github.com/Nick2Nik> for these
coffees! Very much appreciated! :)
—
Reply to this email directly, view it on GitHub
<#38 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARW7AQPB5VPOGH4LM3KGKJ3YPNTUJAVCNFSM6AAAAABB7CC7CWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBRHAYTKOBQGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hello! :) To answer your question, it looks like you're trying to swap on a V3 pool which does not exist: |
Beta Was this translation helpful? Give feedback.
-
no. I take nonce via code. Wrapped everything
чт, 1 февр. 2024 г. в 08:37, Elnaril ***@***.***>:
… Did you use the same account ? In this case, you should probably not use
the same Permit2 nonce (0) again.
—
Reply to this email directly, view it on GitHub
<#41 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARW7AQIOJ5HYND3OTVQ2NGTYRNA2RAVCNFSM6AAAAABCT4UEP2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DGMZRGU2DA>
.
You are receiving this because you were mentioned.Message ID:
<Elnaril/uniswap-universal-router-decoder/repo-discussions/41/comments/8331540
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
u_routers = {
'MATIC': '0x643770E279d5D0733F21d6DC03A8efbABf3255B4',
'BNB': '0xeC8B0F7Ffe3ae75d7FfAb09429e3675bb63503e4'
}
permit_2 = {
'MATIC': '0x000000000022D473030F116dDEE9F6B43aC78BA3',
'BNB': '0x000000000022D473030F116dDEE9F6B43aC78BA3'
}
def permit(private_key, chain, token_symbol, send=False, use_min_gas=False,
eip=True):
allow = allowance(private_key, chain, token_symbol, permit_2[chain])
amount = (2 ** 256 - 1) / 10 **
(chainSymbolToContract[chain][token_symbol]['decimal']+1)
if allow < amount:
approve(private_key, chain, token_symbol,
amount,
permit_2[chain],
send=send,
use_min_gas=use_min_gas,
eip=eip)
time.sleep(45)
else:
logger.info(f'No approve for permit needed!')
def permit_status(private_key, chain, symbol):
chainData = check_rpc(chain)
w3 = Web3(Web3.HTTPProvider(chainData['rpc']))
address = w3.eth.account.from_key(private_key).address
permit2_contract = w3.eth.contract(address=permit_2[chain],
abi=PERMIT_ABI)
token_contract = chainSymbolToContract[chain][symbol]['contract']
p2_amount, p2_expiration, p2_nonce =
permit2_contract.functions.allowance(
address,
token_contract,
u_routers[chain]
).call()
return p2_amount, p2_expiration, p2_nonce
def sign_permit(private_key, chain, amount, symbol):
chainData = check_rpc(chain)
w3 = Web3(Web3.HTTPProvider(chainData['rpc']))
token_contract = chainSymbolToContract[chain][symbol]['contract']
a = w3.eth.account.from_key(private_key)
_, _, p2_nonce = permit_status(private_key, chain, symbol)
permit_data, signable_message =
RouterCodec.create_permit2_signable_message(
token_contract,
int(amount * 10 ** chainSymbolToContract[chain][symbol]['decimal']),
RouterCodec.get_default_expiration(), # 30 days
p2_nonce,
u_routers[chain],
RouterCodec.get_default_deadline(), # 180 seconds
chainData['chain_id'],
)
signed_message = a.sign_message(signable_message)
return permit_data, signed_message
def swap_call_data(private_key, chain, amount, symbol_from, symbol_to):
amount_in = amount * 10 **
chainSymbolToContract[chain][symbol_from]['decimal']
encoded_input = (
RouterCodec().encode.chain().
permit2_permit(*sign_permit(private_key, chain, amount,
symbol_from)).
v3_swap_exact_in(
FunctionRecipient.SENDER,
int(amount_in),
int(amount_in * 0.97),
[Web3.to_checksum_address(chainSymbolToContract[chain][symbol_from]['contract']),
100,
Web3.to_checksum_address(chainSymbolToContract[chain][symbol_to]['contract'])],
payer_is_sender=True,
)
.build(RouterCodec().get_default_deadline())
)
return encoded_input
чт, 1 февр. 2024 г. в 13:09, Nikita Luzhbin ***@***.***>:
… no. I take nonce via code. Wrapped everything
чт, 1 февр. 2024 г. в 08:37, Elnaril ***@***.***>:
> Did you use the same account ? In this case, you should probably not use
> the same Permit2 nonce (0) again.
>
> —
> Reply to this email directly, view it on GitHub
> <#41 (reply in thread)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ARW7AQIOJ5HYND3OTVQ2NGTYRNA2RAVCNFSM6AAAAABCT4UEP2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DGMZRGU2DA>
> .
> You are receiving this because you were mentioned.Message ID:
> <Elnaril/uniswap-universal-router-decoder/repo-discussions/41/comments/8331540
> @github.com>
>
|
Beta Was this translation helpful? Give feedback.
-
TBH, I don't see anything wrong in your last transaction, and it looks very much like successful ones ... |
Beta Was this translation helpful? Give feedback.
-
Hi There!
It seams they have changed something in contract logic.
The transaction that passes has data like this:
0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f2e0200000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002b3c499c542cef5e3811e1192ce70d8cc03d5c33590000642791bca1f2de4661ed88a30c99a7a9449aa84174000000000000000000000000000000000000000000
Transactions with generated data fail. Generated date is this:
0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f1b3000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000003c499c542cef5e3811e1192ce70d8cc03d5c33590000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa84174
Beta Was this translation helpful? Give feedback.
All reactions