Hi, abcoathup
Question 1:
Error: Truffle is currently using solc 0.5.12, but one or more of your contracts specify “pragma solidity ^0.4.17”.
Should I change the 0.5.12 in the coinfig file to 0.4.17,so,Where is the config file,I couldn’t find it.I even don’t know it’s name.
Question 2:
is there a contract sample for creating Tokens for a exist ERC721 contract I have made before? Better to tell me which and where the code should be change.
I would recommend (if they aren't already deployed) to upgrade your contracts to Solidity 0.5 due to the number of improvements made in the compiler
I assume your existing ERC721 has a minting function. So I am not sure what you are after. If you can, it would be good if you could share your smart contract code.
I am using the ERC721Full.sol of openzeppelin,maybe should I modify the contract file ERC721Mintable.sol and deploy it ? the question is where should I modify it.
Assuming that you want metadata associated with your token, then you may also want to inherit from ERC721MetadataMintable. So that you could call mintWithTokenURI.
If you need different functionality, you should inherit from the OpenZeppelin contract and override any required functionality rather than modifying the OpenZeppelin contract.
The following is a SimpleERC721 (with GitHub imports) that you could use to play around with on Remix. When using on Truffle you would need to change the imports to "@openzeppelin/contracts/..."
pragma solidity ^0.5.5;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.4.0/contracts/token/ERC721/ERC721Full.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.4.0/contracts/token/ERC721/ERC721MetadataMintable.sol";
contract SimpleERC721 is ERC721Full, ERC721MetadataMintable {
constructor() ERC721Full("Token", "TKN") public {
}
}
So,how to call it out?
I don’t know if this right,First I should use the call function in DEBUG TOOLS FOR REMIX PLUGINS,and fill in the 3 blanks with plugin name,function name and function args?
what is plugin name,function name and function args?
pragma solidity ^0.5.0;
import "./ERC721Metadata.sol";
import "../../access/roles/MinterRole.sol";
/**
* @title ERC721MetadataMintable
* @dev ERC721 minting logic with metadata.
*/
contract ERC721MetadataMintable is ERC721, ERC721Metadata, MinterRole {
/**
* @dev Function to mint tokens.
* @param to The address that will receive the minted tokens.
* @param tokenId The token id to mint.
* @param tokenURI The token URI of the minted token.
* @return A boolean that indicates if the operation was successful.
*/
function mintWithTokenURI(address to, uint256 tokenId, string memory tokenURI) public onlyMinter returns (bool) {
_mint(to, tokenId);
_setTokenURI(tokenId, tokenURI);
return true;
}
}
could I mine it with the contract above? do you have an Examples of this code,so I can mine it with it.
Very nice,I have mined 1 token already by following your guidance.
Thank you very much.@abcoathup
if I ask one more question,could I mine out more than one token in one time?