mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update std to contain visibility specifiers
This commit is contained in:
parent
5b5367dc12
commit
a02cf83d86
@ -8,24 +8,24 @@ contract StandardToken is Token {
|
|||||||
mapping (address =>
|
mapping (address =>
|
||||||
mapping (address => uint256)) m_allowance;
|
mapping (address => uint256)) m_allowance;
|
||||||
|
|
||||||
function StandardToken(address _initialOwner, uint256 _supply) {
|
function StandardToken(address _initialOwner, uint256 _supply) public {
|
||||||
supply = _supply;
|
supply = _supply;
|
||||||
balance[_initialOwner] = _supply;
|
balance[_initialOwner] = _supply;
|
||||||
}
|
}
|
||||||
|
|
||||||
function balanceOf(address _account) constant returns (uint) {
|
function balanceOf(address _account) constant public returns (uint) {
|
||||||
return balance[_account];
|
return balance[_account];
|
||||||
}
|
}
|
||||||
|
|
||||||
function totalSupply() constant returns (uint) {
|
function totalSupply() constant public returns (uint) {
|
||||||
return supply;
|
return supply;
|
||||||
}
|
}
|
||||||
|
|
||||||
function transfer(address _to, uint256 _value) returns (bool success) {
|
function transfer(address _to, uint256 _value) public returns (bool success) {
|
||||||
return doTransfer(msg.sender, _to, _value);
|
return doTransfer(msg.sender, _to, _value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function transferFrom(address _from, address _to, uint256 _value) returns (bool) {
|
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
|
||||||
if (m_allowance[_from][msg.sender] >= _value) {
|
if (m_allowance[_from][msg.sender] >= _value) {
|
||||||
if (doTransfer(_from, _to, _value)) {
|
if (doTransfer(_from, _to, _value)) {
|
||||||
m_allowance[_from][msg.sender] -= _value;
|
m_allowance[_from][msg.sender] -= _value;
|
||||||
@ -47,13 +47,13 @@ contract StandardToken is Token {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function approve(address _spender, uint256 _value) returns (bool success) {
|
function approve(address _spender, uint256 _value) public returns (bool success) {
|
||||||
m_allowance[msg.sender][_spender] = _value;
|
m_allowance[msg.sender][_spender] = _value;
|
||||||
Approval(msg.sender, _spender, _value);
|
Approval(msg.sender, _spender, _value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function allowance(address _owner, address _spender) constant returns (uint256) {
|
function allowance(address _owner, address _spender) constant public returns (uint256) {
|
||||||
return m_allowance[_owner][_spender];
|
return m_allowance[_owner][_spender];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,10 +4,10 @@ contract Token {
|
|||||||
event Transfer(address indexed _from, address indexed _to, uint256 _value);
|
event Transfer(address indexed _from, address indexed _to, uint256 _value);
|
||||||
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
|
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
|
||||||
|
|
||||||
function totalSupply() constant returns (uint256 supply);
|
function totalSupply() constant public returns (uint256 supply);
|
||||||
function balanceOf(address _owner) constant returns (uint256 balance);
|
function balanceOf(address _owner) constant public returns (uint256 balance);
|
||||||
function transfer(address _to, uint256 _value) returns (bool success);
|
function transfer(address _to, uint256 _value) public returns (bool success);
|
||||||
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
|
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
|
||||||
function approve(address _spender, uint256 _value) returns (bool success);
|
function approve(address _spender, uint256 _value) public returns (bool success);
|
||||||
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
|
function allowance(address _owner, address _spender) constant public returns (uint256 remaining);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ pragma solidity ^0.4.0;
|
|||||||
import "./owned.sol";
|
import "./owned.sol";
|
||||||
|
|
||||||
contract mortal is owned {
|
contract mortal is owned {
|
||||||
function kill() {
|
function kill() public {
|
||||||
if (msg.sender == owner)
|
if (msg.sender == owner)
|
||||||
selfdestruct(owner);
|
selfdestruct(owner);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ contract owned {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function owned() {
|
function owned() public {
|
||||||
owner = msg.sender;
|
owner = msg.sender;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user