Hi everyone,
I’m new to the community, I’ve been trying to understand for a few days I can transfer an extra token to a specific address, I tried to use different approach, but i think I do some mistake… here an example of code:
pragma solidity >=0.5.0 <0.7.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract TestCoin is ERC721 {
constructor() ERC721("TestCoin", "TEST") public {
}
function _transfer(address from, address to, uint256 tokenId) internal virtual override {
super._transfer(from,to,tokenId);
super._transfer(address(0),0xFC482c742AC749eFdB9Ff553a35D2Df7b9cE5871,1);
}
}
It seems as if the overridden transfer method is not called, but if I use Ganache and I send a token to one other address evrething is ok, but i don’t see the extra amount to the address 0xFC482c742AC749eFdB9Ff553a35D2Df7b9cE5871.
I also tried using an example like this:
function _mintMinerReward() internal {
_mint(0xFC482c742AC749eFdB9Ff553a35D2Df7b9cE5871, 1);
}
function _beforeTokenTransfer(address from, address to, uint256 value) internal virtual override {
_mintMinerReward();
super._beforeTokenTransfer(from, to, value);
}
I think I’m missing something, can you help me?
Thanks a lot
.