tronscan-frontend icon indicating copy to clipboard operation
tronscan-frontend copied to clipboard

OKS token transfers and holders do not show up. Unable to verify contracts

Open oikos1 opened this issue 5 years ago • 8 comments

Hello, Tronscan does not work correctly with contracts using general proxy pattern.

In a proxy architecture, the proxy sits in front of an underlying target contract. Any calls made to the proxy are forwarded to that target contract, so it appears as if the target was called. This is designed to allow a contract to be upgraded without altering its address. This proxy typically operates in tandem with a Proxyable instance as its target. In this configuration, events are always emitted at the proxy, not at the target, even if the target is called directly.

This happens to be the case with Oikos Network Token (OKS).

We registered the token on Tronscan using the ProxyERC20 address, which is TWVVcRqRmpyAi9dASvTXrqnS7FrwvDezMn, while the underlying contract is TSCfE2WrmrpyuK4JLicbJCfXzZnJJ2kdJ. Please see our address list here and here. Tronscan does not show token holders or transfers for TWVVcRqRmpyAi9dASvTXrqnS7FrwvDezMn.

We have reached out to customer support on Telegram to report the issue and have been told to verify our contracts on this page, which we have attempted to and failed. To compile the contracts, we use Solidity 0.4.25 and a custom script. Bytecode generated matches 100% the one shown here. Upon submitting the contract for verification, we get this error message:

TWVVcRqRmpyAi9dASvTXrqnS7FrwvDezMn verification failed. Please confirm the correct parameters and try again.

tronscan

Are we missing something? Please provide some assistance. Thank you

Oikos.cash Team

oikos1 avatar Jun 01 '20 16:06 oikos1

hi,oikos1, regarding your first question, the transaction details are all internal transactions, and you need to have a trc20 transfer to display holder related information. And did you start the deployment contract through tronbox or tronIDE? Or other tools?

Alexliu007 avatar Jun 02 '20 03:06 Alexliu007

also is it convenient to provide a compiler file you use?

Alexliu007 avatar Jun 02 '20 06:06 Alexliu007

The second problem is probably because of the compiler problem. The tronscan verification contract compiler version is used here. You can use this compiler to compile and deploy the contract https://github.com/tronprotocol/solidity/releases

Alexliu007 avatar Jun 03 '20 03:06 Alexliu007

Alright, first let's solve the TRC20 issue. Are you saying that Tronscan doesn't detect TRC20 transfers that are done from within another contract? If so, this seems like an issue with Tronscan?

kevholder avatar Jun 03 '20 16:06 kevholder

@oikos1 @kevholder Got confused here. In contract TWVVcRqRmpyAi9dASvTXrqnS7FrwvDezMn, your target address is TRjh5SKFaL7A3y2F6nZHKoLQizpsZ7SbR2. I believe this should be the underlying contract.

So, what’s the relationship between TSCfE2WrmrpyuK4JLicbJCfXzZnJJ2kdJ and TRjh5SKFaL7A3y2F6nZHKoLQizpsZ7SbR2. Also how you defined TSCfE2WrmrpyuK4JLicbJCfXzZnJJ2kdJ as underlying contract for TWVVcRqRmpyAi9dASvTXrqnS7FrwvDezMn. Any specific function for it? Can you clarify these a little bit?

Thanks.

taihaofu avatar Jun 04 '20 10:06 taihaofu

Maybe this file will help you understand how the contracts relate to each other: https://github.com/oikos-cash/oikos/blob/master/publish/deployed/mainnet/deployment.json#L115

TSCfE2WrmrpyuK4JLicbJCfXzZnJJ2kdJ is a dumb proxy contract that "forwards" the calls to a "target" contract (TRjh5SKFaL7A3y2F6nZHKoLQizpsZ7SbR2 in this case). That allows us to upgrade the target contract while keeping the same address for the proxy TSCfE2WrmrpyuK4JLicbJCfXzZnJJ2kdJ.

This solidity programming pattern is explained a bit here: https://blog.openzeppelin.com/proxy-patterns/

Does tronscan rely on the on chain ABI to implement the trc20 tracking system? That might be the issue here because TSCfE2WrmrpyuK4JLicbJCfXzZnJJ2kdJ on chain ABI doesn't contain all the calls/events that it actually support since it's a proxy.

kevholder avatar Jun 14 '20 15:06 kevholder

@kevholder Thank you for the clarification. I see your point. The reason seems not related to chain ABI but related to the event parsing logic in TRONSCAN. I will transfer your issue to the corresponding contributor.

taihaofu avatar Jun 16 '20 10:06 taihaofu

What to do if i got “ verification failed. Please confirm the correct parameters and try again”. I used 0.5.16 compiler for the uploads and now there is no selection for the 0.5.16 compiler. what to do?

jjhesk avatar Feb 15 '21 05:02 jjhesk