1

My 2 assumptions of the problem:

  • out of gas
  • some failed require statement when calling mint

I don't see these 2 because I made sure to send more than enough gas and that msg.value > priceForTokens on the Ropsten network. Everything works fine with remix's JS VM.

Here's the contract source:

Here's one example of a failed transaction on Ropsten.

2 Answers 2

0

It looks like you deployed the wrong contract. You deployed MemeRecorder, when I assume you meant to deploy Meme.

(I figured this out by verifying the source code on Etherscan.)

Or perhaps you meant to deploy MemeRecorder but then are trying to call mint() on the wrong contract. It looks like 0x19a1a4a3e8f659d43b5353d21126b8bf846616ac is an instance of Meme that was created via addMeme(). Maybe you meant to call mint() on that instead.

EDIT

I verified the source code for 0x19a1a4a3e8f659d43b5353d21126b8bf846616ac for you too.

5
  • The order of execution I went with: 1. Deployed MemeRecorder 2. Used addMeme to create a new instance of Meme 3. Then on that new instance called mint which results in failure. I'm still scratching my head why it's not working with this flow. Thanks for verifying the contract, I must get into the habit :) Jul 10, 2018 at 4:28
  • You called mint() on MemeRecorder instead of on the new Meme instance.
    – user19510
    Jul 10, 2018 at 4:40
  • No transactions have been sent to the Meme instance yet.
    – user19510
    Jul 10, 2018 at 4:41
  • With 2. I meant calling mint() on the new Meme instance not MemeRecorder. I tried with the correct flow both on Ropsten and Rinkeby. I also tried doing it the erroneous way by curiosity, I get some kindof rpc error alert from MyCrypto. I will take more stabs at it. Jul 10, 2018 at 5:12
  • In the original question you asked, you linked to a transaction in which mint() was being called on MemeRecorder, which has no such function. It sounds like you're claiming otherwise, but perhaps I'm confused?
    – user19510
    Jul 10, 2018 at 5:14
0

Smarx: you are right. I was calling mint() on MemeRecorder.

The main problem: if the MemeRecorder factory doesn’t have a constructor it erroneously runs addMeme when I first instantiate MemeRecorder. Found that out with Remix’s debugger. Why? I have no idea, maybe it is mentioned somewhere deep in Solidity’s documentation.

The reason why I got myself and others deeply confused is that without the constructor, you would never see internal transactions either creating the Meme instance.

  1. 0xAe2326591d730B4c5571580D799047c0FE51DF4E (MemeRecorder)

  2. 0x524B50F4F8B41DB9A5d9E17e5eE16fEa1095AAd6 (Meme instance)

The tricky thing is that when addMeme() is called on MemeRecorder, the new Meme instance is created via an internal transaction.

A successful buying (minting of tokens) is here.

  • in all Meme contracts you would see internal transactions for when the change is getting sent back to buyer internaltx

Thanks Smarx for helping me think about the issue, I’m an avid reader and fan of programtheblockchain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.