Pancake Fork <contract changes> testnet working?

Hi guys , im forking pancake swap frontend after fork contracts and deploy on testnet.

I have managed to identify contracts on contracts.ts, change addresses and change abi on each json.

Whats the best method to run on testnet? i have managed to change the app to accept testnet wallet and even identify my token balance, but my token stats its all 0, instead of getting totalSupply() function returned value for example.

How i managed to fix this and also whats the next steps for LP and Pools fork?

I'm also creating my own factory and router.

some contracts

MasterChef '0xa3401Cc0A923a927fC86f64A2bb144C0687888a0'
SupportChef(sousChef) '0x74FC31B7950638d438ea620BB997E303f5676dD4'
myToken '0x61C4819BeAE4761B36d84c14fb1978D6aA655712'
Syrup (customnamed) '0xc93eBED0Ca6721e02402d4BF668944F2FF25d304'
MultiCall '0xA927f944D72B4d9048aed7676d286D84387bc912'
Timelock '0x66b08aA3C9E5811222c8543de6FAb285372Bcd75'

Thanks

Hi, welcome! :wave:

Sorry, I am not familiar with the front-end, I think if you can not get a correct return value, maybe you use a wrong contract address.

And maybe you can change you tag to General Developer wanted

The contract probably right, the amount in wallet in harvest card is correctly showing.

I think something to do with cakePerBlock name? i have changed in the contract, after changing on the frontend calls i get this error now:

Unhandled Rejection (Error): invalid address (argument=“address”, value="", code=INVALID_ARGUMENT, version=address/5.3.0) (argument="_owner", value="", code=INVALID_ARGUMENT, version=abi/5.3.1)

@gambit.coin may I ask how you are getting the token balance? I’m having an issue getting the token balance in the left bottom corner .

1 Like

hi, i have made it to work, make sure you set the right contracts for token , set the farm files correctly and state/hooks.ts file

@gambit.coin
I have set all contract address proper and also the lp token address and it is showing Nan% to Apr and deposit fee

Hmm strange, what about the token price? On mine it’s all working, only thing whic is NaN% is the total liquidity on cake and usdt pools, also on some other liquiditys seems to not going up from zero, but maybe it has to do with value on the exchange , we shouldn’t have a problem using mainnet pancake router and factory.

@gambit.coin
Thanks for your precious time
To deply the MasterChef contract its ask for tokenaddress, devaddress, feeaddress, tokenperblock, and startblock
All the details I have filled but when I try tokenperblock value as 0.1 it is throughing me error

1 Like

Are you putting in big numbers?

If your coin has 18 decimals, the simplest way is to put as 100000000000000000.

@gambit.coin what to put on tokenperblock value in remix for deploying

did you try 100000000000000000 ?

Hey I’m currently getting the same rejection:

Error: call revert exception (method=“aggregate((address,bytes))”, errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.4.0)

How did you circumvent this?

Do not change every ABI, only token and masterchef ones

Figured it out, thank you!

Hello @Mjavala
Can you please explain me how you figure out tetsnet issue?

I have my own masterchef contract, CakeToken,Factory contract, Router contract.
Also I have created liquidity pairs for farming. All farming functionality are working perfectly.
Just I am not able to display APR, Liquidity, Multiplier value on Bsc testnet.

Please help me to resolve this issue.

3 Likes

U can write me on telegram @ait64! I can help

Hi, were you able to solve this issue? I am having the same problem.

@Mjavala
How do you do?
Did you solve the problem?
I have the same issue.
For example:


Please help me.

And then I have this issue.

Hey I'm getting the same error, could you solve it? Thanks!