0

我有这段代码:

function mint(uint amount) public payable {
    require(amount <= 10, "token: max of 10 token per mint");
    require(_openMint == true, "token: minting is closed");
    require(msg.value == _price*amount, "token: must send correct price");
    require(_tokenIdTracker.current() + amount <= _max, "token: not enough token left to be mint amount");
    for(uint i = 0; i < amount; i++) {
      _mint(msg.sender, _tokenIdTracker.current());
      _tokenIdTracker.increment();
    }
    IERC20("0x0789fF5bA37f72ABC4D561D00648ac0000970000").safeTransferFrom(msg.sender, owner(), amount);
  }

它用另一个 ERC20 代币支付了一个 ERC721 代币,我需要知道发送了多少 ERC20。有没有办法做到这一点?

4

1 回答 1

0

如果你想知道每笔交易发送的代币数量,你只需要去etherscan,搜索合约地址,然后点击“mint”的交易哈希

如果您想知道发送的所有金额,您必须使用一些工具,例如 thegraph.com

于 2021-10-10T17:31:46.857 回答