I created an ERC-20 contract below. Testing on the Remix London works great. I'm able to mint 1,000,000 tokens and using the tools I can verify the balance on the account.
Next I deploy successfully to Polygon via Remix / Metamask. When I use the same Mint function in Remix, the Mint goes through via Metamask, but the contract mints 0.000000000001 tokens. My brain has melted and I would greatly appreciate feedback, examples or any other help.
https://polygonscan.com/token/0xca47a0513fe65314d018ae3d4c5c786a8b04ab52?a=0x040B7eD99550906E879C86b3930bb8033D4568bf
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Snapshot.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20FlashMint.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Capped.sol";
contract Caffeine is ERC20, ERC20Burnable, ERC20Snapshot, Ownable, Pausable, ERC20Permit, ERC20Votes, ERC20FlashMint, ERC20Capped {
constructor() ERC20("Caffeine", "CAFFN") ERC20Permit("Caffeine") ERC20Capped(2748986301){}
function snapshot() public onlyOwner {
_snapshot();
}
function pause() public onlyOwner {
_pause();
}
function unpause() public onlyOwner {
_unpause();
}
function _mint(address account, uint256 amount) internal override(ERC20, ERC20Capped, ERC20Votes) {
require(totalSupply() + amount <= cap(), "ERC20Capped: cap exceeded");
super._mint(account, amount);
}
function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
function _beforeTokenTransfer(address from, address to, uint256 amount)
internal
whenNotPaused
override(ERC20, ERC20Snapshot)
{
super._beforeTokenTransfer(from, to, amount);
}
// The following functions are overrides required by Solidity.
function _afterTokenTransfer(address from, address to, uint256 amount)
internal
override(ERC20, ERC20Votes)
{
super._afterTokenTransfer(from, to, amount);
}
function _burn(address account, uint256 amount)
internal
override(ERC20, ERC20Votes)
{
super._burn(account, amount);
}
}