Skip to main content

Deploy all required contracts

Steps

  • We can see here that the Masterchef contract requires a few contract addresses in order to be deployed

  • Let’s find and deploy each contract and add them to the Masterchef

  • We’ll start with CakeToken.sol which returns the _cake value we require

  • Let’s select our CakeToken.sol in the file explorer

  • We’ll navigate to the Deploy and Run tab, and from here adjust the ‘contract’ field to be CakeToken.sol

  • This contract does not require any other contract addresses to be deployed. Next we’ll deploy the CakeToken.sol contract

  • The contract is now deployed!

  • We can inspect the contract and see the available functions using the sidebar menu in the Deploy & Run tab

  • As expected all functions are working normally

  • Now we can add the Cake address to the MasterChef contract

  • Next up, let’s deploy SyrupBar

  • You may notice here that in order to deploy SyrupBar we need the _cake address which is why we deployed CakeToken.sol first

  • We’ll enter the _cake address and deploy the SyrupBar contract

  • After deployment we can now access the SyrupBar contract address, let’s add that to our MasterChef

  • For the _devaddr field we’ll use the PancakeSwap docs to find the dev address

  • On the same page in the PancakeSwap docs, we can find the _cakeperblock count

  • Lastly, we’ll add a _startblock which we can find on Polyscan. This number tells the contract how far into the future to start

  • In order to get a block in the future, we’ll adjust the latest block number to be some time into the future

Watch the video