// Some codesol// SPDX-License-Identifier: MIT// Ermine Virtual Miners (EVM) :: https://ermine.pro // âââââââââââââââ$ââââ$$$âââââââââââ$$$ââââââââââââââ$$$âââââââ$$$ââââ// âââââââââââââââââââââ$âââââââââââââ$$ââââââââââââââ$$$ââââââââ$âââââ// ââââââ$$ââââââââââââââââââââââââââââ$âââââââââ$$âââ$$$ââââââââââââââ// ââââââ$$ââââââââââââââââââââââââââââââââââââââ$$ââââ$âââââââââââââââ// âââââââââââ$$ââââââ$âââ$âââââââââ$ââââââââââââââ$âââââââ$âââ$âââ$âââ// âââââââââââ$$ââââââ$$$$$âââââââââ$$âââââââââââââ$$âââââ$$âââ$$$$$âââpragmasolidity ^0.8.17;import"@openzeppelin/contracts/access/Ownable.sol";import"@openzeppelin/contracts/token/ERC1155/ERC1155.sol";import"@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";import"@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol";import"@openzeppelin/contracts/utils/Strings.sol";contractErmineVMisERC1155Supply, Ownable {uint[] public maxAmountEVM =newuint256[](12);uint[] public burnedEVM =newuint256[](12);uint256public timeAddLE;addresspublic addressErmineStore;bool VMpart1 =false;bool VMpart2 =false;stringpublic name;stringpublic symbol; eventBurn(addressindexed from, uint evm_id, uint256 amount);structAdmin {bool sys;}mapping(address=> Admin) public checkAdmin;constructor(stringmemory_uri,stringmemory_name,stringmemory_symbol) ERC1155(_uri) { name = _name; symbol = _symbol; checkAdmin[msg.sender].sys =true; //Mint to the developers' wallet to distribute them to community members for fulfilling certain conditions (competitions)
//100 miners with 1 IPS each_mint(msg.sender,0,100,"");//Setting the maximum number of EVMs for each category maxAmountEVM[0] =1000000; maxAmountEVM[1] =500000; maxAmountEVM[2] =300000; maxAmountEVM[3] =100000; maxAmountEVM[4] =50000; maxAmountEVM[5] =20000; maxAmountEVM[6] =10000; maxAmountEVM[7] =5000; maxAmountEVM[8] =50000; maxAmountEVM[9] =20000; maxAmountEVM[10] =3000; maxAmountEVM[11] =1000;}modifieronlyAdmin() {require(checkAdmin[msg.sender].sys); _; } //EVM mint for Ermine store part 1functionmintEVMforStore() externalonlyOwner {require(addressErmineStore !=address(0),"Ermine store address not specified! Set the store address and try again!");require(!VMpart1,"Virtual miners have already been sent to the Ermine store. Can't be repeated!"); VMpart1 =!VMpart1;_mint(addressErmineStore,0, (maxAmountEVM[0] -100),"");for (uint i =1; i <8; i++) {_mint(addressErmineStore, i, maxAmountEVM[i],"");//Setting the time to transfer VM LE to the Ermine store. VM LE release will be available in 181 days. timeAddLE = block.timestamp +15638400; }}//EVM mint for Ermine store part 2. Available one time. The call is available to everyone.functionmintEVMLEforStore() external {require(block.timestamp >= timeAddLE, "It is not yet possible to ship the EVM LE to the Ermine store. Less than 181 days have passed since the first shipment!");
require(VMpart1,"Release the EVM in the first batch first!");require(!VMpart2,"Virtual miners have already been sent to the Ermine store. Can't be repeated!"); VMpart2 =!VMpart2;for (uint i =8; i <12; i++) {_mint(addressErmineStore, i, maxAmountEVM[i],""); }}//Burning is available to everyonefunctionburnMyEVM(uint evm_id,uint256 amount) external { require(balanceOf(msg.sender, evm_id) >= amount,"You don't have enough EVM to burn them!");_burn(msg.sender, evm_id, amount); burnedEVM[evm_id] += amount;emitBurn(msg.sender, evm_id, amount);}//Set Ermine store address (you can only set the store address once)functionsetErmineStore(address_ErmineStore) externalonlyOwner {require(addressErmineStore ==address(0),"The address of the Ermine store is already set!"); addressErmineStore = _ErmineStore; checkAdmin[addressErmineStore].sys =true;}//Set URIfunctionsetURI(stringmemory newuri) publiconlyAdmin {_setURI(newuri);}//Remove Admin RightsfunctionRemoveAdmin() publiconlyAdmin {require(checkAdmin[msg.sender].sys,"You cannot relinquish admin rights as you are not an admin!"); checkAdmin[msg.sender].sys =!checkAdmin[msg.sender].sys;}//View URIfunctionuri(uint256_id) publicviewoverridereturns (stringmemory) {require(exists(_id),"URI: nonexistent EVM token");returnstring(abi.encodePacked(super.uri(_id), Strings.toString(_id)));}}