Learn Ethereum – Smart Contracts working project make money

Ethereum – Smart Contracts There are several tools available to develop and test contracts. One of the simplest tools is provided on the official Ethereum site itself. The tool is called Remix, we will use this for our contract development. Remix for Contract Development Open the Remix IDE by typing in the following URL in your browser. The following screen will appear. In the center window, you will see some default code, which is a sample Solidity code. You will type your contract code in this code editor. Your code may be auto-compiled. Upon successful compilation of the code, you will be able to run the code in the same IDE. When you execute the contract methods, the results will be displayed in the same IDE window. There are facilities to debug the code and to unit test your project. These can be seen in the menu bar at the top right hand side as shown in the IDE screenshot below. You will be using these options shortly. You will now start writing your contract.

Learn Ethereum – Interacting with the Contract working project make money

Ethereum – 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. 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. 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 − 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. 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.