0

I deployed three contracts where the contract itself is same but the parameters are different.

const Token = artifacts.require("Token");

module.exports = async function (deployer) {
    // Deploy Tokens
    await deployer.deploy(
        Token,
        "Bitcoin",
        "BTC",
        21000000,
        8,
        10
    );

    await deployer.deploy(
        Token,
        "Litecoin",
        "LTC",
        84000000,
        5,
        7
    );

    await deployer.deploy(
        Token,
        "Ethereum Classic",
        "ETC",
        210700000,
        2,
        4
    );
};

Now all the three deployments were successful. And when I try to access my contract in the Truffle console by the contract name of "Token" it picks the last deployment.

See below screenshot. address returns the address of the last deployed contract

enter image description here

So is there a way to access the first two contracts? Or my only option is to create separate solidity files for each like Token1.sol, Token2.sol and Token3.sol and then deploy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.