ETH Price: $2,057.35 (-3.23%)

Contract

0xCc024f63F5fDa6568CD5b5Df2BB736683B0cc497
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Advanced mode:
Parent Transaction Hash Method Block
From
To
View All Internal Transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x4309bD23...D55cc39A7
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
CreatorSpaceFacet105

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 5000 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity Multiple files format)

File 1 of 14: CreatorSpaceFacet105.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {KomonERC1155} from "KomonERC1155.sol";
import {Modifiers} from "Modifiers.sol";

contract CreatorSpaceFacet105 is KomonERC1155, Modifiers {
    function removeLastSpaceToken() external onlyKomonWeb {
        _removeLastSpaceToken();
    }
}

File 2 of 14: Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity 0.8.17;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
  struct Counter {
    // This variable should never be directly accessed by users of the library: interactions must be restricted to
    // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
    // this feature: see https://github.com/ethereum/solidity/issues/4637
    uint256 _value; // default: 0
  }

  function current(Counter storage counter) internal view returns (uint256) {
    return counter._value;
  }

  function increment(Counter storage counter) internal {
    unchecked {
      counter._value += 1;
    }
  }

  function decrement(Counter storage counter) internal {
    uint256 value = counter._value;
    require(value > 0, "Counter: decrement overflow");
    unchecked {
      counter._value = value - 1;
    }
  }
}

File 3 of 14: EnumerableSet.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

/**
 * @title Set implementation with enumeration functions
 * @dev derived from https://github.com/OpenZeppelin/openzeppelin-contracts (MIT license)
 */
library EnumerableSet {
  struct Set {
    bytes32[] _values;
    // 1-indexed to allow 0 to signify nonexistence
    mapping(bytes32 => uint256) _indexes;
  }

  struct Bytes32Set {
    Set _inner;
  }

  struct AddressSet {
    Set _inner;
  }

  struct UintSet {
    Set _inner;
  }

  function at(AddressSet storage set, uint256 index) internal view returns (address) {
    return address(uint160(uint256(_at(set._inner, index))));
  }

  function at(UintSet storage set, uint256 index) internal view returns (uint256) {
    return uint256(_at(set._inner, index));
  }

  function length(AddressSet storage set) internal view returns (uint256) {
    return _length(set._inner);
  }

  function length(UintSet storage set) internal view returns (uint256) {
    return _length(set._inner);
  }

  function add(AddressSet storage set, address value) internal returns (bool) {
    return _add(set._inner, bytes32(uint256(uint160(value))));
  }

  function add(UintSet storage set, uint256 value) internal returns (bool) {
    return _add(set._inner, bytes32(value));
  }

  function remove(AddressSet storage set, address value) internal returns (bool) {
    return _remove(set._inner, bytes32(uint256(uint160(value))));
  }

  function remove(UintSet storage set, uint256 value) internal returns (bool) {
    return _remove(set._inner, bytes32(value));
  }

  function _at(Set storage set, uint256 index) private view returns (bytes32) {
    require(set._values.length > index, "EnumerableSet: index out of bounds");
    return set._values[index];
  }

  function _contains(Set storage set, bytes32 value) private view returns (bool) {
    return set._indexes[value] != 0;
  }

  function _length(Set storage set) private view returns (uint256) {
    return set._values.length;
  }

  function _add(Set storage set, bytes32 value) private returns (bool) {
    if (!_contains(set, value)) {
      set._values.push(value);
      set._indexes[value] = set._values.length;
      return true;
    } else {
      return false;
    }
  }

  function _remove(Set storage set, bytes32 value) private returns (bool) {
    uint256 valueIndex = set._indexes[value];

    if (valueIndex != 0) {
      unchecked {
        bytes32 last = set._values[set._values.length - 1];

        // move last value to now-vacant index

        set._values[valueIndex - 1] = last;
        set._indexes[last] = valueIndex;
      }
      // clear last index

      set._values.pop();
      delete set._indexes[value];

      return true;
    } else {
      return false;
    }
  }
}

File 4 of 14: ERC1155Base.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {IERC1155} from "IERC1155.sol";
import {IERC1155Base} from "IERC1155Base.sol";
import {ERC1155BaseStorage} from "ERC1155BaseStorage.sol";

/**
 * @title Base ERC1155 contract
 * @dev derived from https://github.com/OpenZeppelin/openzeppelin-contracts/ (MIT license)
 */
abstract contract ERC1155Base is IERC1155Base {
    /**
     * @notice gets the creator address owner of a token
     * @param tokenId token id
     * @return address as creator address owner
     */
    function creatorTokenOwner(uint256 tokenId)
        internal
        view
        returns (address)
    {
        return ERC1155BaseStorage.layout().tokenInfo[tokenId].creatorAccount;
    }

    /**
     * @notice removes last created token if there's no minted keys
     * @param tokenId token id
     */
    function removeTokenData(uint256 tokenId) internal {
        address creatorAddress = creatorTokenOwner(tokenId);
        ERC1155BaseStorage.Layout storage lay = ERC1155BaseStorage.layout();

        lay.creatorTokens[creatorAddress].pop();
        delete (lay.tokenInfo[tokenId]);
    }
}

File 5 of 14: ERC1155BaseStorage.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

library ERC1155BaseStorage {
  struct Layout {
    mapping(uint256 => mapping(address => uint256)) balances;
    mapping(address => mapping(address => bool)) operatorApprovals;
    mapping(uint256 => TokenData) tokenInfo;
    mapping(address => uint256[]) creatorTokens;
  }

  struct TokenData {
    uint256 tokenPrice;
    uint256 maxSupply;
    uint8 percentage;
    address creatorAccount;
  }

  bytes32 internal constant STORAGE_SLOT = keccak256("komon.contracts.storage.ERC1155Base");

  function layout() internal pure returns (Layout storage lay) {
    bytes32 slot = STORAGE_SLOT;
    assembly {
      lay.slot := slot
    }
  }
}

File 6 of 14: ERC1155Enumerable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {ERC1155EnumerableInternal} from "ERC1155EnumerableInternal.sol";
import {Counters} from "Counters.sol";

/**
 * @title ERC1155 implementation including enumerable and aggregate functions
 */
abstract contract ERC1155Enumerable is ERC1155EnumerableInternal {
    using Counters for Counters.Counter;

    Counters.Counter public _tokenIds;

    function totalSupply(uint256 id) internal view returns (uint256) {
        return _totalSupply(id);
    }

    function decreaseTokenIdCount() internal {
        _tokenIds.decrement();
    }

    function currentTokenId() internal view returns (uint256) {
        return _tokenIds.current();
    }
}

File 7 of 14: ERC1155EnumerableInternal.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {ERC1155EnumerableStorage} from "ERC1155EnumerableStorage.sol";

/**
 * @title ERC1155Enumerable internal functions
 */
abstract contract ERC1155EnumerableInternal {
    /**
     * @notice query total minted supply of given token
     * @param id token id to query
     * @return token supply
     */
    function _totalSupply(uint256 id) internal view virtual returns (uint256) {
        return ERC1155EnumerableStorage.layout().totalSupply[id];
    }
}

File 8 of 14: ERC1155EnumerableStorage.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {EnumerableSet} from "EnumerableSet.sol";

library ERC1155EnumerableStorage {
    struct Layout {
        mapping(uint256 => uint256) totalSupply;
        mapping(uint256 => EnumerableSet.AddressSet) accountsByToken;
        mapping(address => EnumerableSet.UintSet) tokensByAccount;
    }

    bytes32 internal constant STORAGE_SLOT =
        keccak256("komon.contracts.storage.ERC1155Enumerable");

    function layout() internal pure returns (Layout storage lay) {
        bytes32 slot = STORAGE_SLOT;
        assembly {
            lay.slot := slot
        }
    }
}

File 9 of 14: IERC1155.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

/**
 * @title ERC1155 interface
 * @dev see https://github.com/ethereum/EIPs/issues/1155
 */
interface IERC1155 {

}

File 10 of 14: IERC1155Base.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {IERC1155} from "IERC1155.sol";

/**
 * @title ERC1155 base interface
 */
interface IERC1155Base is IERC1155 {

}

File 11 of 14: IKomonERC1155.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {IERC1155Base} from "IERC1155Base.sol";

interface IKomonERC1155 is IERC1155Base {
    event RemovedLastCreatedToken(uint256 tokenId);
}

File 12 of 14: KomonAccessControlBaseStorage.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

library KomonAccessControlBaseStorage {
  bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
  bytes32 public constant KOMON_WEB_ROLE = keccak256("KOMON_WEB_ROLE");
  bytes32 public constant CREATOR_ROLE = keccak256("CREATOR_ROLE");

  struct Layout {
    mapping(bytes32 => RoleData) _roles;
    mapping(uint256 => address) creatorTokens;
    address _komonExchangeAccount;
    address _assetsToKomonAccount;
  }

  struct RoleData {
    mapping(address => bool) members;
    bytes32 adminRole;
  }

  bytes32 internal constant STORAGE_SLOT = keccak256("komon.contracts.access.storage.KomonAccessControlBase");

  function layout() internal pure returns (Layout storage lay) {
    bytes32 slot = STORAGE_SLOT;
    assembly {
      lay.slot := slot
    }
  }

  function hasKomonWebRole(address account) internal view returns (bool) {
    return hasRole(KOMON_WEB_ROLE, account);
  }

  function hasRole(bytes32 role, address account) internal view returns (bool) {
    return KomonAccessControlBaseStorage.layout()._roles[role].members[account];
  }

  function hasAdminRole(address account) internal view returns (bool) {
    return hasRole(DEFAULT_ADMIN_ROLE, account);
  }
}

File 13 of 14: KomonERC1155.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {ERC1155Base} from "ERC1155Base.sol";
import {ERC1155Enumerable} from "ERC1155Enumerable.sol";
import {ERC1155EnumerableInternal} from "ERC1155EnumerableInternal.sol";
import {IKomonERC1155} from "IKomonERC1155.sol";
import {KomonAccessControlBaseStorage} from "KomonAccessControlBaseStorage.sol";

/**
 * @title Komon ERC1155 implementation
 */
abstract contract KomonERC1155 is
    IKomonERC1155,
    ERC1155Base,
    ERC1155Enumerable
{
    function _removeLastSpaceToken() internal {
        uint256 tokenId = currentTokenId();
        require(
            totalSupply(tokenId) == 0,
            "There are keys minted for the last token."
        );

        removeTokenData(tokenId);

        decreaseTokenIdCount();
        emit RemovedLastCreatedToken(tokenId);
    }
}

File 14 of 14: Modifiers.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {KomonAccessControlBaseStorage} from "KomonAccessControlBaseStorage.sol";

contract Modifiers {
    modifier onlyKomonWeb() {
        require(
            KomonAccessControlBaseStorage.hasKomonWebRole(msg.sender) ||
                KomonAccessControlBaseStorage.hasAdminRole(msg.sender),
            "Restricted to komon web role."
        );
        _;
    }
}

Contract Security Audit

Contract ABI

API
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"RemovedLastCreatedToken","type":"event"},{"inputs":[],"name":"_tokenIds","outputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"removeLastSpaceToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]

0x608060405234801561001057600080fd5b506104c1806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80632a6ec3d61461003b578063aa46a40014610045575b600080fd5b610043610061565b005b60005461004f9081565b60405190815260200160405180910390f35b61006a336100ee565b8061007957506100793361013d565b6100e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f5265737472696374656420746f206b6f6d6f6e2077656220726f6c652e00000060448201526064015b60405180910390fd5b6100ec61018a565b565b73ffffffffffffffffffffffffffffffffffffffff811660009081527f80beb1d6fb2b8a34675f866fff60f0865ed5674d7fc37595b65df2bec9dd36ab602052604081205460ff165b92915050565b73ffffffffffffffffffffffffffffffffffffffff811660009081527f1d49987b2d3efaa110ccf977a126005224562f803ada128845faa72cbf553f32602052604081205460ff16610137565b6000546101968161026a565b15610223576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f546865726520617265206b657973206d696e74656420666f7220746865206c6160448201527f737420746f6b656e2e000000000000000000000000000000000000000000000060648201526084016100db565b61022c8161029d565b6102346103c8565b6040518181527f1ac0dcfe4dea11d36d72bdd2f13b6560de5d5ae5e27f97a71611375165d345db9060200160405180910390a150565b60008181527fbf7ebbddc1db5ecad3e079ff613e7413e5acb2be3ace42feff7eafa93094ce896020526040812054610137565b60008181527f84c2a457090ae1d596dd8675789459cf2536444ab291cf7012315fde41b8fdb06020908152604080832060020154610100900473ffffffffffffffffffffffffffffffffffffffff168084527f84c2a457090ae1d596dd8675789459cf2536444ab291cf7012315fde41b8fdb190925290912080547f84c2a457090ae1d596dd8675789459cf2536444ab291cf7012315fde41b8fdae9190806103485761034861045c565b6000828152602080822083017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810183905590920190925593815260029182019093526040832083815560018101939093559190910180547fffffffffffffffffffffff00000000000000000000000000000000000000000016905550565b6100ec6000805480610436576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f436f756e7465723a2064656372656d656e74206f766572666c6f77000000000060448201526064016100db565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea2646970667358221220c22ea61548c6b12b876441c8e9055f9b40c83e80b27dd2ddbf749b353ec5311564736f6c63430008110033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100365760003560e01c80632a6ec3d61461003b578063aa46a40014610045575b600080fd5b610043610061565b005b60005461004f9081565b60405190815260200160405180910390f35b61006a336100ee565b8061007957506100793361013d565b6100e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f5265737472696374656420746f206b6f6d6f6e2077656220726f6c652e00000060448201526064015b60405180910390fd5b6100ec61018a565b565b73ffffffffffffffffffffffffffffffffffffffff811660009081527f80beb1d6fb2b8a34675f866fff60f0865ed5674d7fc37595b65df2bec9dd36ab602052604081205460ff165b92915050565b73ffffffffffffffffffffffffffffffffffffffff811660009081527f1d49987b2d3efaa110ccf977a126005224562f803ada128845faa72cbf553f32602052604081205460ff16610137565b6000546101968161026a565b15610223576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f546865726520617265206b657973206d696e74656420666f7220746865206c6160448201527f737420746f6b656e2e000000000000000000000000000000000000000000000060648201526084016100db565b61022c8161029d565b6102346103c8565b6040518181527f1ac0dcfe4dea11d36d72bdd2f13b6560de5d5ae5e27f97a71611375165d345db9060200160405180910390a150565b60008181527fbf7ebbddc1db5ecad3e079ff613e7413e5acb2be3ace42feff7eafa93094ce896020526040812054610137565b60008181527f84c2a457090ae1d596dd8675789459cf2536444ab291cf7012315fde41b8fdb06020908152604080832060020154610100900473ffffffffffffffffffffffffffffffffffffffff168084527f84c2a457090ae1d596dd8675789459cf2536444ab291cf7012315fde41b8fdb190925290912080547f84c2a457090ae1d596dd8675789459cf2536444ab291cf7012315fde41b8fdae9190806103485761034861045c565b6000828152602080822083017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810183905590920190925593815260029182019093526040832083815560018101939093559190910180547fffffffffffffffffffffff00000000000000000000000000000000000000000016905550565b6100ec6000805480610436576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f436f756e7465723a2064656372656d656e74206f766572666c6f77000000000060448201526064016100db565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea2646970667358221220c22ea61548c6b12b876441c8e9055f9b40c83e80b27dd2ddbf749b353ec5311564736f6c63430008110033

Deployed Bytecode Sourcemap

146:159:1:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;209:94;;;:::i;:::-;;369:33:4;;;;;;;;;;160:25:14;;;148:2;133:18;369:33:4;;;;;;;209:94:1;219:57:13;265:10;219:45;:57::i;:::-;:131;;;;296:54;339:10;296:42;:54::i;:::-;198:207;;;;;;;398:2:14;198:207:13;;;380:21:14;437:2;417:18;;;410:30;476:31;456:18;;;449:59;525:18;;198:207:13;;;;;;;;;273:23:1::1;:21;:23::i;:::-;209:94::o:0;819:121:11:-;1034:68;;;884:4;1034:68;;;:51;;:68;:51;:68;;;;;903:32;896:39;819:121;-1:-1:-1;;819:121:11:o;1111:122::-;1034:68;;;1173:4;1034:68;;;:51;;:68;:51;:68;;;;;1192:36;944:163;508:331:12;560:15;891:14:0;625:20:12;891:14:0;625:11:12;:20::i;:::-;:25;604:113;;;;;;;756:2:14;604:113:12;;;738:21:14;795:2;775:18;;;768:30;834:34;814:18;;;807:62;905:11;885:18;;;878:39;934:19;;604:113:12;554:405:14;604:113:12;728:24;744:7;728:15;:24::i;:::-;763:22;:20;:22::i;:::-;800:32;;160:25:14;;;800:32:12;;148:2:14;133:18;800:32:12;;;;;;;550:289;508:331::o;409:105:4:-;465:7;460:49:5;;;408:54:6;460:49:5;;;;;;491:16:4;369:147:5;848:287:2;909:22;659:46;;;:37;:46;;;;;;;;:37;:61;;;;;;;1048:33;;;:17;:33;;;;;;:39;;499:48:3;;1048:33:2;:39;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;1105:22;;;:13;;;;:22;;;;;;1097:31;;;1048:39;1097:31;;;;;;;;;;;;;;;;-1:-1:-1;848:287:2:o;520:79:4:-;571:21;:9;1100:14:0;;1128:9;1120:49;;;;;;;1355:2:14;1120:49:0;;;1337:21:14;1394:2;1374:18;;;1367:30;1433:29;1413:18;;;1406:57;1480:18;;1120:49:0;1153:351:14;1120:49:0;1210:9;;1193:26;;1025:205::o;964:184:14:-;1016:77;1013:1;1006:88;1113:4;1110:1;1103:15;1137:4;1134:1;1127:15

Swarm Source

ipfs://c22ea61548c6b12b876441c8e9055f9b40c83e80b27dd2ddbf749b353ec53115

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.