DN404Factory

0x37a9fa204a4d3a429fded7e3469ab076c854bc9d

Verification
Verified
v0.8.26+commit.8a97fa7a
Type
Contract
15,565 bytes
ABI entries
7
1 read · 1 write
License
none

Contract information

Address
0x37a9fa204a4d3a429fded7e3469ab076c854bc9d
Chain
Robinhood Chain (4663)
Compiler
v0.8.26+commit.8a97fa7a
Optimization
Enabled
Creation tx
0x33f9d08251…854c09da99

Token

Not a token

This contract does not expose ERC-20 metadata.

Read contract (1)

airlock()address

Events (1)

DN404Created

ABI

[
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "airlock_",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "constructor"
  },
  {
    "inputs": [],
    "name": "InvalidDN404InitialSupply",
    "type": "error"
  },
  {
    "inputs": [],
    "name": "InvalidDN404Unit",
    "type": "error"
  },
  {
    "inputs": [],
    "name": "SenderNotAirlock",
    "type": "error"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "token",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "collection",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "owner",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "initialSupply",
        "type": "uint256"
      }
    ],
    "name": "DN404Created",
    "type": "event"
  },
  {
    "inputs": [],
    "name": "airlock",
    "outputs": [
      {
        "internalType": "contract Airlock",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "initialSupply",
        "type": "uint256"
      },
      {
        "internalType": "address",
        "name": "recipient",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "owner",
        "type": "address"
      },
      {
        "internalType": "bytes32",
        "name": "salt",
        "type": "bytes32"
      },
      {
        "internalType": "bytes",
        "name": "data",
        "type": "bytes"
      }
    ],
    "name": "create",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  }
]

Source code

// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

import { ImmutableAirlock } from "src/base/ImmutableAirlock.sol";
import { ITokenFactory } from "src/interfaces/ITokenFactory.sol";
import { DopplerDN404 } from "src/tokens/DopplerDN404.sol";

error InvalidDN404Unit();
error InvalidDN404InitialSupply();

contract DN404Factory is ITokenFactory, ImmutableAirlock {
    event DN404Created(address indexed token, address indexed collection, address indexed owner, uint256 initialSupply);

    constructor(address airlock_) ImmutableAirlock(airlock_) { }

    function create(
        uint256 initialSupply,
        address recipient,
        address owner,
        bytes32 salt,
        bytes calldata data
    ) external onlyAirlock returns (address) {
        (string memory name, string memory symbol, string memory baseURI, uint256 unit) =
            abi.decode(data, (string, string, string, uint256));

        if (unit == 0) revert InvalidDN404Unit();
        if (initialSupply % unit != 0) revert InvalidDN404InitialSupply();

        DopplerDN404 token =
            new DopplerDN404{ salt: salt }(name, symbol, initialSupply, recipient, owner, baseURI, unit);
        address collection = token.mirrorERC721();

        emit DN404Created(address(token), collection, owner, initialSupply);
        return address(token);
    }
}
Chain explorer6418msChain node97ms