Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't deposit tokens #1

Closed
PeerpayCorp opened this issue May 15, 2023 · 9 comments
Closed

Can't deposit tokens #1

PeerpayCorp opened this issue May 15, 2023 · 9 comments

Comments

@PeerpayCorp
Copy link

If I deposit tokens on the first of the bridges (A) so that there is liquidity for someone to transfer back from bridge B then the app errors out and metamask complains it can't calculate gas.

However, if I deposit tokens on the contract on bridge B and leave A alone, everything seems to work ok. Of course people will have to transfer from A to B first so there is liquidity for bridging back.

I hope this makes sense. If not I can elaborate further.

@bgokcol
Copy link
Owner

bgokcol commented May 17, 2023

Hey, I saw you closed the issue but feel free to open it again if you think there is something wrong.

@PeerpayCorp PeerpayCorp reopened this May 18, 2023
@PeerpayCorp
Copy link
Author

Ok, I reopened it, because I still think it doesn't make sense. Shouldn't you be able to send tokens to the contract address on both sides of the bridge to give liquidity?

@PeerpayCorp
Copy link
Author

This is what happens if I send tokens to both sides of the bridge, then try to do a swap.

bridge_error1

@bgokcol
Copy link
Owner

bgokcol commented May 18, 2023

I think your problem is different, not the liquidity. Because in the deposit process it just transfers tokens from your wallet to bridge contract. Can you provide blockchain explorer links if possible. I can take a look.

@PeerpayCorp
Copy link
Author

I'm using private test nets at the moment, so no links sorry. Maybe you can explain how I should be depositing tokens in the bridge, because I think I'm doing it wrong. I basically just sent it from my wallet to the contact address on side B of the bridge, then also side A

Is that not what I'm supposed to do before starting swaps? What is the proper way to provide the liquidity?

@bgokcol
Copy link
Owner

bgokcol commented May 18, 2023

Let's say you make a bridge for $XYZ. There are $XYZ (BSC) and $XYZ (ERC) versions. To create BSC to ETH and ETH to BSC bridges, you need to deploy bridge.sol to ETH and BSC networks.

After that you need to transfer $XYZ (ERC) (this is what you call liquidity) to ETH bridge contract and $XYZ (BSC) to BSC bridge contract.

I think your problem might be related with the token or configuration in the config.js file. Does your token have any tax or max wallet limits?

@PeerpayCorp
Copy link
Author

It turns out my problem was that I was directly sending from my wallet to the contract address. I should have been using the deposit function to send the initial liquidity.

I have to do some more testing, but I think everything is woking now. Thank you.

@PeerpayCorp
Copy link
Author

Well, now remix.ethereum.org won't even let me deposit tokens into the contract. I don't know what's going on but I'm tired of troubleshooting this thing.

@PeerpayCorp
Copy link
Author

Issue solved. You need to use the deployer private key in config.js. I had switched it during testing and that's why there were so many problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants