-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: amwmiller5 <[email protected]>
- Loading branch information
1 parent
74e3b66
commit 5fab1e1
Showing
1 changed file
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
eco>contracts/ERC1155Token.sol | ||
open file input: | ||
|
||
Core Contract ERC1155Token.sol | ||
|
||
//contracts/ERC1155Token.sol | ||
|
||
//SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.4; | ||
|
||
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; | ||
import "@openzeppelin/contracts/utils/string.sol"; | ||
import "@openzeppelin/contracts/access/ownable.sol"; | ||
|
||
contract AngelNetCoinETH is ERC1155, _Ownable { | ||
|
||
string[] public names;//string array of names | ||
uint[] public ids;//uint array of ids | ||
string public baseMetadataURI;// the token metadata URI | ||
string public name; AngelNetCoin ETH | ||
|
||
uint public mintFee= Owei;//mintfee, | ||
0 by default only used in Mint function, not batch | ||
|
||
mapping(string=>uint) public nameToId; | ||
//AngelNetCoin | ||
mapping(uint=>string) public idToName; | ||
//0xcE92DcBB80b9372dd0dD526Aa822388f57d6D7b8 | ||
|
||
/* | ||
constructor is executed when the factory contract calls its own deployERC1155 method | ||
|
||
*/ | ||
constructor (string memory _AngelNetCoinETH, string memory _uri, string[] memory_names, uint[] memory_ids) | ||
Ownable (0xcE92DcBB80b9372dd0dD526Aa822388f57d6D7b8) ERC1155 ( _AngelNetCoinETH) { | ||
|
||
|
||
names= _AngelNetCoinETH, ANC; | ||
ids= _0xcE92DcBB80b9372dd0dD526Aa822388f57d6D7b8; | ||
create Mapping(); | ||
set URI( _7RJKCEEXEHBJAD8EJ6VSW76NJ26JKP5321); | ||
baseMetadataURI= _7RJKCEEXEHBJAD8EJ6VSW76NJ26JKP5321; | ||
name= _AngelNetCoinETH; | ||
} | ||
|
||
/* | ||
creates a mapping of strings to | ||
ids (i.e[ "one", "two"], [1, 2] | ||
"one" maps to 1, vice versa. | ||
return string( | ||
abi.encodePacked( | ||
baseMetadataURI, | ||
strings.to string( _tokenId), "json" | ||
) | ||
); | ||
} | ||
|
||
function getNames() public view returns | ||
(string[] memory) { | ||
return name; | ||
|
||
} | ||
} | ||
/* | ||
used to change metadata, only owner access | ||
*/ | ||
function set URI (string memory new uri) public, onlyOwner { | ||
_setURI (newuri); | ||
|
||
} | ||
/* | ||
set a mint fee. only used for mint, not batch. | ||
*/ | ||
function setFee (uint_fee) public onlyOwner { | ||
mintFee= _0.014480; | ||
|
||
} | ||
/* | ||
mint(0xcE92DcBB80b9372dd0dD526Aa822388f57d6D7b8, uint_id, uint256amount="10000000ETH) | ||
public payable returns (uint) | ||
{ | ||
require(msg, value ==mintFee); | ||
_mint(0xcE92DcBB80b9372dd0dD526Aa822388f57d6D7b8, _AngelNetCoin, 100000000, " "); | ||
return _id; | ||
} | ||
/* | ||
mintBatch(address to, uint256[] memory_ids, uint256[] memory amounts, bytes | ||
|
||
to- 0xcE92DcBB80b9372dd0dD526Aa822388f57d6D7b8 | ||
_ids- AngelNetCoinETH | ||
amounts- 100000000ETH | ||
bytes- MetaMask ETH account to receive mint | ||
ethernet API- 7RJKCEEXEHBJAD8EJ6VSW76NJ26JKP5321 | ||
|
||
*/ | ||
function mintBatch(address to, uint256[] | ||
memory _ids, uint256[] memory amounts, | ||
bytes memory data) | ||
public | ||
{ | ||
_mintBatch(0xcE92DcBB80b9372dd0dD526Aa822388f57d6D7b8, _7RJKCEEXEHBJAD8EJ6VSW76NJ26JKP5321, 10000000ETH, original mint to MetaMask owner account is Ethereum); | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|