pragma solidity ^0.4.11;

contract raman {
    address owner;
    /* Constructor */
    function raman() { owner = msg.sender; }
    function kill() { if (msg.sender == owner) selfdestruct(owner);}

contract greeter is raman {
    /* Define variable greeting of the type string */
    string greeting;

    /* This runs when the contract is executed */
    function greeter(string _greeting) public { greeting = _greeting; }

    /* Main function */
    function greet() constant returns (string) { return greeting; }

// The above code is working fine, but what to do next and how to deploy it in the blockchain.

I want to just implement a simple smart contract right now in the blockchain I will kill it afterwards.

I have created a wallet with 0 ethers, in mist itself, is it possible to deploy this smart contract with 0 ethers??

enter image description here

  • i am looking for the same thing – swaheed Jul 7 '18 at 10:30

You must pay gas (Ether) to send any transaction on the Ethereum blockchain, even if it doesn't involve deploying or interacting with a smart contract.

You can however deploy the smart contract and test it on a testnet or a private network for free (You will have to acquire some testnet Ether or solo mine on a private network).

You can find more info about these options for learning and testing here:

Testnets - http://ethdocs.org/en/latest/network/test-networks.html

Private Network - https://github.com/ethereum/go-ethereum/wiki/Setting-up-private-network-or-local-cluster

| improve this answer | |

You will require ETH and can acquire it the following ways:

  • buy it using an exchange like coinbase, if you are running on the main net
  • mine it

as mentioned in the other answer, developing on the testnet allows you to very easily generate ETH by mining it. If you provide an ETH address I'm also happy to send you some ETH on the testnet to get you started

| improve this answer | |
  • I have ether on pvt blockchain. but want to see a contract in action. contract as simple as print a statement hello if input is 1 and bye if input is 2 – Raman Kishor Sep 22 '17 at 15:01

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.