Using Ethereum Remix

Writing your smart contract

1. Create a "New File" under contracts with name HelloPosiChain.sol
Copy and paste the code below to HelloPosiChain.sol file
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
contract HelloPosiChain {
uint256 private count = 0;
uint256 moneyStored = 0;
function incrementCounter() public {
count += 1;
function decrementCounter() public {
count -= 1;
function addMoney() payable public {
moneyStored += msg.value;
function getCount() public view returns (uint256) {
return count;
function getMoneyStored() public view returns (uint256){
return moneyStored;


2 Compile HelloPosiChain.sol
Note: Choose a compiler version equal or newer the version used in contract. In this example, the contract using version 0.8.0. So in compile section, we using 0.8.0 too.


If you want to deploy the contract to a live network like POSI Chain Testnet or Mainnet, configure your metamask by adding the required POSI Chain networks using this guide. After adding Posi Chain networks into metamask, choose environment by using Inject Provider
3. Deploy the compiler contract. Select Injected Web3 for deploying to live network like POSI Chain testnet.
After that, we will deploy our contract.
Click the button Deploy, after that a popup confirm transaction will be shown. And just Confirm transaction deployment
4. Deploy contract HelloPosiChain.sol
Waiting a few seconds, the contract will be deployed to PosiChain. When the deployment success, we have a address of HelloPosiChain.sol in image below.
5. Deploy successfully, you can see the contract address

Referral document

This tutorial shows you how to use basic remix-ethereum. If you want more information please go to: