Blockscout: Add Contract Creator to the Account Details page

Created on 19 Jun 2018  路  11Comments  路  Source: blockscout/blockscout

A user should see who created a smart contract on the account details page of the smart contract.

screen shot 2018-06-19 at 9 16 17 am

Environment

  • Elixir & Erlang/OTP versions (elixir -version):
  • Operating System: Linux

Steps to reproduce

Create a smart contract and add the Label "Contract Creator:" with the value of "a link to the owner of the contract" at txn聽"a link to the tx id"

Expected behaviour

Here is an example: https://etherscan.io/address/0x85e076361cc813a908ff672f9bad1541474402b2

Actual behaviour

Currently, this is not listed on the page.

contract details enhancement medium developer

All 11 comments

Hey, @acravenho! We've listed some questions below. Could you help us with them?

  • [x] For this issue, we are only going to create this Contract Creator info line, correct? Or is there anything else we should add from the print screen you've provided?
  • [x] Regarding the layout, where should we put this info: below the Last Updated In Block info, as the last item in the list, or in a new column, as in Etherscan?
  • [x] Regarding the truncation style, should we use the same style as used for the From and To fields in the transactions list, or should we use another style?
  1. Yes, in this contract creator line we should list what address created the contract and the transaction id.
  2. This should be in a new column like Etherscan.
  3. Yes, same truncation style will work as the transaction lists.

@acravenho after you answered, we noticed that there are actually two truncation styles in the addresses' pages transactions list:

  1. The transaction hash truncation (second column, next to the Status one)
  2. The from address truncation (fifth column, next to the Age one), with the copy button

Which option should we use? In case it's the second one, should we have that copy button too?

Because there is a new design being implemented don't worry about too much of the design aspect. Normally we would want it to be identical for addresses and transactions but this will need to be redesigned very soon.

  1. Yes, we want the transaction styling (next to status)
  2. Don't worry about the copy button. The new design won't require this.

When the user is looking at a contract that was created by another contract, should we show these links?

For example, looking at this transaction that was created by @acravenho, we can see some contracts created by this contract.

With the code that I have made so far, in this case, the creator link will be Andrew's address and the transaction link will be the call that created those contracts. Should we keep this behavior?

That's correct, for the original contract that was created we should show my address that created the original contract.

Once I call upon the contract to create the new contracts, it's the contract address that is the creator of these new contracts.

@acravenho so let's say you created a contract and then made a call to that contract, so it created a second contract.

For the first contract, once I visit its address page, I'll see its creator address (i.e., your address) and the hash for the transaction that you created to deploy that first contract.

On the other hand, for the second contract, once I visit its address page, I'll see the first contract address (as the creator address) and the hash for the transaction that you created while calling the first contract.

Is that correct?

cc @feliperenan

@gfreh Everything was correct except for the transaction hash for the second contract. The transaction hash we want to see there is the transaction that called on the contract to create the second contract.

Nice! That was what I was trying to say 馃槄

Thank you, @acravenho!

I've tested this card and it seems that everything is ok!

I used that contract you've created before: 0xa5c8e8fa29b975edadf26b47577fbe24b5593680. In its page, the result was:

0xa5c8e8fa29b975edadf26b47577fbe24b5593680

For all the five other contracts created by this first one in the same call (in this case, tx has 0x2a2829a8094776b41f165c4fa3ed68d6415a0ab62d6b7b4b18b13dd0cbfcf149), the result was:

0x49844378101ae1a8b101f172ae49e3fbd37e47cd

@acravenho Do you want to take a look before we merge the PR and close the issue?

Closed by #362

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bellaj picture bellaj  路  6Comments

igorffs picture igorffs  路  7Comments

dwalintukan picture dwalintukan  路  5Comments

vbaranov picture vbaranov  路  7Comments

KronicDeth picture KronicDeth  路  3Comments