Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

Getting the token contract address #86

Open
edzillion opened this issue Jul 2, 2019 · 2 comments
Open

Getting the token contract address #86

edzillion opened this issue Jul 2, 2019 · 2 comments

Comments

@edzillion
Copy link
Contributor

edzillion commented Jul 2, 2019

Ok so current setup is this

circles-contracts branch: feature/relayerPermissions

circles-api branch: ecs-deploy (with the bug/web3-connection-drop branch of metatx-server instead of the package)

circles-mobile branch: circlestoken-fixes

So I reverted some of my changes to the FE because I thought Ashoka's stuff might be more illuminating.

The current build with fail at the user reducer:

  case USER_TOKEN_CREATED:
      let logs = action.txReceipt.data.logs
      logs = logs.filter(log => log.address.toLowerCase() === HubContract.address.toLowerCase())
      let userAddress = '0x' + logs[0].topics[1].substr(-40)
      let tokenAddress = '0x' + logs[0].topics[2].substr(-40)
      return Object.assign({}, state, { token_address: tokenAddress })

because the metatx-server package returns just the tx hash, and not the receipt, but the receipt does not contain any logs anyway.

@edzillion
Copy link
Contributor Author

I got events showing by using subscribe()

  web3.eth.subscribe('logs', {
    fromBlock: 0
  }, function(error, result){
      if (error) console.error(error)
      console.log(result);
  });

I went through the initial migrations and then the registration but only one entry is displayed:

{ logIndex: 0,
  transactionIndex: 0,
  transactionHash:
   '0x5ccfc6a61771084e6c8a1113c45b067eafbbd171fbaf5f8fe948dbc123496db5',
  blockHash:
   '0x330b88e08c11ea8d0f35148c09867eb16f0b0d55a75be5c34298c4fa980b41a6',
  blockNumber: 4,
  address: '0xa70E47D58b35dd03a1Fa5BA569410389Efe06234',
  data:
   '0x000000000000000000000000571707f398847bead4113d334780945e0bd2c72f',
  topics:
   [ '0x4a76d907701285bbb0db269edd3151cebf49ba1a4e58dd308a079a19664050a3',
     '0x0000000000000000000000006049bf8eafabfb369cee0248bdefe9b16d3e0ad2' ],
  type: 'mined',
  id:
   'log_0xfc538c716cd2da9b47580f52c558806f2d5f345a0d84e79696c679715ae87b40' }

@edzillion
Copy link
Contributor Author

I tried the ganache GUI to see if that would show the logs.

It's showing the blocks, transactions etc all fine but no events are shown from any tx.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant