Skip to content

Commit

Permalink
Create SidraToken.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jul 27, 2024
1 parent 47a3414 commit 60e6036
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
pragma solidity ^0.8.0;

contract SidraToken {
string public name;
string public symbol;
uint256 public totalSupply;
mapping(address => uint256) public balances;

event Transfer(address indexed from, address indexed to, uint256 value);

constructor() public {
name = "Sidra Token";
symbol = "ST";
totalSupply = 100000000 * (10**18); // 100 million tokens
balances[msg.sender] = totalSupply;
}

function transfer(address _to, uint256 _value) public {
require(balances[msg.sender] >= _value, "Insufficient balance");
balances[msg.sender] -= _value;
balances[_to] += _value;
emit Transfer(msg.sender, _to, _value);
}

function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}

0 comments on commit 60e6036

Please sign in to comment.