Skip to content

Problem with default erc20 class #795

@PhilippeR26

Description

@PhilippeR26

Describe the bug (observed vs expected behavior)

The class hashes of STRK and ETH tokens are not the ones used in Testnet/Mainnet. These token are using in fact the 0x46ded64ae2dead6448e247234bab192a9c483644395b66f2155f2614e5804b0 class (this class exists in Testnet).
If I use Starknet.js to read the constructor of this class in Devnet, I have :

{
  type: 'constructor',
  name: 'constructor',
  inputs: [
    {
      name: 'owner',
      type: 'core::starknet::contract_address::ContractAddress'
    }
  ]
}

If I read the constructor of the same class in Testnet, I have :

{
  type: 'constructor',
  name: 'constructor',
  inputs: [
    { name: 'name', type: 'core::felt252' },
    { name: 'symbol', type: 'core::felt252' },
    { name: 'fixed_supply', type: 'core::integer::u256' },
    {
      name: 'recipient',
      type: 'core::starknet::contract_address::ContractAddress'
    }
  ]
}

We have here a problem: a same class hash can't use different constructors.
The class hash has been forced in devnet, and is generating troubles.

To have the same behavior than Testnet, a good solution could be to use the same classes for STRK & ETH than in Testnet/devnet:

  • STRK : proxy class 0x009524a94b41c4440a16fd96d7c1ef6ad6f44c1c013e96662734502cd4ee9b1f with implementation class 0x06e7226605869c2bd8cb86a647b451adc0b90e1e4f00b1c45d502dcd2ba6d41e
  • ETH : class 0x076791ef97c042f81fbf352ad95f39a22554ee8d7927b2ce3c681f3418b5206a

Not reproducible on testnet

  • This issue is only present on Devnet and cannot be reproduced on the alpha-sepolia testnet (check the box if true).

Steps to reproduce the behavior

  1. cargo run --release -- --seed 0 --state-archive-capacity full --lite-mode
const classHash = "0x46ded64ae2dead6448e247234bab192a9c483644395b66f2155f2614e5804b0"; 
const compiledSierra = await myProvider.getClassByHash(classHash);
console.log("constructor =", compiledSierra.abi.find((item) => item.type == "constructor"));

Devnet version

  • I am using Devnet version: 0.4.2
  • I have found that this issue is not present in Devnet version:

System specifications

  • OS: Linux Mint

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions