-
Notifications
You must be signed in to change notification settings - Fork 77
Problem with default erc20 class #795
Description
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
0x009524a94b41c4440a16fd96d7c1ef6ad6f44c1c013e96662734502cd4ee9b1fwith implementation class0x06e7226605869c2bd8cb86a647b451adc0b90e1e4f00b1c45d502dcd2ba6d41e - 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
- 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