-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
226b0b2
commit 4db95bf
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
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,55 @@ | ||
pragma solidity ^0.4.0; | ||
import "./ERC20.sol"; | ||
|
||
contract crowdsale is ERC20 | ||
{ | ||
string standard="Token 1.0"; | ||
string name; | ||
string symbols; | ||
uint256 public totalsupply; | ||
uint256 initialallowed; | ||
|
||
mapping(address=>uint) public balanceOf; | ||
mapping(address=>mapping(address=>uint256))public allowed; | ||
|
||
function newconcept()public{ | ||
totalsupply=10000; | ||
balanceOf[msg.sender]=totalsupply; | ||
symbols="NT"; | ||
initialallowed=5000; | ||
} | ||
function totalSupply()public view returns(uint256) | ||
{ | ||
return totalsupply; | ||
} | ||
function transfer(address to, uint256 value)public returns(bool) { | ||
require(value <= balanceOf[msg.sender]); | ||
require(value <= allowed[msg.sender][to]); | ||
|
||
balanceOf[msg.sender]=balanceOf[msg.sender]-(value); | ||
balanceOf[to] =balanceOf[to]+(value); | ||
//allowed[msg.sender][to] = allowed[msg.sender][to]-(value); | ||
return true; | ||
} | ||
|
||
|
||
function allowance(address owner, address to) public returns (uint256) | ||
{ | ||
allowed[owner][to]=initialallowed; | ||
return allowed[owner][to]; | ||
} | ||
function balanceOf(address _owner)public view returns(uint256) | ||
{ | ||
return balanceOf[_owner]; | ||
} | ||
function approve(address spender, uint256 value) public returns (bool) | ||
{ | ||
allowed[msg.sender][spender]=value; | ||
return true; | ||
} | ||
function transferFrom (address from, address to, uint256 value)public returns (bool) | ||
{ | ||
allowed[msg.sender][from]=initialallowed; | ||
return true; | ||
} | ||
} |