Bitcoin Forum
June 17, 2024, 01:23:08 AM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Poll
Question: Create a Smart contract with different tokens
Smart contracts - 0 (0%)
dAPP - 0 (0%)
Total Voters: 0

Pages: [1]
  Print  
Author Topic: Smart Contracts  (Read 135 times)
jordigm92 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
July 19, 2018, 03:28:15 PM
 #1

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,

jordigm92 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
July 20, 2018, 10:02:24 AM
 #2

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,
DriveDeal.io
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
July 20, 2018, 10:37:08 AM
 #3

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(...)
  }
}
jordigm92 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
July 20, 2018, 03:13:59 PM
 #4

Hello,

Ok, thank you very much.

Best regards,
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!