Skip to content

Instantly share code, notes, and snippets.

@jongan69
Last active April 19, 2022 15:43
Show Gist options
  • Save jongan69/6a40ef08d40b23b28351dcc0294a5528 to your computer and use it in GitHub Desktop.
Save jongan69/6a40ef08d40b23b28351dcc0294a5528 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
pragma solidity ^0.8.2;
// Deployed Contract to BSC for DEMO: https://www.bscscan.com/address/0xC76F08B7B723d3b0461cEc8206710cd12D71f2a2
// Github Page: https://cryptohoes.github.io/CryptoHoesICO/
contract CryptoHoes {
mapping(address => uint) public balances;
mapping(address => mapping(address => uint)) public allowance;
uint public totalSupply = 69420000 * 10 ** 18;
string public name = "CryptoHoes";
string public symbol = "HOES";
uint public decimals = 18;
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
constructor() {
balances[msg.sender] = totalSupply;
}
function balanceOf(address owner) public returns(uint) {
return balances[owner];
}
function transfer(address to, uint value) public returns(bool) {
require(balanceOf(msg.sender) >= value, 'balance too low');
balances[to] += value;
balances[msg.sender] -= value;
emit Transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) public returns(bool) {
require(balanceOf(from) >= value, 'balance too low');
require(allowance[from][msg.sender] >= value, 'allowance too low');
balances[to] += value;
balances[from] -= value;
emit Transfer(from, to, value);
return true;
}
function approve(address spender, uint value) public returns (bool) {
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
}
@jongan69
Copy link
Author

This is the original contract for the CryptoHoes DAO project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment