I'm testing out Patric Collins youtube video and trying to test it in polygon testnet Mumbai but I when I try to deposit eth/matic to Aave Wethgateway I face this error:
File "C:\Users\BATTLEBOX\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\_cli\run.py", line 50, in main
return_value, frame = run(
File "C:\Users\BATTLEBOX\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\project\scripts.py", line 103, in run
return_value = f_locals[method_name](*args, **kwargs)
File "\Users\BATTLEBOX\Documents\Codes\flashloan_aave\aave-flashloan\scripts\get_weth.py", line 11, in main
get_weth()
File "\Users\BATTLEBOX\Documents\Codes\flashloan_aave\aave-flashloan\scripts\get_weth.py", line 30, in get_weth
tx = weth.deposit(
File "C:\Users\BATTLEBOX\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\contract.py", line 1629, in __call__
return self.transact(*args)
File "C:\Users\BATTLEBOX\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\contract.py", line 1502, in transact
return tx["from"].transfer(
File "C:\Users\BATTLEBOX\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\account.py", line 644, in transfer
receipt, exc = self._make_transaction(
File "C:\Users\BATTLEBOX\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\account.py", line 752, in _make_transaction
exc = VirtualMachineError(e)
File "C:\Users\BATTLEBOX\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\exceptions.py", line 121, in __init__
raise ValueError(str(exc)) from None
ValueError: Execution reverted during call: 'execution reverted: Fallback not allowed'. This transaction will likely revert. If you wish to broadcast, include `allow_revert:True` as a transaction parameter.
also this is the python script I'm running:
def get_weth():
"""
Mints WETH by depositing ETH.
"""
acct = accounts.add(
config["wallets"]["from_key"]
) # add your keystore ID as an argument to this call
# Chekcing account Matic balance
balance = acct.balance()
balance = Web3.fromWei(balance, "ether")
x = requests.get("https://gasstation-mumbai.matic.today").json()
GP = x["fastest"]
GP = Web3.toWei(GP, "gwei")
print(f"balance = {balance, GP}")
weth = interface.WethInterface(config["networks"][network.show_active()]["weth"])
tx = weth.deposit(
{
"from": acct,
"value": 500000000000000000,
"gas_limit": GP,
}
)
tx.wait(1)
print("Received 1 WETH")
return tx
I added gas limit (GP) hoping it would fix the problem but It didn't :))