go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  Step 2. Code the contract
 
Subject: Step 2. Code the contract
Author: WebSpider
In response to: Step 1. Create a new Solidity file
Posted on: 06/07/2021 06:48:49 AM

Account.sol

pragma solidity >=0.7.0 <0.9.0;

/**
 * @title Account
 * @dev Store & retrieve value in a variable
 */
contract Account {

    uint256 balance;

    /**
     * @dev Deposit amount into account
     * @param amount value to deposit
     */
    function deposite(uint256 amount) public {
        balance += amount;
    }

    /**
     * @dev Withdraw amount from account
     * @param amount value to withdraw
     */
    function withdraw(uint256 amount) public {
        balance += amount;
    }

    /**
     * @dev Return balance 
     * @return balance value of 'number'
     */
    function getBalance() public view returns (uint256){
        return balance;
    }
    
}


 

> On 06/07/2021 06:46:29 AM WebSpider wrote:


  • Open Remix IDE via https://remix.ethereum.org/
  • Right-click on contracts and then click on New File
  • Type file's name, for example, Account.sol





    References:

  •  


     
    Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
     
    Get your own forum today. It's easy and free.