169 похожих чатов

Hi all, a question about EXTCODESIZE. I thought that if

I deployed the same contract 2 times, they would have the same bytecode and the same extcodesize, but when trying this in Foundry I'm getting different hashes:

address anotherChallengeImpl = address(new MyContract());
address anotherChallengeImpl2 = address(new MyContract());
bytes32 codeHash;

console.log("CodeHash of another Implementations:");
assembly {
codeHash := extcodehash(anotherChallengeImpl)
}
console.logBytes32(codeHash);
assembly {
codeHash := extcodehash(anotherChallengeImpl2)
}
console.logBytes32(codeHash);

Output:

CodeHash of another Implementations:
0x6a8ae1efefa1130954998d656c53df68c351e99fc0e0aed5f976fd3f6dc9514c
0x78848a0409fe43dce452de5122ea366da5768c4e8bfabdc197fb196200dbd0db

Does the bytecode contain something else and my reasoning is wrong?

5 ответов

9 просмотров

did you used the same constructor args ?

Gryphus- Автор вопроса
амин
did you used the same constructor args ?

No constructor args, exactly like in the test snippet I pasted

Gryphus
No constructor args, exactly like in the test snip...

i tried your simple code it's returns the same bytes (size) , but i don't understand Exactly ;as i understood when you deploy a new implementation contract two times with the same logic (code) you get Different byte code size? correct me if i'm wrong

I think both of the transactions need to have the same nonce

are you doing anything in constructor of MyContract?

Похожие вопросы

Обсуждают сегодня

а зачем этот вопрос для удаления из чата?
Mёdkinson Medvezhkin
63
Добрый день. Хочу сделать отрисовку по команде на панели. Почему-то рисуется только при втором вызове. С чем может быть связано, не подскажете? procedure TForm1.FormDblClick(...
Kirill Filippenok
20
Всем доброго дня! Подскажите может кто использовал связку Pagebuilder + Clientsetting. Сами параметры с типом pagebuilder в модуле Clientsetting работают нормально, можно такж...
Александр Добриков
12
А почему в си некоторые вещи работают с двойными кавычками некоторые с одинарными? Нельзя было все сделать с одними или чтоб работало с разными? например чтоб выводить строки ...
.
15
Всем привет! Нужен совет от опытных. Переношу свой проект с Делфи 10.2 Токио на Лазарус 3.2 установленный через инсталлятор fpcupdeluxe-x86_64-win64. При импортировании проект...
Дмитрий Завгородний
7
Всем привет! Подскажите. Я написал приложение на Delphi 10.2 Tokyo под Windows 10. И передо мной стал вопрос о том чтобы сделать это приложение кроссплатформенным (под Linux и...
Дмитрий Завгородний
24
Good afternoon, I just started learning php in conjunction with mysql. I am registering a system on a local Mamp server using phpMyAdmin. It seems to be stored normally in the...
ManGo
1
Эх кто-то пришел и весь праздник испортил :( You need complex FBX scene importing setup to change things on import? good luck with that. You need navigation and pathfinding? g...
Serg Gini
5
Добрый день! Такая проблема возникла, написал код на Python, который компилирует, собирает и запускает файлы .s А в случае работы нужно то же самое делать для .asm Чем эти фа...
A Mori
5
Всем привет! procedure TForm1.FormCreate(Sender: TObject); type TStartEnd = record S: Byte; E: Byte; end; var a, b: TStartEnd; begin {1} a.S := 1; {2} a.E := 2; ...
Руслан Михайлович
10
Карта сайта