Developers Forum for XinFin XDC Network

Minisoft
Minisoft

Posted on

Contract Verfication Not Working on XDC Mainnet

Unable to verify contract on XDC Mainnet, while the same contract is getting deployed on Testnet and Verification works.

Scenario: Using Remix to Deploy ERC20 Contract, Following is the SmartContract.

// SPDX-License-Identifier: MIT
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity ^0.8.0;`

import {AccessControl} from "@openzeppelin/contracts@5.3.0/access/AccessControl.sol";
import {ERC20} from "@openzeppelin/contracts@5.3.0/token/ERC20/ERC20.sol";
import {ERC20Burnable} from "@openzeppelin/contracts@5.3.0/token/ERC20/extensions/ERC20Burnable.sol";

/// @custom:security-contact nuvowalletio@outlook.com
contract tokenise000020 is ERC20, ERC20Burnable, AccessControl {

    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");

    constructor(address admin, address minter, string memory name, string memory ticker)
        ERC20(name, ticker)
    {
        _grantRole(DEFAULT_ADMIN_ROLE, admin);
        _grantRole(MINTER_ROLE, minter);
    }

    function TokenMint(address credit, uint256 amount) public onlyRole(MINTER_ROLE) {
      _mint(credit, amount);
    }
    function TokenTransfer(address debit, address credit, uint256 amount) public onlyRole(MINTER_ROLE) {
      _transfer(debit, credit, amount);
    }
    function TokenBurn(address debit, uint256 amount) public onlyRole(MINTER_ROLE) {
      _burn(debit, amount);
    }
}
Enter fullscreen mode Exit fullscreen mode

Contract Verification Method:
https://www.xdc.dev/openscan/how-to-verify-your-smart-contract-built-on-the-xdc-network-via-standard-input-json-on-xdcscan-powered-by-blocksscanopenscan-2j93

Testnet:
Compiler 0.8.30+commit.73712a01, evm: prague
Contract is Deployed, Contract Is Verified
https://testnet.xdcscan.com/address/0xaF25D83767fdCa9628FD1034feA905fDe9d9B25a

Mainnet:
Compiler 0.8.30+commit.73712a01, evm: prague
Contract cannot be deployed, Gas Estimation Error

Downgrade EVM version
Compiler 0.8.30+commit.73712a01, evm: london
Contract is Deployed, Contract Cannot be Verified
https://xdcscan.com/address/0x4857288174a307C5974b5C9749986A5fBCda95A2

Image description

Any help / advise how to resolve this ?

Discussion (1)

Collapse
anilchinchawale profile image
AnilChinchawale

The XDC Network Mainnet currently supports Solidity v0.8.23. Please ensure your smart contracts are compiled with this version before deploying.

We are actively working on adopting newer Solidity versions. Solidity v0.8.30 is already supported on the XDC Testnet, and after thorough testing, we plan to upgrade the Mainnet accordingly.

If you require specific EIPs or features, feel free to open a request on our GitHub issues page: github.com/XinFinOrg/XDPoSChain/is.... We’ll review and consider them for inclusion in our roadmap.