Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions DemoToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//SPDX-License-Identifier: MIT
/** Visibility of a function
public, private, external, internal
* msg.sender
* alt + arrow up/down
* shortcut to comment a line: ctrl + /
* TWO TYPES OF FUNCTIONS: 1. WRITABLE FUNCTIONS 2. READABLE FUNCTIONS
*/

pragma solidity ^0.8.0;

contract OphirArbitrum{
// 1. Create our token's total Supply
uint256 public maxSupply = 210000000;
uint256 public totalAvailableSupply = 21000000;

mapping(address => uint256) balance;

// 2. The minting function
function mintToken(address receiver, uint256 amount) public{
totalAvailableSupply = totalAvailableSupply - amount;
balance[receiver] = balance[receiver] + amount;
}

//balance[location]


// 3. A function to check to checkBalance
function checkBalance(address account) public view returns(uint256) {
return balance[account];
}


// 4. Create the transfer function
// Send some amount of tokens from one account to another account
function transfer(address sender, address receiver, uint256 amount) public {
balance[sender] = balance[sender] - amount;
balance[receiver] = balance[receiver] + amount;
}

}