Ultimate NFT Programming Tutorial - transact pending

Hello guys,

After compiling “NFTcontract” i get stuck.

  • Deploying with the “Deploy” button, result in the console : creation of NFTcontract pending…
  • Deploying with “At Address : 0x…” : The contract is deployed but when i use balanceOf, mint function i get : transact to NFTcontract.mint pending …

The only difference i have find is i compile “IERC1155.sol” but if i follow the course, it should be “Opensea_nft.sol”

pragma solidity ^0.8.0;

import "@openzeppelin/[email protected]/token/ERC1155/ERC1155.sol";
import "@openzeppelin/[email protected]/access/Ownable.sol";

contract NFTcontract is ERC1155, Ownable {

    uint256 public constant ARTWORK = 0;
    uint256 public constant PHOTO = 2;
    
    constructor() ERC1155("") {
        _mint(msg.sender, ARTWORK, 1, "");
        _mint(msg.sender, PHOTO, 2, "");
    }

    function mint(address account, uint256 id, uint256 amount) public onlyOwner {
        _mint(account, id, amount, "");
    }

    function burn(address account, uint256 id, uint256 amount) public {
        require(msg.sender == account);
        _burn(account, id, amount);
    }
}

Any idea, ressources to debug ? Thank you guys.

you can deploy multiple contracts that you have in your source code, you’ll have to select the right one that you want to deploy. you can also look in block explorer to see what happened with the transactions that you sent.

1 Like
  • Thanks, I compiled via right click on the file > Compile
  • Yep, Etherscan is a great resource. Thanks for the advice man :slight_smile:

Have a good day

1 Like