Code

First Try at Truffle, Solidity and Metamask

Smart Contracts are hard to test. It’s my first time getting to know how to create a test Ethereum network and interact with it.

I need to test out a Smart Contract to transfer funds from one wallet to another, in two different coins.

I have not achieved much so far, besides being able to consume gas from adding custom coins from Metamask.

So the code below gets the ‘token contract address’ on the testrpc network:

1
2
> contract_name.new().then(function(res) { sc = contract_name.at(res.address) })
> sc.address

You paste that into Metamask’s Add Coin window, and you can add the coin!

#ethereum #metamask #solidity #truffle