1

I am trying to receive the funds into a specific address during mint process. This is my code:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin- 
contracts/blob/master/contracts/token/ERC1155/ERC1155.sol";

contract NFTContract is ERC1155 {
    uint256 public constant Jack = 0;

    constructor() ERC1155("") {
        _mint(msg.sender, Jack, 0, "");
    }

    function mint(address account, uint256 id, uint256 amount) public payable {
        payable(address(0xdD870fA1b7C4700F2BD7f44238821C26f7392148)).transfer(100000000000000000);
        _mint(account, id, amount, "");
    }
}

But I get an error saying:

The transaction has been reverted to the initial state.
Note: The called function should be payable if you send value and the value you send should be less than your current balance.

How do I receive a payment during the mint?

Pro Girl
  • 762
  • 7
  • 21

1 Answers1

0

Just needed to do regular transfer:

addr.transfer(amount)
Pro Girl
  • 762
  • 7
  • 21