-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from opencog/enhancement/minor-cleanups-indent…
…ations-interfaces enhancement/minor-cleanups-indentations-interfaces
- Loading branch information
Showing
14 changed files
with
116 additions
and
120 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.4.11; | ||
pragma solidity ^0.4.15; | ||
|
||
import "./ownership/ownable.sol"; | ||
|
||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.4.4; | ||
pragma solidity ^0.4.15; | ||
|
||
contract Migrations { | ||
address public owner; | ||
|
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
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 |
---|---|---|
@@ -1,11 +1,10 @@ | ||
pragma solidity ^0.4.11; | ||
pragma solidity ^0.4.15; | ||
|
||
import './Agent.sol'; | ||
|
||
contract AgentFactory { | ||
|
||
function create() public returns (Agent) { | ||
return new Agent(); | ||
} | ||
|
||
} | ||
function create() public returns (Agent) { | ||
return new Agent(); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.4.11; | ||
pragma solidity ^0.4.15; | ||
|
||
contract AgentInterface { | ||
|
||
|
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
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,8 @@ | ||
pragma solidity ^0.4.15; | ||
|
||
contract MarketJobInterface { | ||
|
||
function withdraw() external; | ||
function setJobCompleted() external; | ||
|
||
} |
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.4.11; | ||
pragma solidity ^0.4.15; | ||
|
||
import "./AgentRegistryInterface.sol"; | ||
|
||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.4.11; | ||
pragma solidity ^0.4.15; | ||
|
||
contract AgentRegistryInterface { | ||
|
||
|
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
|
||
pragma solidity ^0.4.11; | ||
pragma solidity ^0.4.15; | ||
|
||
contract ERC20 { | ||
function totalSupply() constant returns (uint); | ||
function balanceOf(address _owner) constant returns (uint); | ||
function allowance(address _owner, address _spender) constant returns (uint); | ||
function transfer(address _to, uint _amount) returns (bool); | ||
function transferFrom(address _from, address _to, uint _amount) returns (bool); | ||
function approve(address _spender, uint _amount) returns (bool); | ||
|
||
event Approval(address indexed owner, address indexed spender, uint amount); | ||
event Transfer(address indexed from, address indexed to, uint amount); | ||
} | ||
function totalSupply() constant returns (uint); | ||
function balanceOf(address _owner) constant returns (uint); | ||
function allowance(address _owner, address _spender) constant returns (uint); | ||
function transfer(address _to, uint _amount) returns (bool); | ||
function transferFrom(address _from, address _to, uint _amount) returns (bool); | ||
function approve(address _spender, uint _amount) returns (bool); | ||
|
||
event Approval(address indexed owner, address indexed spender, uint amount); | ||
event Transfer(address indexed from, address indexed to, uint amount); | ||
} |
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 |
---|---|---|
@@ -1,68 +1,60 @@ | ||
pragma solidity^0.4.11; | ||
pragma solidity ^0.4.15; | ||
|
||
import "./ERC20.sol"; | ||
import "../ownership/ownable.sol"; | ||
|
||
contract FixedSupplyToken is ERC20 { | ||
uint8 public constant decimals = 18; | ||
uint256 _totalSupply = 1000000; | ||
address public owner; | ||
contract FixedSupplyToken is ERC20, ownable { | ||
uint8 public constant decimals = 18; | ||
uint256 _totalSupply = 1000000; | ||
address public owner; | ||
|
||
mapping(address => uint256) balances; | ||
mapping(address => mapping (address => uint256)) allowed; | ||
mapping(address => uint256) balances; | ||
mapping(address => mapping (address => uint256)) allowed; | ||
|
||
modifier onlyOwner() { | ||
if (msg.sender != owner) { | ||
throw; | ||
|
||
function FixedSupplyToken() { | ||
balances[owner] = _totalSupply; | ||
} | ||
_; | ||
} | ||
|
||
function FixedSupplyToken() { | ||
owner = msg.sender; | ||
balances[owner] = _totalSupply; | ||
} | ||
function totalSupply() constant returns (uint) { | ||
return _totalSupply; | ||
} | ||
|
||
function totalSupply() constant returns (uint) { | ||
return _totalSupply; | ||
} | ||
function balanceOf(address _owner) constant returns (uint) { | ||
return balances[_owner]; | ||
} | ||
|
||
function balanceOf(address _owner) constant returns (uint) { | ||
return balances[_owner]; | ||
} | ||
function transfer(address _to, uint _amount) returns (bool) { | ||
if (balances[msg.sender] < _amount && _amount < 0 && balances[_to] + _amount < balances[_to]) { | ||
return false; | ||
} | ||
|
||
function transfer(address _to, uint _amount) returns (bool) { | ||
if (balances[msg.sender] >= _amount && _amount > 0 && balances[_to] + _amount > balances[_to]) { | ||
balances[msg.sender] -= _amount; | ||
balances[_to] += _amount; | ||
Transfer(msg.sender, _to, _amount); | ||
|
||
return true; | ||
} else { | ||
return false; | ||
balances[msg.sender] -= _amount; | ||
balances[_to] += _amount; | ||
Transfer(msg.sender, _to, _amount); | ||
return true; | ||
} | ||
} | ||
|
||
function transferFrom(address _from, address _to, uint256 _amount) returns (bool success) { | ||
if (balances[_from] >= _amount && allowed[_from][msg.sender] >= _amount && _amount > 0 && balances[_to] + _amount > balances[_to]) { | ||
if (balances[_from] < _amount && allowed[_from][msg.sender] < _amount && _amount < 0 && balances[_to] + _amount < balances[_to]) { | ||
return false; | ||
} | ||
|
||
balances[_from] -= _amount; | ||
allowed[_from][msg.sender] -= _amount; | ||
balances[_to] += _amount; | ||
Transfer(_from, _to, _amount); | ||
|
||
return true; | ||
} else { | ||
return false; | ||
} | ||
} | ||
|
||
function approve(address _spender, uint _amount) returns (bool) { | ||
allowed[msg.sender][_spender] = _amount; | ||
Approval(msg.sender, _spender, _amount); | ||
allowed[msg.sender][_spender] = _amount; | ||
Approval(msg.sender, _spender, _amount); | ||
|
||
return true; | ||
return true; | ||
} | ||
|
||
function allowance(address _owner, address _spender) constant returns (uint) { | ||
return allowed[_owner][_spender]; | ||
return allowed[_owner][_spender]; | ||
} | ||
} |
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