Given an interface that refers to an ERC20 token contract named XYZ, and a constructor that refers to a variable of type XYZ, how do you refer to the XYZ token contract in a contract deployment function?
Here is the interface and contract:
interface XYZ {}
contract MyContract {
XYZ public token;
constructor(
XYZ _token
) public {
token = _token;
}
}
I've been trying to use the contract address of the XYZ token contract but I don't think it's working. I tried passing it as an integer and a string, but can't find anything online that talks about what to use for deployment. Here is my deployment function (using Truffle with a mainnet fork on ganache-cli):
const MyContract = artifacts.require("MyContract");
module.exports = async function (deployer) {
await deployer.deploy(MyContract, 0x587242da6dde74aA602AF3595d271333421c7E20);
};
What should take the place of 0x587242da6dde74aA602AF3595d271333421c7E20 (the XYZ token contract address)? Thanks!