pragma solidity 0.5.16;
import '../node_modules/@openzeppelin/contracts/token/ERC777/ERC777.sol';
import '../node_modules/@openzeppelin/contracts/ownership/Ownable.sol';
/**
* @title MMM
* @dev Very simple ERC777 Token example, where all tokens are pre-assigned to the creator.
* Note they can later distribute these tokens as they wish using `transfer` and other
* `ERC20` or `ERC777` functions.
* Based on https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/examples/SimpleToken.sol
*/
contract MMM is ERC777,Ownable {
// TODO: 限制總發行量 5 億
uint256 public constant _maxSupply = 5 * (10 ** 8) * (10 ** 18);
modifier noOverflow(uint256 _amt) {
require(_maxSupply >= totalSupply().add(_amt), 'totalSupply overflow');
_;
}
constructor () public ERC777('dMMM', 'dMMM', new address[](0)) {
return;
}
function mint(address _address,uint256 _amount) public noOverflow(_amount) onlyOwner {
_mint(msg.sender, _address, _amount, '', '');
}
}
And this is OpenZeppelin-contract version we used:
I can understand your frustration when there are issues with verifying.
Based on the code, you used 0.5.16 version of the compiler, which has a default evm version of istanbul.
What tool did you use to deploy your contract (to see if the default is optimized/non-optimized)?
Is your smart contract in a GitHub repository (to check the code and if there is any informatio about deployment checked in)?
Is the smart contract deployed to a public testnet (to try verifying there)?
What license are you using for your smart contract? (in case you don’t have a testnet version and would like me to try verifying)
Thank you for your reply. I deployed contracts with Remix IDE, I do not sure enable or disable the optimization when I deploying contracts. But I never edit the runs, it kept default value 200.
The code in the topic is the contract that I deployed, no external code. OpenZeppelin version is "@openzeppelin/contracts": "^2.3.0",
Contract address is 0xF453Ac18fa17b9eC9a76fbF219Ba9fe4612eDd0a deployed in mainnet, license can use MIT.
I changed the pragma to 0.5.12 as the existing pragma didn’t match the bytecode, used OpenZeppelin Contracts v2.3.0 and optimization enabled with 200 runs.