github.com/Tri-stone/burrow@v0.25.0/tests/jobs_fixtures/app55-extcodehash/codehash.sol (about) 1 pragma solidity >=0.0.0; 2 3 contract foo { 4 string str; 5 constructor(string memory bar) public { 6 bar = str; 7 } 8 } 9 10 contract bar { 11 function bar2() public { 12 foo f1 = new foo("abc"); 13 foo f2 = new foo("def"); 14 address a1 = address(f1); 15 address a2 = address(f2); 16 uint hash1; 17 uint hash2; 18 19 assembly { 20 hash1 := extcodehash(a1) 21 hash2 := extcodehash(a2) 22 } 23 assert(hash1 == hash2); 24 } 25 }