فهرست منبع

Refactor to current standards and making this only about contracts, not projects.

Simon de la Rouviere 8 سال پیش
والد
کامیت
45c5488cf0
54فایلهای تغییر یافته به همراه56 افزوده شده و 90583 حذف شده
  1. 1 5
      README.md
  2. 41 45
      contracts/Standard_Token_Factory/contracts/Standard_Token.sol
  3. 1 1
      contracts/Standard_Token_Factory/contracts/Standard_Token_Factory.sol
  4. 13 13
      contracts/Standard_Token_Factory/contracts/Token.sol
  5. 0 0
      contracts/outdated_contracts/Factory/Factory.sol
  6. 0 135
      contracts/outdated_contracts/Grand_Factory/Grand_Factory.sol
  7. 0 115
      contracts/outdated_contracts/Standard_Token_With_Owner_And_Create/Standard_With_Owner_And_Create.sol
  8. 0 3
      projects/README.md
  9. 0 3
      projects/factory/README.md
  10. 0 102
      projects/factory/app/contracts/Standard_Token.sol
  11. 0 112
      projects/factory/app/contracts/Standard_Token_Factory.sol
  12. 0 5
      projects/factory/app/css/bootstrap.min.css
  13. 0 8
      projects/factory/app/css/index.css
  14. 0 24
      projects/factory/app/index.html
  15. 0 7
      projects/factory/app/js/bootstrap.min.js
  16. 0 4
      projects/factory/app/js/jquery-2.1.4.min.js
  17. 0 19602
      projects/factory/app/js/react-0.13.3.js
  18. 0 1
      projects/factory/app/js/reactor.js
  19. 0 58
      projects/factory/app/js/script.jsx
  20. 0 21
      projects/factory/app/reactor_config.json
  21. 0 34
      projects/factory/app/token_reactor.json
  22. 0 16
      projects/factory/build/app.css
  23. 0 24929
      projects/factory/build/app.js
  24. 0 102
      projects/factory/build/contracts/Standard_Token.sol
  25. 0 104
      projects/factory/build/contracts/Standard_Token_Factory.sol
  26. 0 26
      projects/factory/build/index.html
  27. 0 23
      projects/factory/build/reactor_config.json
  28. 0 36
      projects/factory/build/token_reactor.json
  29. 0 27
      projects/factory/config/app.json
  30. 0 1
      projects/factory/config/development/config.json
  31. 0 3
      templates/README.md
  32. 0 22
      templates/personal_token/README.md
  33. 0 102
      templates/personal_token/app/contracts/Standard_Token.sol
  34. 0 5
      templates/personal_token/app/css/bootstrap.min.css
  35. 0 4
      templates/personal_token/app/css/index.css
  36. BIN
      templates/personal_token/app/images/example_vinay.jpg
  37. 0 25
      templates/personal_token/app/index.html
  38. 0 7
      templates/personal_token/app/js/bootstrap.min.js
  39. 0 15
      templates/personal_token/app/js/header.jsx
  40. 0 4
      templates/personal_token/app/js/jquery-2.1.4.min.js
  41. 0 19602
      templates/personal_token/app/js/react-0.13.3.js
  42. 0 1
      templates/personal_token/app/js/reactor.js
  43. 0 47
      templates/personal_token/app/js/script.jsx
  44. 0 4
      templates/personal_token/app/personal_token_config.json
  45. 0 34
      templates/personal_token/app/reactor_config.json
  46. 0 12
      templates/personal_token/build/app.css
  47. 0 24933
      templates/personal_token/build/app.js
  48. 0 102
      templates/personal_token/build/contracts/Standard_Token.sol
  49. BIN
      templates/personal_token/build/images/example_vinay.jpg
  50. 0 27
      templates/personal_token/build/index.html
  51. 0 6
      templates/personal_token/build/personal_token_config.json
  52. 0 36
      templates/personal_token/build/reactor_config.json
  53. 0 29
      templates/personal_token/config/app.json
  54. 0 1
      templates/personal_token/config/development/config.json

+ 1 - 5
README.md

@@ -1,9 +1,5 @@
 # Tokens
 
-This is a repo containing various contracts, templates & full-blown dapps related to token systems on Ethereum. It will be fleshed out over time.
-
-Contracts contains Solidity contracts, ready to be built upon.  
-Templates contain front-end components, where the developer can change basic parameters for a token system and then deploy it themselves, having a skin available.  
-Projects are more full-blown dapps developed by ConsenSys for use in Ethereum directly related to token systems (such as a dapp factory).
+Contains Token contracts along with tests (using Truffle). In libraries you will have parts that are to be implemented b
 
 "You get a token, you get a token, everyone gets a token!"

+ 41 - 45
contracts/Standard_Token_Factory/contracts/Standard_Token.sol

@@ -7,83 +7,79 @@ Based on standardised APIs: https://github.com/ethereum/wiki/wiki/Standardized_C
 import "Token";
 
 contract Standard_Token is Token {
-    uint total;
-    bytes32 defaultIdentifier = bytes32(address(this));
 
-    function Standard_Token(uint _initialAmount) {
-        balances[msg.sender][bytes32(address(this))] = _initialAmount;
-        totals[defaultIdentifier] = _initialAmount;
+    function Standard_Token(uint256 _initial_amount) {
+        balances[msg.sender] = _initial_amount;
+        total_supply = _initial_amount;
     }
 
-    function transfer(uint _value, bytes32 _identifier, address _to) returns (bool _success) {
-        if (balances[msg.sender][_identifier] >= _value) {
-            balances[msg.sender][_identifier] -= _value;
-            balances[_to][_identifier] += _value;
-            Transfer(msg.sender, _identifier, _to, _value);
+    function transfer(address _to, uint256 _value) returns (bool success) {
+        if (balances[msg.sender] >= _value) {
+            balances[msg.sender] -= _value;
+            balances[_to] += _value;
+            Transfer(msg.sender, _to, _value);
             return true;
         } else { return false; }
     }
 
-    function transferFrom(address _from, bytes32 _identifier, uint _value, address _to) returns (bool _success) {
-        if (balances[_from][_identifier] >= _value) {
+    function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
+        if (balances[_from] >= _value) {
             bool transfer = false;
-            if(approved[_from][_identifier][msg.sender]) {
+            if(approved[_from][msg.sender]) {
                 transfer = true;
             } else {
-                if(_value <= approved_once[_from][_identifier][msg.sender]) {
+                if(_value <= approved_once[_from][msg.sender]) {
                     transfer = true;
-                    approved_once[_from][_identifier][msg.sender] = 0; //reset
+                    approved_once[_from][msg.sender] = 0; //reset
                 }
             }
 
             if(transfer == true) {
-                balances[_from][_identifier] -= _value;
-                balances[_to][_identifier] += _value;
-                Transfer(_from, _identifier, _to, _value);
+                balances[_from] -= _value;
+                balances[_to] += _value;
+                Transfer(_from, _to, _value);
                 return true;
             } else { return false; }
         } else { return false; }
     }
 
-    function balanceOf(address _addr, bytes32 _identifier) constant returns (uint _r) {
-        return balances[_addr][_identifier];
+    function balanceOf(address _address) constant returns (uint256 balance) {
+        return balances[_address];
     }
 
-    function approve(address _addr, bytes32 _identifier) returns (bool _success) {
-        approved[msg.sender][_identifier][_addr] = true;
-        AddressApproval(msg.sender, _identifier, _addr, true);
+    function approve(address _address) returns (bool success) {
+        approved[msg.sender][_address] = true;
+        AddressApproval(msg.sender, _address, true);
         return true;
     }
-    
-    function unapprove(address _addr, bytes32 _identifier) returns (bool _success) {
-        approved[msg.sender][_identifier][_addr] = false;
-        approved_once[msg.sender][_identifier][_addr] = 0;
-        //debatable whether to include...
-        AddressApproval(msg.sender, _identifier, _addr, false);
-        AddressApprovalOnce(msg.sender, _identifier, _addr, 0);
+
+    function unapprove(address _address) returns (bool success) {
+        approved[msg.sender][_address] = false;
+        approved_once[msg.sender][_address] = 0;
+        AddressApproval(msg.sender, _address, false);
+        AddressApprovalOnce(msg.sender, _address, 0);
     }
-    
-    function isApprovedFor(address _target, bytes32 _identifier, address _proxy) constant returns (bool _r) {
-        return approved[_target][_identifier][_proxy];
+
+    function isApprovedFor(address _target, address _proxy) constant returns (bool success) {
+        return approved[_target][_proxy];
     }
 
-    function approveOnce(address _addr, bytes32 _identifier, uint256 _maxValue) returns (bool _success) {
-        approved_once[msg.sender][_identifier][_addr] = _maxValue;
-        AddressApprovalOnce(msg.sender, _identifier, _addr, _maxValue);
+    function approveOnce(address _address, uint256 _maxValue) returns (bool success) {
+        approved_once[msg.sender][_address] = _maxValue;
+        AddressApprovalOnce(msg.sender, _address, _maxValue);
         return true;
     }
 
-    function isApprovedOnceFor(address _target, bytes32 _identifier, address _proxy) constant returns (uint _maxValue) {
-        return approved_once[_target][_identifier][_proxy];
+    function isApprovedOnceFor(address _target, address _proxy) constant returns (uint256 _maxValue) {
+        return approved_once[_target][_proxy];
     }
 
-    function totalAmount(bytes32 _identifier) constant returns (uint _totalAmount) {
-        return totals[_identifier]; 
+    function totalSupply() constant returns (uint256 _total) {
+        return total_supply;
     }
 
-    //explicitly not publicly accessible. Should rely on methods for purpose of standardization.
-    mapping (bytes32 => uint) totals;
-    mapping (address => mapping (bytes32 => uint)) balances;
-    mapping (address => mapping (bytes32 => mapping (address => bool))) approved;
-    mapping (address => mapping (bytes32 => mapping (address => uint256))) approved_once;
+    mapping (address => uint) balances;
+    mapping (address => mapping (address => bool)) approved;
+    mapping (address => mapping (address => uint256)) approved_once;
+    uint256 total_supply;
 }

+ 1 - 1
contracts/Standard_Token_Factory/contracts/Standard_Token_Factory.sol

@@ -12,7 +12,7 @@ contract Standard_Token_Factory {
 
         address newTokenAddr = address(new Standard_Token(_initialAmount));
         Standard_Token newToken = Standard_Token(newTokenAddr);
-        newToken.transfer(_initialAmount, bytes32(newTokenAddr), msg.sender); //the factory will own the created tokens. You must transfer them.
+        newToken.transfer(msg.sender, _initialAmount); //the factory will own the created tokens. You must transfer them.
         uint count = created[msg.sender].length += 1;
         created[msg.sender][count-1] = newTokenAddr;
         created[msg.sender].length = count;

+ 13 - 13
contracts/Standard_Token_Factory/contracts/Token.sol

@@ -1,15 +1,15 @@
 contract Token {
-    function transfer(uint _value, bytes32 _identifier, address _to) returns (bool _success) {}
-    function transferFrom(address _from, bytes32 _identifier, uint _value, address _to) returns (bool _success) {}
-    function balanceOf(address _addr, bytes32 _identifier) constant returns (uint _r) {}
-    function approve(address _addr, bytes32 _identifier) returns (bool _success) {}
-    function unapprove(address _addr, bytes32 _identifier) returns (bool _success) {}
-    function isApprovedFor(address _target, bytes32 _identifier, address _proxy) constant returns (bool _r) {} 
-    function approveOnce(address _addr, bytes32 _identifier, uint256 _maxValue) returns (bool _success) {}
-    function isApprovedOnceFor(address _target,  bytes32 _identifier, address _proxy) constant returns (uint _maxValue) {}
-    function totalAmount(bytes32 _identifier) constant returns (uint _totalAmount) {}
-    
-    event Transfer(address indexed from, bytes32 _identifier, address indexed to, uint256 value);
-    event AddressApproval(address indexed addr, bytes32 _identifier, address indexed proxy, bool result);
-    event AddressApprovalOnce(address indexed addr, bytes32 _identifier, address indexed proxy, uint256 value);
+    function transfer(address _to, uint256 _value) returns (bool success) {}
+    function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
+    function balanceOf(address _address) constant returns (uint256 balance) {}
+    function approve(address _address) returns (bool success) {}
+    function unapprove(address _address) returns (bool success) {}
+    function isApprovedFor(address _target, address _proxy) constant returns (bool success) {}
+    function approveOnce(address _address, uint256 _maxValue) returns (bool success) {}
+    function isApprovedOnceFor(address _target, address _proxy) constant returns (uint256 _maxValue) {}
+    function totalSupply() constant returns (uint256 _total) {}
+
+    event Transfer(address indexed _address, address indexed _to, uint256 _value);
+    event AddressApproval(address indexed _address, address indexed _proxy, bool _result);
+    event AddressApprovalOnce(address indexed _address, address indexed _proxy, uint256 _value);
 }

+ 0 - 0
contracts/outdated_contracts/Factory/Factory.sol


+ 0 - 135
contracts/outdated_contracts/Grand_Factory/Grand_Factory.sol

@@ -1,135 +0,0 @@
-/*
-Factory: Contains all coin contracts.
-+ Separate Factories.
-+ Grand Overarching Factory.
-*/
-
-contract Coin {
-    function sendCoin(uint _value, address _to) returns (bool _success) {}
-    function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {}
-    function coinBalance() constant returns (uint _r) {}
-    function coinBalanceOf(address _addr) constant returns (uint _r) {}
-    function approve(address _addr) {}
-    function approveOnce(address _addr, uint256 _maxValue) {}
-    function unapprove(address _addr) {}
-    function isApproved(address _proxy) constant returns (bool _r) {}
-    function isApprovedFor(address _target, address _proxy) constant returns (bool _r) {}
-}
-
-contract Standard_Token is Coin {
-
-    function Standard_Token(uint _initialAmount) {
-        balances[msg.sender] = _initialAmount;
-    }
-
-    event CoinTransfer(address indexed from, address indexed to, uint256 value);
-    event AddressApproval(address indexed from, address indexed to, bool result);
-    event AddressApprovalOnce(address indexed from, address indexed to, uint256 value);
-
-    function sendCoin(uint _value, address _to) returns (bool _success) {
-        if (balances[msg.sender] >= _value) {
-            balances[msg.sender] -= _value;
-            balances[_to] += _value;
-            CoinTransfer(msg.sender, _to, _value);
-            return true;
-        } else { return false; }
-    }
-
-    function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {
-        if (balances[_from] >= _value) {
-            bool transfer = false;
-            if(approved[_from][msg.sender]) {
-                transfer = true;
-            } else {
-                if(_value < approved_once[_from][msg.sender]) {
-                    transfer = true;
-                    approved_once[_from][msg.sender] = 0; //reset
-                }
-            }
-
-            if(transfer == true) {
-                balances[_from] -= _value;
-                balances[_to] += _value;
-                CoinTransfer(_from, _to, _value);
-                return true;
-            } else { return false; }
-        }
-    }
-
-    function coinBalance() constant returns (uint _r) {
-        return balances[msg.sender];
-    }
-
-    function coinBalanceOf(address _addr) constant returns (uint _r) {
-        return balances[_addr];
-    }
-
-    function approve(address _addr) {
-        approved[msg.sender][_addr] = true;
-        AddressApproval(msg.sender, _addr, true);
-    }
-
-    function approveOnce(address _addr, uint256 _maxValue) {
-        approved_once[msg.sender][_addr] = _maxValue;
-        AddressApprovalOnce(msg.sender, _addr, _maxValue);
-    }
-
-    function unapprove(address _addr) {
-        approved[msg.sender][_addr] = false;
-        approved_once[msg.sender][_addr] = 0;
-        AddressApproval(msg.sender, _addr, false);
-        AddressApprovalOnce(msg.sender, _addr, 0);
-    }
-
-    function isApproved(address _proxy) constant returns (bool _r) {
-        if(approved[msg.sender][_proxy] == true || approved_once[msg.sender][_proxy] > 0) {
-            return true;
-        }
-    }
-
-    function isApprovedFor(address _target, address _proxy) constant returns (bool _r) {
-        if(approved[_target][_proxy] == true || approved_once[_target][_proxy] > 0) {
-            return true;
-        }
-    }
-
-    mapping (address => uint) public balances;
-    mapping (address => mapping (address => bool)) public approved;
-    mapping (address => mapping (address => uint256)) public approved_once;
-}
-
-import "owned"; //standard library
-
-contract Token_With_Owner_And_Create is Standard_Token, owned {
-    
-    function Token_With_Owner_And_Create(uint _initialAmount) Standard_Token(_initialAmount) {}
-    
-    modifier isOwner {
-        if(msg.sender == owner) {
-            _
-        }
-    }
-    
-    function createToken(address _for, uint256 _value) isOwner {
-        balances[_for] += _value;
-    }
-}
-
-contract Standard_Token_Factory {
-    
-    function createStandardToken(uint256 _initialAmount) returns (address) {
-        return address(new Standard_Token(_initialAmount));
-    }
-}
-
-contract Standard_Token_With_Owner_And_Create_Factory {
-    
-    function createStandardTokenWithOwnerAndCreate(uint256 _initialAmount) returns (address) {
-        return address(new Token_With_Owner_And_Create(_initialAmount));
-    }
-}
-
-contract Grand_Factory is 
-        Standard_Token_Factory, 
-        Standard_Token_With_Owner_And_Create_Factory 
-{}

+ 0 - 115
contracts/outdated_contracts/Standard_Token_With_Owner_And_Create/Standard_With_Owner_And_Create.sol

@@ -1,115 +0,0 @@
-/*
-Adds possibility for owner to mint new tokens.
-*/
-
-contract Coin {
-    function sendCoin(uint _value, address _to) returns (bool _success) {}
-    function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {}
-    function coinBalance() constant returns (uint _r) {}
-    function coinBalanceOf(address _addr) constant returns (uint _r) {}
-    function approve(address _addr) {}
-    function approveOnce(address _addr, uint256 _maxValue) {}
-    function unapprove(address _addr) {}
-    function isApproved(address _proxy) constant returns (bool _r) {}
-    function isApprovedFor(address _target, address _proxy) constant returns (bool _r) {}
-}
-
-contract Standard_Token is Coin {
-    
-    function Standard_Token(uint _initialAmount) {
-        balances[msg.sender] = _initialAmount;
-    }
-    
-    event CoinTransfer(address indexed from, address indexed to, uint256 value);
-    event AddressApproval(address indexed from, address indexed to, bool result);
-    event AddressApprovalOnce(address indexed from, address indexed to, uint256 value);
-    
-    function sendCoin(uint _value, address _to) returns (bool _success) {
-        if (balances[msg.sender] >= _value) {
-            balances[msg.sender] -= _value;
-            balances[_to] += _value;
-            CoinTransfer(msg.sender, _to, _value);
-            return true;
-        } else { return false; }
-    }
-    
-    function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {
-        if (balances[_from] >= _value) {
-            bool transfer = false;
-            if(approved[_from][msg.sender]) { 
-                transfer = true; 
-            } else {
-                if(_value < approved_once[_from][msg.sender]) { 
-                    transfer = true; 
-                    approved_once[_from][msg.sender] = 0; //reset
-                }
-            }
-            
-            if(transfer == true) {
-                balances[_from] -= _value;
-                balances[_to] += _value;
-                CoinTransfer(_from, _to, _value);
-                return true;
-            } else { return false; }
-        }
-    }
-    
-    function coinBalance() constant returns (uint _r) {
-        return balances[msg.sender];
-    }
-    
-    function coinBalanceOf(address _addr) constant returns (uint _r) {
-        return balances[_addr];
-    }
-    
-    function approve(address _addr) {
-        approved[msg.sender][_addr] = true;
-        AddressApproval(msg.sender, _addr, true);
-    }
-    
-    function approveOnce(address _addr, uint256 _maxValue) {
-        approved_once[msg.sender][_addr] = _maxValue;
-        AddressApprovalOnce(msg.sender, _addr, _maxValue);
-    }
-    
-    function unapprove(address _addr) {
-        approved[msg.sender][_addr] = false;
-        approved_once[msg.sender][_addr] = 0;
-        AddressApproval(msg.sender, _addr, false);
-        AddressApprovalOnce(msg.sender, _addr, 0);
-    }
-    
-    function isApproved(address _proxy) constant returns (bool _r) {
-        if(approved[msg.sender][_proxy] == true || approved_once[msg.sender][_proxy] > 0) {
-            return true;
-        }
-    }
-    
-    function isApprovedFor(address _target, address _proxy) constant returns (bool _r) {
-        if(approved[_target][_proxy] == true || approved_once[_target][_proxy] > 0) {
-            return true;
-        }
-    }
-    
-    mapping (address => uint) public balances;
-    mapping (address => mapping (address => bool)) public approved;
-    mapping (address => mapping (address => uint256)) public approved_once;
-}
-
-import "owned"; //standard library
-
-contract Token_With_Owner_And_Create is Standard_Token, owned {
-    
-    function Token_With_Owner_And_Create(uint _initialAmount) Standard_Token(_initialAmount) {}
-    
-    modifier isOwner {
-        if(msg.sender == owner) {
-            _
-        }
-    }
-    
-    function createToken(address _for, uint256 _value) isOwner {
-        balances[_for] += _value;
-    }
-}
-

+ 0 - 3
projects/README.md

@@ -1,3 +0,0 @@
-# Projects
-
-This directory contains full blown dapps that are deployed on Ethereum. The first is a factory that allows people to craft their own tokens without having to fork templates.

+ 0 - 3
projects/factory/README.md

@@ -1,3 +0,0 @@
-# Standard Token Factory
-
-A dapp that allows to create a basic token system. Your current options are to set the starting amount of the token. The factory also has a lightweight browser (referenced by address/registry) to any of these token systems.

+ 0 - 102
projects/factory/app/contracts/Standard_Token.sol

@@ -1,102 +0,0 @@
-/*Most, basic default, standardised Token contract.
-Allows the creation of a token with a finite issued amount to the creator.
-This can't be changed.
-
-Based on standardised APIs & slightly extended. https://github.com/ethereum/wiki/wiki/Standardized_Contract_APIs
-adds AddressApproval & AddressApprovalOnce events
-approve & approveOnce works on premise that approved always takes precedence.
-adds unapprove to basic coin interface.*/
-
-contract Coin {
-    function sendCoin(uint _value, address _to) returns (bool _success) {}
-    function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {}
-    function coinBalance() constant returns (uint _r) {}
-    function coinBalanceOf(address _addr) constant returns (uint _r) {}
-    function approve(address _addr) {}
-    function approveOnce(address _addr, uint256 _maxValue) {}
-    function unapprove(address _addr) {}
-    function isApproved(address _proxy) constant returns (bool _r) {}
-    function isApprovedFor(address _target, address _proxy) constant returns (bool _r) {}
-}
-
-contract Standard_Token is Coin {
-    
-    function Standard_Token(uint _initialAmount) {
-        balances[msg.sender] = _initialAmount;
-    }
-    
-    event CoinTransfer(address indexed from, address indexed to, uint256 value);
-    event AddressApproval(address indexed from, address indexed to, bool result);
-    event AddressApprovalOnce(address indexed from, address indexed to, uint256 value);
-    
-    function sendCoin(uint _value, address _to) returns (bool _success) {
-        if (balances[msg.sender] >= _value) {
-            balances[msg.sender] -= _value;
-            balances[_to] += _value;
-            CoinTransfer(msg.sender, _to, _value);
-            return true;
-        } else { return false; }
-    }
-    
-    function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {
-        if (balances[_from] >= _value) {
-            bool transfer = false;
-            if(approved[_from][msg.sender]) { 
-                transfer = true; 
-            } else {
-                if(_value < approved_once[_from][msg.sender]) { 
-                    transfer = true; 
-                    approved_once[_from][msg.sender] = 0; //reset
-                }
-            }
-            
-            if(transfer == true) {
-                balances[_from] -= _value;
-                balances[_to] += _value;
-                CoinTransfer(_from, _to, _value);
-                return true;
-            } else { return false; }
-        }
-    }
-    
-    function coinBalance() constant returns (uint _r) {
-        return balances[msg.sender];
-    }
-    
-    function coinBalanceOf(address _addr) constant returns (uint _r) {
-        return balances[_addr];
-    }
-    
-    function approve(address _addr) {
-        approved[msg.sender][_addr] = true;
-        AddressApproval(msg.sender, _addr, true);
-    }
-    
-    function approveOnce(address _addr, uint256 _maxValue) {
-        approved_once[msg.sender][_addr] = _maxValue;
-        AddressApprovalOnce(msg.sender, _addr, _maxValue);
-    }
-    
-    function unapprove(address _addr) {
-        approved[msg.sender][_addr] = false;
-        approved_once[msg.sender][_addr] = 0;
-        AddressApproval(msg.sender, _addr, false);
-        AddressApprovalOnce(msg.sender, _addr, 0);
-    }
-    
-    function isApproved(address _proxy) constant returns (bool _r) {
-        if(approved[msg.sender][_proxy] == true || approved_once[msg.sender][_proxy] > 0) {
-            return true;
-        }
-    }
-    
-    function isApprovedFor(address _target, address _proxy) constant returns (bool _r) {
-        if(approved[_target][_proxy] == true || approved_once[_target][_proxy] > 0) {
-            return true;
-        }
-    }
-    
-    mapping (address => uint) public balances;
-    mapping (address => mapping (address => bool)) public approved;
-    mapping (address => mapping (address => uint256)) public approved_once;
-}

+ 0 - 112
projects/factory/app/contracts/Standard_Token_Factory.sol

@@ -1,112 +0,0 @@
-contract Coin {
-    function sendCoin(uint _value, address _to) returns (bool _success) {}
-    function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {}
-    function coinBalance() constant returns (uint _r) {}
-    function coinBalanceOf(address _addr) constant returns (uint _r) {}
-    function approve(address _addr) {}
-    function approveOnce(address _addr, uint256 _maxValue) {}
-    function unapprove(address _addr) {}
-    function isApproved(address _proxy) constant returns (bool _r) {}
-    function isApprovedFor(address _target, address _proxy) constant returns (bool _r) {}
-}
-
-contract Standard_Token is Coin {
-
-    function Standard_Token(uint _initialAmount) {
-        balances[msg.sender] = _initialAmount;
-    }
-
-    event CoinTransfer(address indexed from, address indexed to, uint256 value);
-    event AddressApproval(address indexed from, address indexed to, bool result);
-    event AddressApprovalOnce(address indexed from, address indexed to, uint256 value);
-
-    function sendCoin(uint _value, address _to) returns (bool _success) {
-        if (balances[msg.sender] >= _value) {
-            balances[msg.sender] -= _value;
-            balances[_to] += _value;
-            CoinTransfer(msg.sender, _to, _value);
-            return true;
-        } else { return false; }
-    }
-
-    function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {
-        if (balances[_from] >= _value) {
-            bool transfer = false;
-            if(approved[_from][msg.sender]) {
-                transfer = true;
-            } else {
-                if(_value < approved_once[_from][msg.sender]) {
-                    transfer = true;
-                    approved_once[_from][msg.sender] = 0; //reset
-                }
-            }
-
-            if(transfer == true) {
-                balances[_from] -= _value;
-                balances[_to] += _value;
-                CoinTransfer(_from, _to, _value);
-                return true;
-            } else { return false; }
-        }
-    }
-
-    function coinBalance() constant returns (uint _r) {
-        return balances[msg.sender];
-    }
-
-    function coinBalanceOf(address _addr) constant returns (uint _r) {
-        return balances[_addr];
-    }
-
-    function approve(address _addr) {
-        approved[msg.sender][_addr] = true;
-        AddressApproval(msg.sender, _addr, true);
-    }
-
-    function approveOnce(address _addr, uint256 _maxValue) {
-        approved_once[msg.sender][_addr] = _maxValue;
-        AddressApprovalOnce(msg.sender, _addr, _maxValue);
-    }
-
-    function unapprove(address _addr) {
-        approved[msg.sender][_addr] = false;
-        approved_once[msg.sender][_addr] = 0;
-        AddressApproval(msg.sender, _addr, false);
-        AddressApprovalOnce(msg.sender, _addr, 0);
-    }
-
-    function isApproved(address _proxy) constant returns (bool _r) {
-        if(approved[msg.sender][_proxy] == true || approved_once[msg.sender][_proxy] > 0) {
-            return true;
-        }
-    }
-
-    function isApprovedFor(address _target, address _proxy) constant returns (bool _r) {
-        if(approved[_target][_proxy] == true || approved_once[_target][_proxy] > 0) {
-            return true;
-        }
-    }
-
-    mapping (address => uint) public balances;
-    mapping (address => mapping (address => bool)) public approved;
-    mapping (address => mapping (address => uint256)) public approved_once;
-}
-
-contract Standard_Token_Factory {
-
-    mapping(address => address[]) public created;
-    
-    function createdByMe() returns (address[]) {
-        return created[msg.sender];
-    }
-
-    function createStandardToken(uint256 _initialAmount) returns (address) {
-        
-        address newTokenAddr = address(new Standard_Token(_initialAmount));
-        Standard_Token newToken = Standard_Token(newTokenAddr);
-        newToken.sendCoin(_initialAmount, msg.sender); //the factory will own the created tokens. You must transfer them.
-        uint count = created[msg.sender].length += 1;
-        created[msg.sender][count-1] = newTokenAddr;
-        created[msg.sender].length = count;
-    }
-}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 5
projects/factory/app/css/bootstrap.min.css


+ 0 - 8
projects/factory/app/css/index.css

@@ -1,8 +0,0 @@
-.container { 
-}
-
-#header {
-margin: 50px;
-}
-
-

+ 0 - 24
projects/factory/app/index.html

@@ -1,24 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width, initial-scale=1">
-    <title>Ethereum Token Factory</title>
-    <link href="./app.css" rel='stylesheet' type='text/css'>
-    <script src="./app.js"></script>
-
-</head>
-
-<body>
-<div class="container">
-    <div id="header">
-    </div>
-    <div id="contracts">
-    </div>
-
-</div>
-
-</body>
-
-</html>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 7
projects/factory/app/js/bootstrap.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 4
projects/factory/app/js/jquery-2.1.4.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 19602
projects/factory/app/js/react-0.13.3.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 1
projects/factory/app/js/reactor.js


+ 0 - 58
projects/factory/app/js/script.jsx

@@ -1,58 +0,0 @@
-//EXAMPLE
-//helper function to get URL parameters.
-var urlParams;
-(window.onpopstate = function () {
-    var match,
-        pl     = /\+/g,  // Regex for replacing addition symbol with a space
-        search = /([^&=]+)=?([^&]*)/g,
-        decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
-        query  = window.location.search.substring(1);
-
-    urlParams = {};
-    while (match = search.exec(query))
-       urlParams[decode(match[1])] = decode(match[2]);
-})();
-/*------------------*/
-
-var config;
-if("config" in urlParams) {
-    config = urlParams['config'];
-} else {
-    var config = './reactor_config.json'; //default
-}
-
-if("address" in urlParams) {
-    config = './token_reactor.json';
-}
-
-var Header = React.createClass({
-    render: function() {
-        return (<div><h2>{this.props.title}</h2></div>);
-    }
-});
-
-$.ajax({
-    url: config,
-    dataType: 'json',
-    cache: false,
-    error: function(data) {
-        console.log(data);
-        console.log("error");
-    },
-    success: function(data) {
-        //map through multiple contracts (this includes multiple ones in 1 file + different files).
-        console.log(data);
-        console.log("success");
-        var reactor_config = parseConfig(data);
-
-        //fetch template specific config information
-        if("address" in urlParams) {
-            React.render(<Header title={"Token functions"}/>, document.getElementById('header'));
-        } else {
-            React.render(<Header title={"Create & Deploy a Token Contract"}/>, document.getElementById('header'));
-        }
-
-
-        React.render(<ContainerHelper templates={reactor_config.templates} compiled={reactor_config.total_compiled} addresses={reactor_config.addresses} options={reactor_config.options}/>, document.getElementById('contracts'));
-    }
-});

+ 0 - 21
projects/factory/app/reactor_config.json

@@ -1,21 +0,0 @@
-{
-    "contracts": { 
-        "Standard_Token_Factory": {
-            "address": "0x0",
-            "path": "contracts/Standard_Token_Factory.sol",
-            "template_overlay": false,
-            "deploy_overlay": false,
-            "template": {
-                "createStandardToken": {
-                    "button": "Deploy Token Contract!",
-                    "inputs": {
-                        "_initialAmount": {
-                            "label": "Starting Amount",
-                            "default_value": "eg 10000"
-                        }
-                    }
-                }
-            }
-        }
-    }
-} 

+ 0 - 34
projects/factory/app/token_reactor.json

@@ -1,34 +0,0 @@
-{
-    "contracts": { 
-        "Standard_Token": {
-            "address": "0xbc72cf3079e08295364510917f92a10d0d54f9d2",
-            "path": "contracts/Standard_Token.sol",
-            "template_overlay": true,
-            "deploy_overlay": false,
-            "template": {
-                "coinBalanceOf": {
-                    "button": "Check Balance",
-                    "inputs": {
-                        "_addr": {
-                            "label": "Address",
-                            "default_value": "eg 0xbc72cf3079e08295364510917f92a10d0d54f9d2"
-                        }
-                    }
-                },
-                "sendCoin": {
-                    "button": "Send Token",
-                    "inputs": {
-                        "_to": {
-                            "label": "Insert Address",
-                            "default_value": "eg 0xbc72cf3079e08295364510917f92a10d0d54f9d2"
-                        },
-                        "_value": {
-                            "label": "Amount to send",
-                            "default_value": "eg 12"
-                        }
-                    }
-                }
-            }
-        }
-    }
-} 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 16
projects/factory/build/app.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 24929
projects/factory/build/app.js


+ 0 - 102
projects/factory/build/contracts/Standard_Token.sol

@@ -1,102 +0,0 @@
-/*Most, basic default, standardised Token contract.
-Allows the creation of a token with a finite issued amount to the creator.
-This can't be changed.
-
-Based on standardised APIs & slightly extended. https://github.com/ethereum/wiki/wiki/Standardized_Contract_APIs
-adds AddressApproval & AddressApprovalOnce events
-approve & approveOnce works on premise that approved always takes precedence.
-adds unapprove to basic coin interface.*/
-
-contract Coin {
-    function sendCoin(uint _value, address _to) returns (bool _success) {}
-    function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {}
-    function coinBalance() constant returns (uint _r) {}
-    function coinBalanceOf(address _addr) constant returns (uint _r) {}
-    function approve(address _addr) {}
-    function approveOnce(address _addr, uint256 _maxValue) {}
-    function unapprove(address _addr) {}
-    function isApproved(address _proxy) constant returns (bool _r) {}
-    function isApprovedFor(address _target, address _proxy) constant returns (bool _r) {}
-}
-
-contract Standard_Token is Coin {
-    
-    function Standard_Token(uint _initialAmount) {
-        balances[msg.sender] = _initialAmount;
-    }
-    
-    event CoinTransfer(address indexed from, address indexed to, uint256 value);
-    event AddressApproval(address indexed from, address indexed to, bool result);
-    event AddressApprovalOnce(address indexed from, address indexed to, uint256 value);
-    
-    function sendCoin(uint _value, address _to) returns (bool _success) {
-        if (balances[msg.sender] >= _value) {
-            balances[msg.sender] -= _value;
-            balances[_to] += _value;
-            CoinTransfer(msg.sender, _to, _value);
-            return true;
-        } else { return false; }
-    }
-    
-    function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {
-        if (balances[_from] >= _value) {
-            bool transfer = false;
-            if(approved[_from][msg.sender]) { 
-                transfer = true; 
-            } else {
-                if(_value < approved_once[_from][msg.sender]) { 
-                    transfer = true; 
-                    approved_once[_from][msg.sender] = 0; //reset
-                }
-            }
-            
-            if(transfer == true) {
-                balances[_from] -= _value;
-                balances[_to] += _value;
-                CoinTransfer(_from, _to, _value);
-                return true;
-            } else { return false; }
-        }
-    }
-    
-    function coinBalance() constant returns (uint _r) {
-        return balances[msg.sender];
-    }
-    
-    function coinBalanceOf(address _addr) constant returns (uint _r) {
-        return balances[_addr];
-    }
-    
-    function approve(address _addr) {
-        approved[msg.sender][_addr] = true;
-        AddressApproval(msg.sender, _addr, true);
-    }
-    
-    function approveOnce(address _addr, uint256 _maxValue) {
-        approved_once[msg.sender][_addr] = _maxValue;
-        AddressApprovalOnce(msg.sender, _addr, _maxValue);
-    }
-    
-    function unapprove(address _addr) {
-        approved[msg.sender][_addr] = false;
-        approved_once[msg.sender][_addr] = 0;
-        AddressApproval(msg.sender, _addr, false);
-        AddressApprovalOnce(msg.sender, _addr, 0);
-    }
-    
-    function isApproved(address _proxy) constant returns (bool _r) {
-        if(approved[msg.sender][_proxy] == true || approved_once[msg.sender][_proxy] > 0) {
-            return true;
-        }
-    }
-    
-    function isApprovedFor(address _target, address _proxy) constant returns (bool _r) {
-        if(approved[_target][_proxy] == true || approved_once[_target][_proxy] > 0) {
-            return true;
-        }
-    }
-    
-    mapping (address => uint) public balances;
-    mapping (address => mapping (address => bool)) public approved;
-    mapping (address => mapping (address => uint256)) public approved_once;
-}

+ 0 - 104
projects/factory/build/contracts/Standard_Token_Factory.sol

@@ -1,104 +0,0 @@
-/*
-A factory to mint any Standard Tokens.
-*/
-
-contract Coin {
-    function sendCoin(uint _value, address _to) returns (bool _success) {}
-    function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {}
-    function coinBalance() constant returns (uint _r) {}
-    function coinBalanceOf(address _addr) constant returns (uint _r) {}
-    function approve(address _addr) {}
-    function approveOnce(address _addr, uint256 _maxValue) {}
-    function unapprove(address _addr) {}
-    function isApproved(address _proxy) constant returns (bool _r) {}
-    function isApprovedFor(address _target, address _proxy) constant returns (bool _r) {}
-}
-
-contract Standard_Token is Coin {
-
-    function Standard_Token(uint _initialAmount) {
-        balances[msg.sender] = _initialAmount;
-    }
-
-    event CoinTransfer(address indexed from, address indexed to, uint256 value);
-    event AddressApproval(address indexed from, address indexed to, bool result);
-    event AddressApprovalOnce(address indexed from, address indexed to, uint256 value);
-
-    function sendCoin(uint _value, address _to) returns (bool _success) {
-        if (balances[msg.sender] >= _value) {
-            balances[msg.sender] -= _value;
-            balances[_to] += _value;
-            CoinTransfer(msg.sender, _to, _value);
-            return true;
-        } else { return false; }
-    }
-
-    function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {
-        if (balances[_from] >= _value) {
-            bool transfer = false;
-            if(approved[_from][msg.sender]) {
-                transfer = true;
-            } else {
-                if(_value < approved_once[_from][msg.sender]) {
-                    transfer = true;
-                    approved_once[_from][msg.sender] = 0; //reset
-                }
-            }
-
-            if(transfer == true) {
-                balances[_from] -= _value;
-                balances[_to] += _value;
-                CoinTransfer(_from, _to, _value);
-                return true;
-            } else { return false; }
-        }
-    }
-
-    function coinBalance() constant returns (uint _r) {
-        return balances[msg.sender];
-    }
-
-    function coinBalanceOf(address _addr) constant returns (uint _r) {
-        return balances[_addr];
-    }
-
-    function approve(address _addr) {
-        approved[msg.sender][_addr] = true;
-        AddressApproval(msg.sender, _addr, true);
-    }
-
-    function approveOnce(address _addr, uint256 _maxValue) {
-        approved_once[msg.sender][_addr] = _maxValue;
-        AddressApprovalOnce(msg.sender, _addr, _maxValue);
-    }
-
-    function unapprove(address _addr) {
-        approved[msg.sender][_addr] = false;
-        approved_once[msg.sender][_addr] = 0;
-        AddressApproval(msg.sender, _addr, false);
-        AddressApprovalOnce(msg.sender, _addr, 0);
-    }
-
-    function isApproved(address _proxy) constant returns (bool _r) {
-        if(approved[msg.sender][_proxy] == true || approved_once[msg.sender][_proxy] > 0) {
-            return true;
-        }
-    }
-
-    function isApprovedFor(address _target, address _proxy) constant returns (bool _r) {
-        if(approved[_target][_proxy] == true || approved_once[_target][_proxy] > 0) {
-            return true;
-        }
-    }
-
-    mapping (address => uint) public balances;
-    mapping (address => mapping (address => bool)) public approved;
-    mapping (address => mapping (address => uint256)) public approved_once;
-}
-
-contract Standard_Token_Factory {
-    
-    function createStandardToken(uint256 _initialAmount) returns (address) {
-        return address(new Standard_Token(_initialAmount));
-    }
-}

+ 0 - 26
projects/factory/build/index.html

@@ -1,26 +0,0 @@
-
-
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width, initial-scale=1">
-    <title>Ethereum Token Factory</title>
-    <link href="./app.css" rel='stylesheet' type='text/css'>
-    <script src="./app.js"></script>
-
-</head>
-
-<body>
-<div class="container">
-    <div id="header">
-    </div>
-    <div id="contracts">
-    </div>
-
-</div>
-
-</body>
-
-</html>

+ 0 - 23
projects/factory/build/reactor_config.json

@@ -1,23 +0,0 @@
-
-
-{
-    "contracts": { 
-        "Standard_Token_Factory": {
-            "address": "0x0",
-            "path": "contracts/Standard_Token_Factory.sol",
-            "template_overlay": false,
-            "deploy_overlay": false,
-            "template": {
-                "createStandardToken": {
-                    "button": "Deploy Token Contract!",
-                    "inputs": {
-                        "_initialAmount": {
-                            "label": "Starting Amount",
-                            "default_value": "eg 10000"
-                        }
-                    }
-                }
-            }
-        }
-    }
-} 

+ 0 - 36
projects/factory/build/token_reactor.json

@@ -1,36 +0,0 @@
-
-
-{
-    "contracts": { 
-        "Standard_Token": {
-            "address": "0xbc72cf3079e08295364510917f92a10d0d54f9d2",
-            "path": "contracts/Standard_Token.sol",
-            "template_overlay": true,
-            "deploy_overlay": false,
-            "template": {
-                "coinBalanceOf": {
-                    "button": "Check Balance",
-                    "inputs": {
-                        "_addr": {
-                            "label": "Address",
-                            "default_value": "eg 0xbc72cf3079e08295364510917f92a10d0d54f9d2"
-                        }
-                    }
-                },
-                "sendCoin": {
-                    "button": "Send Token",
-                    "inputs": {
-                        "_to": {
-                            "label": "Insert Address",
-                            "default_value": "eg 0xbc72cf3079e08295364510917f92a10d0d54f9d2"
-                        },
-                        "_value": {
-                            "label": "Amount to send",
-                            "default_value": "eg 12"
-                        }
-                    }
-                }
-            }
-        }
-    }
-} 

+ 0 - 27
projects/factory/config/app.json

@@ -1,27 +0,0 @@
-{
-    "build": {
-        "index.html": "index.html",
-        "app.js": [
-            "js/jquery-2.1.4.min.js",
-            "js/bootstrap.min.js",
-            "js/react-0.13.3.js",
-            "js/reactor.js",
-            "js/script.jsx"
-        ],
-        "app.css": [
-            "css/bootstrap.min.css",
-            "css/index.css"
-        ],
-        "reactor_config.json": "reactor_config.json",
-        "token_reactor.json": "token_reactor.json",
-        "contracts/": "contracts/"
-    },
-    "deploy": [
-        "Standard_Token"
-    ],
-    "rpc": {
-        "host": "localhost",
-        "port": 8080
-    }
-}
-

+ 0 - 1
projects/factory/config/development/config.json

@@ -1 +0,0 @@
-{}

+ 0 - 3
templates/README.md

@@ -1,3 +0,0 @@
-# Templates
-
-This directory contains already completed dapps that act as templates. Fork, change parameters (such as name & images to use), deploy contracts, set address of contract and you are set. Each template has its own instructions on what is changeable/forkable.

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 22
templates/personal_token/README.md


+ 0 - 102
templates/personal_token/app/contracts/Standard_Token.sol

@@ -1,102 +0,0 @@
-/*Most, basic default, standardised Token contract.
-Allows the creation of a token with a finite issued amount to the creator.
-This can't be changed.
-
-Based on standardised APIs & slightly extended. https://github.com/ethereum/wiki/wiki/Standardized_Contract_APIs
-adds AddressApproval & AddressApprovalOnce events
-approve & approveOnce works on premise that approved always takes precedence.
-adds unapprove to basic coin interface.*/
-
-contract Coin {
-    function sendCoin(uint _value, address _to) returns (bool _success) {}
-    function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {}
-    function coinBalance() constant returns (uint _r) {}
-    function coinBalanceOf(address _addr) constant returns (uint _r) {}
-    function approve(address _addr) {}
-    function approveOnce(address _addr, uint256 _maxValue) {}
-    function unapprove(address _addr) {}
-    function isApproved(address _proxy) constant returns (bool _r) {}
-    function isApprovedFor(address _target, address _proxy) constant returns (bool _r) {}
-}
-
-contract Standard_Token is Coin {
-    
-    function Standard_Token(uint _initialAmount) {
-        balances[msg.sender] = _initialAmount;
-    }
-    
-    event CoinTransfer(address indexed from, address indexed to, uint256 value);
-    event AddressApproval(address indexed from, address indexed to, bool result);
-    event AddressApprovalOnce(address indexed from, address indexed to, uint256 value);
-    
-    function sendCoin(uint _value, address _to) returns (bool _success) {
-        if (balances[msg.sender] >= _value) {
-            balances[msg.sender] -= _value;
-            balances[_to] += _value;
-            CoinTransfer(msg.sender, _to, _value);
-            return true;
-        } else { return false; }
-    }
-    
-    function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {
-        if (balances[_from] >= _value) {
-            bool transfer = false;
-            if(approved[_from][msg.sender]) { 
-                transfer = true; 
-            } else {
-                if(_value < approved_once[_from][msg.sender]) { 
-                    transfer = true; 
-                    approved_once[_from][msg.sender] = 0; //reset
-                }
-            }
-            
-            if(transfer == true) {
-                balances[_from] -= _value;
-                balances[_to] += _value;
-                CoinTransfer(_from, _to, _value);
-                return true;
-            } else { return false; }
-        }
-    }
-    
-    function coinBalance() constant returns (uint _r) {
-        return balances[msg.sender];
-    }
-    
-    function coinBalanceOf(address _addr) constant returns (uint _r) {
-        return balances[_addr];
-    }
-    
-    function approve(address _addr) {
-        approved[msg.sender][_addr] = true;
-        AddressApproval(msg.sender, _addr, true);
-    }
-    
-    function approveOnce(address _addr, uint256 _maxValue) {
-        approved_once[msg.sender][_addr] = _maxValue;
-        AddressApprovalOnce(msg.sender, _addr, _maxValue);
-    }
-    
-    function unapprove(address _addr) {
-        approved[msg.sender][_addr] = false;
-        approved_once[msg.sender][_addr] = 0;
-        AddressApproval(msg.sender, _addr, false);
-        AddressApprovalOnce(msg.sender, _addr, 0);
-    }
-    
-    function isApproved(address _proxy) constant returns (bool _r) {
-        if(approved[msg.sender][_proxy] == true || approved_once[msg.sender][_proxy] > 0) {
-            return true;
-        }
-    }
-    
-    function isApprovedFor(address _target, address _proxy) constant returns (bool _r) {
-        if(approved[_target][_proxy] == true || approved_once[_target][_proxy] > 0) {
-            return true;
-        }
-    }
-    
-    mapping (address => uint) public balances;
-    mapping (address => mapping (address => bool)) public approved;
-    mapping (address => mapping (address => uint256)) public approved_once;
-}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 5
templates/personal_token/app/css/bootstrap.min.css


+ 0 - 4
templates/personal_token/app/css/index.css

@@ -1,4 +0,0 @@
-.container { 
-}
-
-

BIN
templates/personal_token/app/images/example_vinay.jpg


+ 0 - 25
templates/personal_token/app/index.html

@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width, initial-scale=1">
-    <title>Contract Reactor (for Ethereum)</title>
-    <link href="./app.css" rel='stylesheet' type='text/css'>
-    <script src="./app.js"></script>
-
-</head>
-
-<body>
-<div class="container">
-    <div id="top">
-    </div>
-    
-    <div id="contracts">
-    </div>
-
-</div>
-
-</body>
-
-</html>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 7
templates/personal_token/app/js/bootstrap.min.js


+ 0 - 15
templates/personal_token/app/js/header.jsx

@@ -1,15 +0,0 @@
-var Header = React.createClass({
-    getInitialState: function() {
-        return {
-            blockNumber: "", //todo, later for potentially adding contract creation as well.
-        }
-    },
-    render: function() {
-        return (
-        <div>
-            <h3 className={"text-center"} >{this.props.data.token_name} </h3>
-            <img src={this.props.data.token_image} className={"img-circle center-block"}/>
-        </div>
-        );
-    }
-});

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 4
templates/personal_token/app/js/jquery-2.1.4.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 19602
templates/personal_token/app/js/react-0.13.3.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 1
templates/personal_token/app/js/reactor.js


+ 0 - 47
templates/personal_token/app/js/script.jsx

@@ -1,47 +0,0 @@
-//EXAMPLE
-//helper function to get URL parameters.
-var urlParams;
-(window.onpopstate = function () {
-    var match,
-        pl     = /\+/g,  // Regex for replacing addition symbol with a space
-        search = /([^&=]+)=?([^&]*)/g,
-        decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
-        query  = window.location.search.substring(1);
-
-    urlParams = {};
-    while (match = search.exec(query))
-       urlParams[decode(match[1])] = decode(match[2]);
-})();
-/*------------------*/
-
-var config;
-if("config" in urlParams) {
-    config = urlParams['config'];
-} else {
-    var config = './reactor_config.json'; //default
-}
-
-$.ajax({
-    url: config,
-    dataType: 'json',
-    cache: false,
-    error: function(data) {
-        console.log(data);
-    },
-    success: function(data) {
-        //map through multiple contracts (this includes multiple ones in 1 file + different files).
-        console.log(data);
-        var reactor_config = parseConfig(data);
-
-        //fetch template specific config information
-        $.ajax({
-              url: "personal_token_config.json",
-                dataType: 'json',
-                cache: false,
-        })
-        .done(function(data) {
-            React.render(<Header data={data} />, document.getElementById('top'));
-            React.render(<ContainerHelper templates={reactor_config.templates} compiled={reactor_config.total_compiled} addresses={reactor_config.addresses} options={reactor_config.options}/>, document.getElementById('contracts'));
-        });
-    }
-});

+ 0 - 4
templates/personal_token/app/personal_token_config.json

@@ -1,4 +0,0 @@
-{
-    "token_name": "Vinay's Hexatokens",
-    "token_image": "images/example_vinay.jpg"
-} 

+ 0 - 34
templates/personal_token/app/reactor_config.json

@@ -1,34 +0,0 @@
-{
-    "contracts": { 
-        "Standard_Token": {
-            "address": "0xbc72cf3079e08295364510917f92a10d0d54f9d2",
-            "path": "contracts/Standard_Token.sol",
-            "template_overlay": false,
-            "deploy_overlay": false,
-            "template": {
-                "coinBalanceOf": {
-                    "button": "Check Balance",
-                    "inputs": {
-                        "_addr": {
-                            "label": "Address",
-                            "default_value": "eg 0xbc72cf3079e08295364510917f92a10d0d54f9d2"
-                        }
-                    }
-                },
-                "sendCoin": {
-                    "button": "Send Token",
-                    "inputs": {
-                        "_to": {
-                            "label": "Insert Address",
-                            "default_value": "eg 0xbc72cf3079e08295364510917f92a10d0d54f9d2"
-                        },
-                        "_value": {
-                            "label": "Amount to send",
-                            "default_value": "eg 12"
-                        }
-                    }
-                }
-            }
-        }
-    }
-} 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 12
templates/personal_token/build/app.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 24933
templates/personal_token/build/app.js


+ 0 - 102
templates/personal_token/build/contracts/Standard_Token.sol

@@ -1,102 +0,0 @@
-/*Most, basic default, standardised Token contract.
-Allows the creation of a token with a finite issued amount to the creator.
-This can't be changed.
-
-Based on standardised APIs & slightly extended. https://github.com/ethereum/wiki/wiki/Standardized_Contract_APIs
-adds AddressApproval & AddressApprovalOnce events
-approve & approveOnce works on premise that approved always takes precedence.
-adds unapprove to basic coin interface.*/
-
-contract Coin {
-    function sendCoin(uint _value, address _to) returns (bool _success) {}
-    function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {}
-    function coinBalance() constant returns (uint _r) {}
-    function coinBalanceOf(address _addr) constant returns (uint _r) {}
-    function approve(address _addr) {}
-    function approveOnce(address _addr, uint256 _maxValue) {}
-    function unapprove(address _addr) {}
-    function isApproved(address _proxy) constant returns (bool _r) {}
-    function isApprovedFor(address _target, address _proxy) constant returns (bool _r) {}
-}
-
-contract Standard_Token is Coin {
-    
-    function Standard_Token(uint _initialAmount) {
-        balances[msg.sender] = _initialAmount;
-    }
-    
-    event CoinTransfer(address indexed from, address indexed to, uint256 value);
-    event AddressApproval(address indexed from, address indexed to, bool result);
-    event AddressApprovalOnce(address indexed from, address indexed to, uint256 value);
-    
-    function sendCoin(uint _value, address _to) returns (bool _success) {
-        if (balances[msg.sender] >= _value) {
-            balances[msg.sender] -= _value;
-            balances[_to] += _value;
-            CoinTransfer(msg.sender, _to, _value);
-            return true;
-        } else { return false; }
-    }
-    
-    function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {
-        if (balances[_from] >= _value) {
-            bool transfer = false;
-            if(approved[_from][msg.sender]) { 
-                transfer = true; 
-            } else {
-                if(_value < approved_once[_from][msg.sender]) { 
-                    transfer = true; 
-                    approved_once[_from][msg.sender] = 0; //reset
-                }
-            }
-            
-            if(transfer == true) {
-                balances[_from] -= _value;
-                balances[_to] += _value;
-                CoinTransfer(_from, _to, _value);
-                return true;
-            } else { return false; }
-        }
-    }
-    
-    function coinBalance() constant returns (uint _r) {
-        return balances[msg.sender];
-    }
-    
-    function coinBalanceOf(address _addr) constant returns (uint _r) {
-        return balances[_addr];
-    }
-    
-    function approve(address _addr) {
-        approved[msg.sender][_addr] = true;
-        AddressApproval(msg.sender, _addr, true);
-    }
-    
-    function approveOnce(address _addr, uint256 _maxValue) {
-        approved_once[msg.sender][_addr] = _maxValue;
-        AddressApprovalOnce(msg.sender, _addr, _maxValue);
-    }
-    
-    function unapprove(address _addr) {
-        approved[msg.sender][_addr] = false;
-        approved_once[msg.sender][_addr] = 0;
-        AddressApproval(msg.sender, _addr, false);
-        AddressApprovalOnce(msg.sender, _addr, 0);
-    }
-    
-    function isApproved(address _proxy) constant returns (bool _r) {
-        if(approved[msg.sender][_proxy] == true || approved_once[msg.sender][_proxy] > 0) {
-            return true;
-        }
-    }
-    
-    function isApprovedFor(address _target, address _proxy) constant returns (bool _r) {
-        if(approved[_target][_proxy] == true || approved_once[_target][_proxy] > 0) {
-            return true;
-        }
-    }
-    
-    mapping (address => uint) public balances;
-    mapping (address => mapping (address => bool)) public approved;
-    mapping (address => mapping (address => uint256)) public approved_once;
-}

BIN
templates/personal_token/build/images/example_vinay.jpg


+ 0 - 27
templates/personal_token/build/index.html

@@ -1,27 +0,0 @@
-
-
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width, initial-scale=1">
-    <title>Contract Reactor (for Ethereum)</title>
-    <link href="./app.css" rel='stylesheet' type='text/css'>
-    <script src="./app.js"></script>
-
-</head>
-
-<body>
-<div class="container">
-    <div id="top">
-    </div>
-    
-    <div id="contracts">
-    </div>
-
-</div>
-
-</body>
-
-</html>

+ 0 - 6
templates/personal_token/build/personal_token_config.json

@@ -1,6 +0,0 @@
-
-
-{
-    "token_name": "Vinay's Hexatokens",
-    "token_image": "images/example_vinay.jpg"
-} 

+ 0 - 36
templates/personal_token/build/reactor_config.json

@@ -1,36 +0,0 @@
-
-
-{
-    "contracts": { 
-        "Standard_Token": {
-            "address": "0xbc72cf3079e08295364510917f92a10d0d54f9d2",
-            "path": "contracts/Standard_Token.sol",
-            "template_overlay": false,
-            "deploy_overlay": false,
-            "template": {
-                "coinBalanceOf": {
-                    "button": "Check Balance",
-                    "inputs": {
-                        "_addr": {
-                            "label": "Address",
-                            "default_value": "eg 0xbc72cf3079e08295364510917f92a10d0d54f9d2"
-                        }
-                    }
-                },
-                "sendCoin": {
-                    "button": "Send Token",
-                    "inputs": {
-                        "_to": {
-                            "label": "Insert Address",
-                            "default_value": "eg 0xbc72cf3079e08295364510917f92a10d0d54f9d2"
-                        },
-                        "_value": {
-                            "label": "Amount to send",
-                            "default_value": "eg 12"
-                        }
-                    }
-                }
-            }
-        }
-    }
-} 

+ 0 - 29
templates/personal_token/config/app.json

@@ -1,29 +0,0 @@
-{
-    "build": {
-        "index.html": "index.html",
-        "app.js": [
-            "js/jquery-2.1.4.min.js",
-            "js/bootstrap.min.js",
-            "js/react-0.13.3.js",
-            "js/reactor.js",
-            "js/header.jsx",
-            "js/script.jsx"
-        ],
-        "app.css": [
-            "css/bootstrap.min.css",
-            "css/index.css"
-        ],
-        "reactor_config.json": "reactor_config.json",
-        "personal_token_config.json": "personal_token_config.json",
-        "images/": "images/",
-        "contracts/": "contracts/"
-    },
-    "deploy": [
-        "Standard_Token"
-    ],
-    "rpc": {
-        "host": "localhost",
-        "port": 8080
-    }
-}
-

+ 0 - 1
templates/personal_token/config/development/config.json

@@ -1 +0,0 @@
-{}