Web3.py – How to Use Python3 Script to Call an ABI Function (Withdraw Funds) of a Smart Contract (dYdX)

abipythonweb3.py

I don't know enough about python or web3, and I must use the smart contract's ABI. I am using Infura for my node and do not run a local node.

The smart contract is 0xD54f502e184B6B739d7D27a6410a67dc462D69c8 which is the dYdX Layer2 smart contract.

The contract's ABI is at https://github.com/dydxprotocol/starkex-eth/blob/master/src/contracts/starkware-perpetual-abi.json

specifically I need to call the withdraw function at line #1802.

I have my private key which I was told is needed in the program to sign the withdraw transaction. I also have a little ETH in my wallet to pay the transaction fee. If there is a better place to post this, please let me know

Willing to pay for a working solution. Thank you!

Best Answer

I just wanted to let everybody know I figured it out and posted my solution here: https://github.com/chiwalfrm/dydxhelp/blob/main/dydx_slow_withdrawal.py

Related Topic