Read and Write to Unverified Contracts

Locked the LP for a token via a locking service. I have the LP in my wallet. The locking service went under and took down their website. Now, I cannot interact with the contract to unlock the LP. Additionally, the locking contract is unverified. I can read some of the functions using an ABI decompiler. But, is there a way to interact with the locking contract to write the function to unlock the LP? The locking contract is on Pulsechain which is a fork of ETH. Any help or guidance is appreciated. https://scan.mypinata.cloud/ipfs/bafybeidn64pd2u525lmoipjl4nh3ooa2imd7huionjsdepdsphl5slfowy/

CA: 0x234e9Ed0048F7Dfbb7D5E01C779F5C2363071C6E

Hi,

Seems like there's a withdraw() method which takes as input the following parameters: address _lpToken, uint256 _index, uint256 _lockID, uint256 _amount.

You can try to install Foundry and call the method using Foundry cast send by providing the according parameters:

cast send --private-key <Your Private Key> 0x234e9Ed0048F7Dfbb7D5E01C779F5C2363071C6E "withdraw()(address,uint256,uint256,uint256)" <Your LP address> <Your index> <Your lock ID> <The amount you want to unlock> --rpc-url https://rpc.pulsechain.com	

Thank you so much. I will give that a try today.

Is there a way to find the lockid and index?

I'd suggest to try with 0 for both _lockID and _index. If that's not working, could you post the _lpToken address?

Thanks!

LP: 0x131d7b3b816270698a19120c773dbf9ed98f9a6c
I tried with 0,0 for ID and index, but received a parse error: expected ')' . Error:
could not parse function signature.

To double-check that you're running the correct command - it should look like this:

cast send --private-key <Your Private Key> 0x234e9Ed0048F7Dfbb7D5E01C779F5C2363071C6E "withdraw()(address,uint256,uint256,uint256)" 0x131d7b3b816270698a19120c773dbf9ed98f9a6c 0 0 1 --rpc-url https://rpc.pulsechain.com

I've replaced the parameters as follows:

<Your LP address>: 0x131d7b3b816270698a19120c773dbf9ed98f9a6c
<Your index>: 0
<Your lock ID>: 0
<The amount you want to unlock> : 1

Just replace the <Your Private Key> field with your PRIVATE KEY and execute it.

Thanks so much for the help. Now it comes with a new error code: (code: -32000, message: execution reverted, data: None). But the other error code is no longer showing.

The last transaction on this contract happened 3 months ago.

And on top of that, it was a successful transaction.

Can you please provide a link to your failed transaction?

The transaction was a cast send transaction through Foundry, so I don't have a link, unfortunately. The reason for the last transaction happening 3 months ago is because the service/website that had a Locker went under and disappeared. They token down their website as well. Then those tokens that were locked through their locker had no way of interacting with a front-end interface to unlock their tokens.

That doesn't prevent interacting with the contract directly (for example in your case, using Foundry).

When you execute a transaction, it usually appears in the chain tracker, whether it completed successfully or not (for example in your case, it should appear on scan.mypinata).

I was able to get it to work! Thank you so much for the support. I was really lost!

1 Like

Yup, there seems to be a new transaction in there from 20 minutes ago, I guess that's yours... kudos!

1 Like