Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USDT - Tether contract #435

Open
TesoraFinancial opened this issue Dec 12, 2023 · 1 comment
Open

USDT - Tether contract #435

TesoraFinancial opened this issue Dec 12, 2023 · 1 comment

Comments

@TesoraFinancial
Copy link

Trying to generate the interface files for USDT - Tether on the Ethereum Network in order to interact with the contract, sending and receiving USDT.

Steps:

Solidity Download contract: ethereum, contract address: 0xdac17f958d2ee523a2206206994597c13d831ec7

creates the sol and abi files, then compile and generate CSharp

in the abi, you have:
contract ERC20Basic {
uint public _totalSupply;
function totalSupply() public constant returns (uint);
function balanceOf(address who) public constant returns (uint);
function transfer(address to, uint value) public;
event Transfer(address indexed from, address indexed to, uint value);
}

Problem: the variable has an underscore with the same name as the function. The code generated removes the underscore and generates a duplicate function names.

Generated code (4 functions, 2 sets are duplicated)

    public Task<BigInteger> TotalSupplyQueryAsync(TotalSupplyFunction totalSupplyFunction, BlockParameter blockParameter = null)
    {
        return ContractHandler.QueryAsync<TotalSupplyFunction, BigInteger>(totalSupplyFunction, blockParameter);
    }

    
    public Task<BigInteger> TotalSupplyQueryAsync(BlockParameter blockParameter = null)
    {
        return ContractHandler.QueryAsync<TotalSupplyFunction, BigInteger>(null, blockParameter);
    }

    public Task<BigInteger> TotalSupplyQueryAsync(TotalSupplyFunction totalSupplyFunction, BlockParameter blockParameter = null)
    {
        return ContractHandler.QueryAsync<TotalSupplyFunction, BigInteger>(totalSupplyFunction, blockParameter);
    }

    
    public Task<BigInteger> TotalSupplyQueryAsync(BlockParameter blockParameter = null)
    {
        return ContractHandler.QueryAsync<TotalSupplyFunction, BigInteger>(null, blockParameter);
    }
@juanfranblanco
Copy link
Owner

Thanks, yes, that is a general issue with anti patterns on public fields. I will need to modify the code generator (brainstorming here) in this scenario to include the suffix when there is a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants