Skip to content

Commit

Permalink
Update coin.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
brokenpie authored Feb 2, 2021
1 parent 438ffac commit b9346f7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions coin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function transfer(address _to, uint256 _value) returns (bool success) {
if (balances[msg.sender] >= _value && _value > 0) {
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
emit Transfer(msg.sender, _to, _value);
return true;
} else { return false; }
}
Expand All @@ -73,7 +73,7 @@ if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value
balances[_to] += _value;
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
emit Transfer(_from, _to, _value);
return true;
} else { return false; }
}
Expand All @@ -84,7 +84,7 @@ return balances[_owner];

function approve(address _spender, uint256 _value) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
emit Approval(msg.sender, _spender, _value);
return true;
}

Expand All @@ -99,7 +99,8 @@ uint256 public totalSupply;


//name this contract whatever you'd like
contract FUTCoin is StandardToken {

contract FCoin is StandardToken {

function () {
//if ether is sent to this address, send it back.
Expand All @@ -122,10 +123,10 @@ string public version = 'B1.0';

//make sure this function name matches the contract name above. So if you're token is called TutorialToken, make sure the //contract name above is also TutorialToken instead of ERC20Token

function FUTCoin(
constructor(
) {
balances[msg.sender] = 10000000000000000000000000000; // Give the creator all initial tokens (100000 for example)
totalSupply = 10000000000000000000000000000; // Update total supply (100000 for example)
balances[msg.sender] = 1000000000000000000000000000; // Give the creator all initial tokens (100000 for example)
totalSupply = 1000000000000000000000000000; // Update total supply (100000 for example)
name = "Future Crypto Coin"; // Set the name for display purposes
decimals = 18; // Amount of decimals for display purposes
symbol = "FCOIN"; // Set the symbol for display purposes
Expand All @@ -134,7 +135,7 @@ symbol = "FCOIN"; // Set the symbol for display pu
/* Approves and then calls the receiving contract */
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
emit Approval(msg.sender, _spender, _value);

//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this.
//receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData)
Expand Down

0 comments on commit b9346f7

Please sign in to comment.