2

I'm looking through Exit Scam's game code. But there are some lines that I do not understand at all. Contract code

At Line 189: Why is there an address at ...Interface(...); ?

F3DexternalSettingsInterface constant private extSettings = F3DexternalSettingsInterface(0x32967D6c142c2F38AB39235994e2DDF11c37d590);

At Line 196 and 1814: Why are the interface's functions not implemented? Is there any other source code that I'm missing here?

uint256 private rndExtra_ = extSettings.getLongExtra();     // Line 196
...
interface F3DexternalSettingsInterface {
    function getFastGap() external returns(uint256);
    function getLongGap() external returns(uint256);
    function getFastExtra() external returns(uint256);
    function getLongExtra() external returns(uint256); //<--Line 1814
}

Thank you and best regards.

Hami
  • 335
  • 1
  • 7
  • 22

2 Answers2

2

Yes, the code is at the address that is at line 189. https://etherscan.io/address/0x32967d6c142c2f38ab39235994e2ddf11c37d590#code

What this means is that this address is the one responsible for implementing those functions which is why they are not implemented in the main contract. Now that code is not verified so I dont know exactly how it is implemented but looking at the bytecode we can see the function signatures match the function names. So the first four bytes of getFastGap() after being hashed with keccak256 is 0x18d0376c which matches the opcodes starting at byte 44. The other three are also there as you can see by hashing the others too.

  • so how do i find out how it is implmented? is it stored at somewhere else? – Hami Jul 28 '18 at 02:54
  • @HamiltonWong it is implemented there, that is what the bytecode is all solidity and other ethereum languages ie Vyper compile down to bytecode so that is the instructions and implementation. –  Aug 04 '18 at 02:55
0

Answer to your main question: the reason there is an address at ...Interface(...); is that they can separate responsibilities into different contract and have the main contract call other contracts.

Your second question as why some of their sub contracts did not have source code. I believe the team intentionally did not put the source code in etherscan. Most other contracts of Fomo3d game has source code such as their main contract here: https://etherscan.io/address/0xa62142888aba8370742be823c1782d17a0389da1#code

However, F3DexternalSettingsInterface at https://etherscan.io/address/0x32967d6c142c2f38ab39235994e2ddf11c37d590#code and interface JIincInterfaceForForwarder which is referenced in contract JIincForwarder here: https://etherscan.io/address/0xdd4950F977EE28D2C132f1353D1595035Db444EE#code are not open source.

alant
  • 82
  • 7