Skip to content

Error From Testing ERC-721 Contract Mint Function #964

Answered by ChiHaoLu
ChiHaoLu asked this question in Help
Discussion options

You must be logged in to vote

I solved it: need to implement the _checkOnERC721Received in the test contract:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "ds-test/test.sol";
import '../Contract.sol';

contract CarManTest is DSTest {
  CarMan carman;
  address DEPLOYER_ADDRESS;
  address[] temp;
  
  // The state of the contract gets reset before each
  // test is run, with the `setUp()` function being called
  // each time after deployment. Think of this like a JavaScript
  // `beforeEach` block
  function setUp() public {
    carman = new CarMan("CarMan_Metaverse", "CMM", "ipfs://QmYvJEw4LHBpaehH6mYZV9YXC372QSWL4BPFVJvUkKqRCg/", "ipfs://.../");
    DEPLOYER_ADDRESS = carman.owner();
  }

  function

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by onbjerg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant