Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: jordigm92 on July 19, 2018, 03:28:15 PM



Title: Smart Contracts
Post by: jordigm92 on July 19, 2018, 03:28:15 PM
Hello,

Is it posible to create and smart contract that manage different tokens. For example I create 3 tokens, can i create a smart contract that manage this 3 tokens? Could be different smart contracts (token smart contract) and after that i have to import to other smart contract?

Thanks.

Best regards,



Title: Re: Smart Contracts
Post by: jordigm92 on July 20, 2018, 10:02:24 AM
Hello,

I want to use Ethereum and ERC20 , ERC721 tokens.

Using it, I think that is it posible.

What do you think?

Thanks.

Best regards,


Title: Re: Smart Contracts
Post by: DriveDeal.io on July 20, 2018, 10:37:08 AM
Yes, it's totally possible.
Your contract can interact with any number of tokens, there's no limitation on that. You can hold references for all of them or just receive the address and do something 'on the go'. Something like that:

Code:
pragma solidity ^0.4.23;

import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";

contract Contract {

  function doSomethingWithAnyERC20Token(ERC20 _token) public {
    _token.transfer(...)
  }
}


Title: Re: Smart Contracts
Post by: jordigm92 on July 20, 2018, 03:13:59 PM
Hello,

Ok, thank you very much.

Best regards,