-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...ration/pi_network/pi-network-interoperability/bridge-contracts/sidra-chain/SidraToken.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; | ||
} | ||
} |