0

I have published my Ethereum contract along with the source code to the test network ROPSTEN here: https://ropsten.etherscan.io/address/0x4eada3f012a0dbdeff59a8ac62be07dfff71c90f#readContract

However, I am confused why only the approve and balanceOf functions work. All of the other functions return false or 0 when I try to run them using another test address: 0x458D19B5071b4C7B265793394c80e75BaECb5091. As you can see by the source code, I have a pretty straight-forward ERC 20 implementation... could it really be because my Allowed variable is capitalized instead of lower case? That is the only unique thing from the standard implementation that I found... is that the issue or am I missing something else?

  • What functions have you tried to call and with what parameters? Things seem to be working okay for me... I just called balanceOf with the address 0xd52193f518619aaa043f2a112717c7a2fd1e35e9 (the current OwnerAddress), and it returned 18000000. (BTW, I think this is a mistake... you multiplied 1000000 by Decimals, but you probably meant to multiply by 10 to the power of Decimals.) – user19510 Jan 20 '18 at 9:03
  • You are right about balanceOf, question updated, and yes, that was supposed to be a ** of instead of a *, which I already fixed in my local source code... but when I try to test to see how much was allowed(0xd52193f518619aaa043f2a112717c7a2fd1e35e9, 0x458D19B5071b4C7B265793394c80e75BaECb5091) even after I approve(0x458D19B5071b4C7B265793394c80e75BaECb5091, 1000) (I tried various amounts), it always shows 0, nor does it let me transfer any – Serj Sagan Jan 20 '18 at 9:17
  • I don't see any inbound transactions to the contract. I suspect you're trying things out in the "Read Smart Contract" tab, but nothing you do there will have any permanent effect. To actually mutate state in the contract, you need to send a transaction. – user19510 Jan 20 '18 at 9:18
  • Oh, I see. Can you recommend a way to do that? I tried adding the contract to my MetaMask, but it shows that I have 0.000 amount of that contract there... I'm sorry if this is all newb stuff to you but that's because I am pretty new to this. BTW, if you answer the question with your last comment, especially if you answer this comment, I will give you credit for the answer. – Serj Sagan Jan 20 '18 at 9:32
1

Copying from my comment:

I don't see any inbound transactions to the contract. I suspect you're trying things out in the "Read Smart Contract" tab, but nothing you do there will have any permanent effect. To actually mutate state in the contract, you need to send a transaction.

Remix + MetaMask is a good option for trying out the functions in your smart contract. Make sure you're using the same account in MetaMask as you used to initially deploy the contract.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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