Discover more of Etherscan's tools and services in one place.
Sponsored
Contract Source Code:
File 1 of 1 : DMOMinter.sol<i class='far fa-question-circle text-muted ms-2' data-bs-trigger='hover' data-bs-toggle='tooltip' data-bs-html='true' data-bs-title='Click on the check box to select individual contract to compare. Only 1 contract can be selected from each side.'></i>
// SPDX-License-Identifier: MIT pragma solidity >=0.8.9 <0.9.0; interface IDMOCollection { function mint(uint256 _amount) external payable; function safeTransferFrom(address from, address to, uint256 tokenId) external payable; function totalSupply() external view returns (uint256); } interface IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } contract DMOMinter is IERC721Receiver { IDMOCollection private tokenContract = IDMOCollection(0xa275Cf78325EdCbE081b7bFeff9Ce3955fFEd3F8); bytes4 private constant _ERC721_RECEIVED = 0x150b7a02; /** * @dev Mint tokens to another address * @param _amount the amount of tokens to mint * @param _address the recipient address of the minted tokens */ function mint(uint256 _amount, address _address) external payable { uint256 _lastTokenID = tokenContract.totalSupply(); tokenContract.mint{value: msg.value}(_amount); for(uint256 i = 0; i < _amount; i++) { tokenContract.safeTransferFrom(address(this), _address, _lastTokenID + i); } } /** * @dev Handle the receipt of an NFT * @param operator The address which called `safeTransferFrom` function * @param from The address which previously owned the token * @param tokenId The NFT identifier which is being transferred * @param data Additional data with no specified format * @return bytes4 `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external override returns (bytes4) { return _ERC721_RECEIVED; } }
Please enter a contract address above to load the contract details and source code.
Please DO NOT store any passwords or private keys here. A private note (up to 100 characters) can be saved and is useful for transaction tracking.
My Name Tag:
Private Note:
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.