Skip to content

Commit

Permalink
Create erc20_factory.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 7, 2024
1 parent 12f9c2a commit f28973c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions projects/DAPIO/smart-contracts/ethereum/erc20_factory.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pragma solidity ^0.8.0;

import "https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";

contract ERC20Factory {
mapping (address => ERC20) public tokens;

function createToken(string memory _name, string memory _symbol, uint256 _totalSupply) public {
ERC20 token = new ERC20(_name, _symbol, _totalSupply);
tokens[msg.sender] = token;
}

function getToken(address _owner) public view returns (ERC20) {
return tokens[_owner];
}
}

0 comments on commit f28973c

Please sign in to comment.