blockchainethereumsoliditybinance-smart-chainbinance-chain

Contract constructor parameter which is also a contract


I have contract in solidity MasterChef.sol which can be seen at the link below https://github.com/pancakeswap/pancake-farm/tree/master/contracts I want to deploy it using truffle on the Binance smart chain and the question is that the constructor of the MasterChef.sol takes in 5 args and two of them are contracts I want to know that how to pass the other two contracts i.e CakeToken.sol and SyrupBar.sol as the first two args in the deploy_contracts.js file.


Solution

  • You need deploy other contracts beforehand, write down their addresses and pass addresses when MasterChef is deployed.