IAM Tokens Unlisted Temporarily

Ivan Poon
2 min readApr 4, 2018

--

Hi everyone,

While we initially intended to have IAM tokens traded on Switcheo Exchange, due to some technical limitations, we are unable to do so at this time.

Here is an our analysis of the situation so far.

The Switcheo Exchange uses the Dynamic Invocation feature of NEO as specified in NEP-4.

Whenever a deposit of NEP-5 tokens is done, the Switcheo contract invokes a dynamic call to the token contract to transfer tokens from the user’s wallet into the exchange contract.

However, we found that after this is done, the calling invocation faults the Bridge Protocol contract. This has worked properly with all other NEP-5 tokens so far.

We can see that the transfer event was being logged from the Bridge Protocol contract, but the result of that operation did not allow the calling contract to complete execution. We have checked our own contract, and confirmed that it would never fail unless the result of the operation is also false, or the result of the invocation caused a fault in our invocation stack.

There are a few ways faults can happen:

1) The contract execution gas cost exceeded the free 10 gas limit. However, we also tested paying 20 gas for system fees and it also did not work, so this is out. (https://api.neonwallet.com/v2/transaction/17a7c2758d6a74c7a976ba58bd955fc60e4ac156b0348966178e9912e97b4019)

2) Compiler bugs or variations — if a smart contract does not cleanly leave the stack with only the expected result, it can break the calling contract, even if there was no VMState.FAULT set during it’s invocation.

This is meant to be solved in NEP-8: https://github.com/neo-project/proposals/pull/22.

So at this point we have concluded that even though the python based smart contract seems to return True, it may not be only leaving that single StackItem on the stack, after compilation.

We are mostly certain this is the case at this point, and will unfortunately cannot list IAM until NEP-8 is implemented.

3) VM bug — this is the most unlikely, but is also possible. The team will only check this after verifying that case 2) is not what is happening.

As such, Switcheo Exchange is unable to list IAM tokens at this time.

We will update the community when that has changed, and thank you for your support once again!

--

--