# Pancake Fork \<contract changes\> testnet working?

**URL:** <https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085>\
**Category:** Smart Contracts\
**Tags:** pancake\
**Created:** [June 22, 2021, 2:11am UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085 "2021-06-22T02:11:15Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gambit.coin](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@gambit.coin](https://forum.openzeppelin.com/u/gambit.coin)\
**Post date:** [June 22, 2021, 2:11am UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/1 "2021-06-22T02:11:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Skyge](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/skyge/32/343_2.png) [@Skyge](https://forum.openzeppelin.com/u/Skyge)\
**Post date:** [June 22, 2021, 4:14pm UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/2 "2021-06-22T16:14:46Z")

</div>

Hi, welcome! 👋

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`

---

<div class="post-metadata">

**Author:** ![gambit.coin](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@gambit.coin](https://forum.openzeppelin.com/u/gambit.coin)\
**Post date:** [June 22, 2021, 6:50pm UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/3 "2021-06-22T18:50:14Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Soft\_Token](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/soft_token/32/7529_2.png) [@Soft\_Token](https://forum.openzeppelin.com/u/Soft_Token)\
**Post date:** [July 10, 2021, 6:11pm UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/4 "2021-07-10T18:11:07Z")

</div>

@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 .

---

<div class="post-metadata">

**Author:** ![gambit.coin](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@gambit.coin](https://forum.openzeppelin.com/u/gambit.coin)\
**Post date:** [July 10, 2021, 10:18pm UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/5 "2021-07-10T22:18:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Soft\_Token](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/soft_token/32/7529_2.png) [@Soft\_Token](https://forum.openzeppelin.com/u/Soft_Token)\
**Post date:** [July 11, 2021, 6:55am UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/6 "2021-07-11T06:55:40Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![gambit.coin](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@gambit.coin](https://forum.openzeppelin.com/u/gambit.coin)\
**Post date:** [July 11, 2021, 10:30am UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/7 "2021-07-11T10:30:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Soft\_Token](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/soft_token/32/7529_2.png) [@Soft\_Token](https://forum.openzeppelin.com/u/Soft_Token)\
**Post date:** [July 11, 2021, 11:06am UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/8 "2021-07-11T11:06:05Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![gambit.coin](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@gambit.coin](https://forum.openzeppelin.com/u/gambit.coin)\
**Post date:** [July 11, 2021, 11:44am UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/9 "2021-07-11T11:44:00Z")

</div>

Are you putting in big numbers?

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

---

<div class="post-metadata">

**Author:** ![Soft\_Token](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/soft_token/32/7529_2.png) [@Soft\_Token](https://forum.openzeppelin.com/u/Soft_Token)\
**Post date:** [July 11, 2021, 12:59pm UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/10 "2021-07-11T12:59:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gambit.coin](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@gambit.coin](https://forum.openzeppelin.com/u/gambit.coin)\
**Post date:** [July 12, 2021, 11:08pm UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/11 "2021-07-12T23:08:01Z")

</div>

did you try 100000000000000000 ?

---

<div class="post-metadata">

**Author:** ![Mjavala](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/mjavala/32/7618_2.png) [@Mjavala](https://forum.openzeppelin.com/u/Mjavala)\
**Post date:** [July 16, 2021, 6:01am UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/13 "2021-07-16T06:01:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![gambit.coin](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@gambit.coin](https://forum.openzeppelin.com/u/gambit.coin)\
**Post date:** [July 20, 2021, 5:59am UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/14 "2021-07-20T05:59:34Z")

</div>

Do not change every ABI, only token and masterchef ones

---

<div class="post-metadata">

**Author:** ![Mjavala](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/mjavala/32/7618_2.png) [@Mjavala](https://forum.openzeppelin.com/u/Mjavala)\
**Post date:** [July 20, 2021, 9:56pm UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/15 "2021-07-20T21:56:06Z")

</div>

Figured it out, thank you!

---

<div class="post-metadata">

**Author:** ![sevenbits.abhishek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/sevenbits.abhishek/32/8140_2.png) [@sevenbits.abhishek](https://forum.openzeppelin.com/u/sevenbits.abhishek)\
**Post date:** [August 10, 2021, 3:07am UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/16 "2021-08-10T03:07:06Z")

</div>

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.

 ![Farms-PancakeSwap-18-198](https://us1.discourse-cdn.com/flex022/uploads/zeppelin/original/2X/4/4c3cfad42327d72c7b14b4226810f9dafa82805a.png)

Please help me to resolve this issue.

---

<div class="post-metadata">

**Author:** ![n91](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/n91/32/7129_2.png) [@n91](https://forum.openzeppelin.com/u/n91)\
**Post date:** [August 13, 2021, 12:25pm UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/17 "2021-08-13T12:25:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Pranjali\_Thakur](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/pranjali_thakur/32/9209_2.png) [@Pranjali\_Thakur](https://forum.openzeppelin.com/u/Pranjali_Thakur)\
**Post date:** [September 27, 2021, 9:43am UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/18 "2021-09-27T09:43:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AlexWeber](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@AlexWeber](https://forum.openzeppelin.com/u/AlexWeber)\
**Post date:** [January 10, 2022, 10:08am UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/19 "2022-01-10T10:08:12Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex022/uploads/zeppelin/original/2X/c/c28535d016e7aa5cbf0a05ae80da6267b35aa4df.png)  
Please help me.

---

<div class="post-metadata">

**Author:** ![AlexWeber](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@AlexWeber](https://forum.openzeppelin.com/u/AlexWeber)\
**Post date:** [January 10, 2022, 10:10am UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/20 "2022-01-10T10:10:21Z")

</div>

And then I have this issue.

> [@Mjavala](#):
>
> Error: call revert exception (method=“aggregate((address,bytes))”, errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL\_EXCEPTION, version=abi/5.4.0)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/zeppelin/original/2X/f/fa6638731bf19bac7b0773133c6c14d59db78209.png)

---

<div class="post-metadata">

**Author:** ![LuCryptoDev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/lucryptodev/32/13846_2.png) [@LuCryptoDev](https://forum.openzeppelin.com/u/LuCryptoDev)\
**Post date:** [March 15, 2022, 12:02am UTC](https://forum.openzeppelin.com/t/pancake-fork-contract-changes-testnet-working/11085/22 "2022-03-15T00:02:25Z")

</div>

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