ethereum / sourcify

Decentralized Solidity contract source code verification service
https://sourcify.dev
MIT License
775 stars 388 forks source link

Contracts with completely different onchain vs recompiled deployedBytecode #1014

Closed kuzdogan closed 1 year ago

kuzdogan commented 1 year ago

While checking if after the introduction of immutableReferences there are still contracts that can't be verified with deployedBytecode but with the input of the creatorTx, I came across a contract that has a completely different onchain deployed bytecode than what the compiler outputs.

Chain: Telos EVM Testnet (41) Address: 0xF5891f92863AA3d406969D5fFFf1F9740750318c

Block Explorer: https://testnet.teloscan.io/address/0xF5891f92863AA3d406969D5fFFf1F9740750318c Sourcify Repo: https://repo.sourcify.dev/contracts/full_match/41/0xF5891f92863AA3d406969D5fFFf1F9740750318c/

Onchain deployed bytecode:

0x363038303630343035323630303433363130363130343...

41-0xF5891f92863AA3d406969D5fFFf1F9740750318c-deployed.txt

Recompiled deployed bytecode:

0x6080604052600436106104475760003560e01c806370a08...

41-0xF5891f92863AA3d406969D5fFFf1F9740750318c-recompiled.txt

View in Huly HI-409

kuzdogan commented 1 year ago

Ok apparently this has something to do with the Telos EVM.

For some reason the Telos RPC is always returning weird bytecode.

Example:

curl --location 'https://testnet.telos.net/evm' --header 'Content-Type: application/json' --data '{
    "jsonrpc":"2.0",
    "method":"eth_getCode",
    "params":[
        "0x8F78b9c92a68DdF719849a40702cFBfa4EB60dD0", 
        "latest"
    ],
    "id":1
}'

Some other Telos Tesnet contracts:

0xf1A5DbED784B3E7Aa38ae6B51AF2E3fd8c8f8A78
0xf374C0C89757F04497835e7dC6B44Ab63ffe4630
0xf3810BC3AB08d0782B531581B5b3F82D64E7bD02
0xf3c8A667B80b2113f05829a8fff28323C88e9B10
0xf4030f873d1F987908FEE66Dd2Ebb9F9C5EDA864
0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4
0xf56F052e7F19C8ceF2FBf3E881587D14De95C70a
0xf6Fd0aE6e4d2fCDA0E18b4CF43575210C1a1e005
0xf81387086b5f89417cC54806416e5A227a2a98e6
0xfB62D96Aa4263ddb9DBCA6907FdD4f578791bCE1
0xfD197261b4C3C02B7Ee4745B7cF350a82340B238

Closing this as this is nothing on our side. Nevertheless I asked on their Telegram