Error verifying ERC20 without constructor arguments on Etherscan

Hello I used your code but i am having similar error.

pragma solidity ^0.5.0;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/ERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/ERC20Detailed.sol";

contract YelmiToken is ERC20, ERC20Detailed {

    constructor () public ERC20Detailed("YelmiToken", "YLT", 18) {
        _mint(msg.sender, 1000000 * (10 ** uint256(decimals())));
    }
}

i keep getting this


please help

1 Like

Hi @IAMDEJEAN,

Welcome to the community :wave:

Your token doesn’t have any constructor arguments, so you can remove the contents of the field when you verify.

I recommend using the following method to verify: Verify smart contract inheriting from OpenZeppelin Contracts

If you run into issues, please share your Solidity code, address and whether optimization was enabled and I can help verify.


As an aside I suggest looking at Points to consider when creating a fungible token (ERC20, ERC777)

Also your contract uses OpenZeppelin Contracts 2.x. You may want to create a token using the latest version of OpenZeppelin Contracts (v3.2).

Hi @IAMDEJEAN,

I just wanted to check that you were able to verify your contract?

I am still having issues. I wish you can give me a detailed step in fixing it. Thanks

pragma solidity ^0.5.0;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/ERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/ERC20Detailed.sol";

contract YelmiToken is ERC20, ERC20Detailed {

    constructor () public ERC20Detailed("YelmiToken", "YLT", 18) {
        _mint(msg.sender, 1000000 * (10 ** uint256(decimals())));
    }
}
1 Like

This is my solidarity code … what should I do… I need help please! :pray:t5::pray:t5:

1 Like

Hi @IAMDEJEAN,

I used the following method to verify: Verify smart contract inheriting from OpenZeppelin Contracts

First I deployed the contract to Goerli testnet.

I then converted your contract to use package imports

pragma solidity ^0.5.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol";

contract YelmiToken is ERC20, ERC20Detailed {

    constructor () public ERC20Detailed("YelmiToken", "YLT", 18) {
        _mint(msg.sender, 1000000 * (10 ** uint256(decimals())));
    }
}

I then installed OpenZeppelin Contracts 2.5 to a buidler project

$ npm i @openzeppelin/contracts@2.5.0

With the buidler etherscan plugin installed I then verified:

$ npx buidler verify --network goerli 0xAF53B91508003D6875b00Da470808f2dB53F1A5E
Compiling...
Successfully submitted source code for contract
contracts/YelmiToken.sol:YelmiToken at 0xAF53B91508003D6875b00Da470808f2dB53F1A5E
for verification on etherscan. Waiting for verification result...
Successfully verified contract on etherscan

I also verified on Ropsten, which I assume you had deployed to, so your token will now be verified.

Download node.js
Download truffle
Download truffle flattener
Create a folder whit truffle
Copy your contract code
Flatten your contract code
Copy your flattened contract to etherscan or othwerise .its done :wink:

1 Like

And if u have created this contract whit mew .Dont try to solve it .use another platform preferm metamask.

1 Like