I am trying to write an application using web3.js and I want to integrate some ERC20 functionality. But rather than muddy up the mainnet, I'd like to try things on the Testnet first. I see that https://ropsten.etherscan.io/address/0x722dd3f80bac40c951b51bdd28dd19d435762180#tokentxns is a standard Testnet token. Is there anyway for me to get my hands on some?

Or perhaps another ERC20 compliant testnet token?

up vote 2 down vote accepted

In that contract https://ropsten.etherscan.io/address/0x722dd3f80bac40c951b51bdd28dd19d435762180#code you need to call the function showMeTheMoney with your address and amount of tokens. It should deposit that amount in your address.

function showMeTheMoney(address _to, uint256 _value) {
    totalSupply += _value;
    balances[_to] += _value;
    Transfer(0, _to, _value);
}
  • Here's a dumb question - how do I run the function? – Shamoon May 14 at 3:08
  • You have the contract address and you can get the contract abi from the etherscan page. With that you can create an instance of the contract and call the method showMeTheMoney(). – Ismael May 14 at 15:39
  • But how do I call the method? – Shamoon May 14 at 15:41
  • 1
    In web3 v1.0 it should be ``` const token = web3.eth.Contract(TokenABI, TokenAddress); await token.methods.showMeTheMoney(UserAddress, TokenAmount).send({ from: UserAddress, gas: 200000 }); ``` – Ismael May 14 at 16:51

Just deploy own ERC20 token contract to the testnet and use that.

I just found out that Etherscan has a beta feature tab called Write Contract and it allows to directly interact with the TST smart contract with the use of Metamask.

Etherscan's Beta version of its Write Contract Feature

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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