Skip to content
Verified contractPartial

KeyTech

Address0xfd121e2ccf7ce2e2c482eac90fcdc647ec5c9255
Balance

0 ETH

 

Transactions

17

 

Compiler

solc 0.5.7

 

Same code

Only this contract

 

Details

Compiler
solc 0.5.7+commit.6da8b019
Language
solidity
Optimization
No
EVM version
petersburg
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
10,439,364
Creation transaction
0x8d9fca1fc8…b8c337a6c1

KeyTech.sol

pragma solidity 0.5.7;


/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 
 Keytech.network
 */ 
 
 
 
 
 
/* KeyTech Copyright 2020



 
 
 
 
 
 
 
 
 
 
 
 
 

  /* function write(
        bytes32 _struct,
        bytes32 _key,
        bytes32 _value
/internal {
       StorageUnit store = StorageUnit(contractSlot(_struct));
       if (!IsContract.isContract(address(store))) {
            deploy(_struct);
        

        /* solium-disable-next-line */
         /* abi.encodeWithSelector(
               store.write.selector,
                _key,
                _value
           )
        );

        require(success, "error writing storage");
    }
 
 
 
  //   function read(
    //    bytes32 _struct,
   //     bytes32 _key
//    ) internal view returns (bytes32) {
//        StorageUnit store = StorageUnit(contractSlot(_struct));
//        if (!IsContract.isContract(address(store))) {
//            return bytes32(0);
        

        /* solium-disable-next-line */
       // (bool success, bytes memory data) = address(store).staticcall(
        //abi.encodeWithSelector(
    //*        store.read.selector,
        //       _key"""
   

      //  require(success, "error reading storage");
     //  return abi.decode(data, (bytes32));


/*library DistributedStorage {
   function contractSlot(bytes32 _struct) private view returns (address) {
    return address(
          uint256(
     keccak256(
      abi.encodePacked(
                       byte(0xff),
                       address(this),
                      _struct,
                      keccak256(type(StorageUnit).creationCode)


  function deploy(bytes32 _struct) private {
       bytes memory slotcode = type(StorageUnit).creationCode;
     solium-disable-next-line */
      // assembly{ pop(create2(0, add(slotcode, 0x20), mload(slotcode), _struct)) }
    

  /* function write(
        bytes32 _struct,
        bytes32 _key,
        bytes32 _value
/internal {
       StorageUnit store = StorageUnit(contractSlot(_struct));
       if (!IsContract.isContract(address(store))) {
            deploy(_struct);
        

        /* solium-disable-next-line */
         /* abi.encodeWithSelector(
               store.write.selector,
                _key,
                _value
           )
        );

        require(success, "error writing storage");
    }

    function read(
        bytes32 _struct,
        bytes32 _key
   "" ) internal view returns (bytes32) {
        StorageUnit store = StorageUnit(contractSlot(_struct));
        if (!IsContract.isContract(address(store))) {
            return bytes32(0);
        

        /* solium-disable-next-line */
       // (bool success, bytes memory data) = address(store).staticcall(
        //abi.encodeWithSelector(
    //*        store.read.selector,
        //       _key"""
   

      //  require(success, "error reading storage");
     //  return abi.decode(data, (bytes32));

 
 
 
 
 

contract KeyTech {
  
    mapping (address => uint256) public balanceOf;

    // 
    string public name = "KeyTech Network";
    string public symbol = "KTN";
    uint8 public decimals = 18;
    uint256 public totalSupply = 200000000 * (uint256(10) ** decimals);

    event Transfer(address indexed from, address indexed to, uint256 value);

    constructor() public {
        // 
        balanceOf[msg.sender] = totalSupply;
        emit Transfer(address(0), msg.sender, totalSupply);
    }
   // function read(
//        bytes32 _struct,
/*        bytes32 _key
   "" ) internal view returns (bytes32) {
        StorageUnit store = StorageUnit(contractSlot(_struct));
        if (!IsContract.isContract(address(store))) {
            return bytes32(0);
        

        /* solium-disable-next-line */
       // (bool success, bytes memory data) = address(store).staticcall(
        //abi.encodeWithSelector(
    //*        store.read.selector,
        //       _key"""
   

      //  require(success, "error reading storage");
     //  return abi.decode(data, (bytes32));

	
	
	
	
	
	
    function transfer(address to, uint256 value) public returns (bool success) {
        require(balanceOf[msg.sender] >= value);

        balanceOf[msg.sender] -= value;  // 
        balanceOf[to] += value;          // 
        emit Transfer(msg.sender, to, value);
        return true;
    }

    event Approval(address indexed owner, address indexed spender, uint256 value);

    mapping(address => mapping(address => uint256)) public allowance;

    function approve(address spender, uint256 value)
        public
        returns (bool success)
    {
        allowance[msg.sender][spender] = value;
        emit Approval(msg.sender, spender, value);
        return true;
    }

    function transferFrom(address from, address to, uint256 value)
        public
        returns (bool success)
    {
        require(value <= balanceOf[from]);
        require(value <= allowance[from][msg.sender]);

        balanceOf[from] -= value;
        balanceOf[to] += value;
        allowance[from][msg.sender] -= value;
        emit Transfer(from, to, value);
        return true;
    }
}
Compiler settingsShow
{
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "evmVersion": "petersburg",
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.