From 395d4f75b16ccc748d274f4b2d92276c7a77015f Mon Sep 17 00:00:00 2001 From: anwaerta <158064980+anwaerta@users.noreply.github.com> Date: Mon, 19 Feb 2024 01:22:53 +0600 Subject: [PATCH] Create simple smart contract on scroll A very simple contract on scrool --- simple smart contract on scroll | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 simple smart contract on scroll diff --git a/simple smart contract on scroll b/simple smart contract on scroll new file mode 100644 index 0000000..f93e469 --- /dev/null +++ b/simple smart contract on scroll @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +contract Scrool { + address public owner; + mapping(address => uint) public balances; + + event Transfer(address indexed from, address indexed to, uint value); + + constructor() { + owner = msg.sender; + } + + function transfer(address to, uint value) external { + require(balances[msg.sender] >= value, "Insufficient balance"); + balances[msg.sender] -= value; + balances[to] += value; + emit Transfer(msg.sender, to, value); + } +}