0

When compiling my contract code with solc, I get EVM bytecode (.bin).

How can I test this bytecode, i.e., call the functions etc.?

The Remix online compiler is not an option, since it also accepts Solidity source code.

1

https://alanbuxton.wordpress.com/2017/07/19/first-steps-with-ethereum-private-networks-and-smart-contracts-on-ubuntu-16-04/

This tutorial shows you how to run a private chain that you can deploy contracts to. You could also use the Ropsten test chain to deploy contracts. I use it with little to no problems. Just look a Ropsten faucet on Google and get some ether for the test chain.

Once you have deployed a contract to either your private chain or Ropsten, you'll be able to use the contract instance to call functions individually and test them in the javascript API.

I use the geth javascript API to call contract functions and play around with them, has a really great interface IMO.

2

Not sure why remix would not do the trick? if you use remix and deploy the contract (e.g. via injected web3 and metamask) you will be able to test all the functions using the buttons on the right hand side.

You can also use the mist wallet to deploy and test your functions.

A less elegant ways is (if you don't have too many functions) deploy the contract in another way build a simple dapp connecting various functions to corresponding html buttons using web3.js

make sure that you use a testnet to test your smart contracts (although ropsten is not too reliable today.....)

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.