Interacting with the Contract

When you click the deployed contract, you will see the various public methods provided by the contract. This is shown in the screenshot below.

Deploy Public Methods

The first method send contains an edit box in front of it. Here, you will type the parameters required by the contract method. The other two methods do not take any parameters.

Sending Money

Now, enter some amount such as 100 in front of the send function seen in the contract window. Click the send button. This will execute the contract send method, reducing the value of the contract value field and increasing the value of the amount field.

Sending Money

Examining Contract Value

The previous send money action has reduced the contract value by 100. You can now examine this by invoking the getBalance method of the contract. You will see the output when you click on the getBalance button as shown in the screenshot below −

Examining Contract Value

The contract value is now reduced to 900.

Examining Collected Amount

In this section, we will examine the amount of money collected so far on this contract. For this, click on the getAmount button. The following screen will appear.

Examining Collected Amount

The amount field value has changed from 0 to 100.

Try a few send operations and examine the contract value and the amount fields to conclude that the deployed contract is executing as expected.

Similar Posts

  • Ganache for Blockchain

    Ganache is used for setting up a personal Ethereum Blockchain for testing your Solidity contracts. It provides more features when compared to Remix. You will learn about the features when you work out with Ganache. Before you begin using Ganache, you must first download and install the Blockchain on your local machine. Downloading Ganache You…

  • Deploying Contract

    To deploy the contract, select the Contracts menu option as shown in the screenshot below − You will need to enter the contract’s bytecode on this screen. Remember, when you compile your Solidity contract code, it generated a bytecode that runs on EVM. You will now need to obtain this bytecode from Remix IDE. Go to the Remix…

  • A Quick Walkthrough

    We will now briefly understand what is available on the Ganache desktop. On the Desktop, at the top we have several menu options out of which a few are of immediate relevance to us. The menu bar is highlighted in the screenshot below − Clicking on the TRANSACTIONS menu shows all the transactions performed so far. You…

  • MyEtherWallet

    For client application, you will use MyEtherWallet. Download MyEtherWallet software from the following URL − If required, unzip the downloaded file and open index.html. You will see the following interface for creating a new wallet.

  • Solidity for Contract Writing

    Solidity is an object-oriented language especially developed for contract writing. It is a high-level language, which inherits traits from C++, Python, and JavaScript. The Solidity compiler compiles your source code into bytecode that runs on Ethereum Virtual Machine (EVM). For quick understanding of the Solidity syntax, look at the sample code in the IDE.pragma solidity…