I know how to pass an ETH address to the constructor in truffle. What is the best way to do it in Remix?

Say contract A is in Remix to create Tokens and contract B (another solidity file) is the actual Crowdsale contract.

What is the best way to send the contract address that is generated when you compile the token contract to the crowdsale's constructor?

For example here is my Constructor:

function Crowdsale(address _tokenAddress) {
    require(_tokenAddress !=0);
    token = Token(_tokenAddress);

I In truffle you pass it in to the 2_deploy_contracts.js file. How would the same be done in Remix?


Remix will see the constructor needs an argument so it will put a field next to the Create button, in this case labeled _tokenAddress.

Put the token contract address there, in quotes.

In case it isn't clear, deploy the token contract first and copy the deployed address to the clipboard and then paste into Crowdsale's Create (constructor) function.

Hope it helps.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.