interface token {
       function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);}

contract CampaignFactory{    token public token_instance;
    constructor() public payable{
         token_instance = token(token_address);}

    function createCampaign() public payable{
        address newCampaign = address((new Campaign).value(msg.value)(deposit, ll, token_address, 1, your));

contract Campaign{
    token public tokenReward;

    constructor (uint depositInWei, address ll, address addressOfTokenUsed, uint weiCostOfEachToken, address your) public payable{
        tokenReward.transferFrom(0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c, your, msg.value/price);

I've just provided the format of my code. I want to know from which address the function 'tokenReward.transferFrom()' of 'Campaign' constructor is called? You don't need to go in depth of the code that's why I've just provided the structure.

1 Answer 1


tokenReward.transferFrom() us called from Campaign. From the perspective of tokenReward, msg.sender is Campaign.

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.