├── .gitignore ├── .mix ├── LICENSE ├── README.md ├── app ├── index.html ├── javascripts │ └── app.js └── stylesheets │ └── app.css ├── contracts ├── Migrations.sol ├── NameReg.sol ├── Pluton.sol ├── PlutonDistribution.sol ├── PlutusDex.sol ├── PlutusUser.sol ├── Trader.sol └── owned.sol ├── environments ├── development │ └── config.js ├── production │ └── config.js ├── staging │ └── config.js └── test │ ├── config.js │ └── contracts │ ├── HumanStandardToken.sol.js │ ├── HumanStandardTokenFactory.sol.js │ ├── NameReg.sol.js │ ├── Plutons.sol.js │ ├── PlutusDex.sol.js │ ├── PlutusUser.sol.js │ ├── SampleRecipient.sol.js │ ├── StandardToken.sol.js │ ├── Standard_Token.sol.js │ ├── Token.sol.js │ ├── TokenTester.sol.js │ ├── Trader.sol.js │ └── owned.sol.js ├── migrations ├── 1_initial_migration.js └── 2_deploy_contracts.js ├── test ├── humanStandardToken.js ├── humanStandardTokenFactory.js └── tokenTester.js └── truffle.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | 48 | # Translations 49 | *.mo 50 | *.pot 51 | 52 | # Django stuff: 53 | *.log 54 | 55 | # Sphinx documentation 56 | docs/_build/ 57 | 58 | # PyBuilder 59 | target/ 60 | 61 | # Mix IDE 62 | package 63 | 64 | # Ethereum/Truffle 65 | environments/development/**/*.sol.js 66 | -------------------------------------------------------------------------------- /.mix: -------------------------------------------------------------------------------- 1 | { 2 | "applicationUrlEth": "", 3 | "applicationUrlHttp": "", 4 | "deployBlockNumber": "", 5 | "deploymentAddresses": {}, 6 | "deploymentDir": "", 7 | "files": [], 8 | "lastPackageDate": "", 9 | "registerContentHashBlockNumber": -1, 10 | "registerContentHashTrHash": "", 11 | "registerUrlBlockNumber": -1, 12 | "registerUrlTrHash": "", 13 | "startUrl": "", 14 | "title": "Plutus", 15 | "states": [ 16 | { 17 | "accounts": [ 18 | { 19 | "address": "38f388fadf4a6a35c61c3f88194ec5ae162c8944", 20 | "balance": { 21 | "unit": 12, 22 | "value": "1000000" 23 | }, 24 | "name": "user1", 25 | "secret": "cb73d9408c4720e230387d956eb0f829d8a4dd2c1055f96257167e14e7169074" 26 | }, 27 | { 28 | "address": "06400992be45bc64a52b5c55d3df84596d6cb4a1", 29 | "balance": { 30 | "unit": 12, 31 | "value": "1000000" 32 | }, 33 | "name": "user2", 34 | "secret": "db95780d2f30ca8211eec37cc110cc58a2d4f9308dea00ede6717a585efa2eb7" 35 | }, 36 | { 37 | "address": "fa4b795b491cc1975e89f3c78972c3e2e827c882", 38 | "balance": { 39 | "unit": 12, 40 | "value": "1000000" 41 | }, 42 | "name": "user3", 43 | "secret": "090f51d202f847d2468fc87fb06f92c469b8a1927b4aecea796b6831f1331382" 44 | }, 45 | { 46 | "address": "b0dcdc575ef06dc30aaea069d8043c9d463c931c", 47 | "balance": { 48 | "unit": 12, 49 | "value": "1000000" 50 | }, 51 | "name": "user4", 52 | "secret": "e9bf58b523b4c94255cad51b3f7efdc85a0c970bf42f1d191c126bb6f49bfb9d" 53 | } 54 | ], 55 | "blocks": [ 56 | { 57 | "hash": "", 58 | "number": 1, 59 | "status": "pending", 60 | "transactions": [ 61 | { 62 | "contractId": "Sample", 63 | "functionId": "Sample", 64 | "gas": { 65 | "value": "250000" 66 | }, 67 | "gasAuto": true, 68 | "gasPrice": { 69 | "unit": 18, 70 | "value": "100000" 71 | }, 72 | "isContractCreation": true, 73 | "isFunctionCall": true, 74 | "label": "Sample.Sample()", 75 | "parameters": { 76 | "v": 12 77 | }, 78 | "saveStatus": true, 79 | "sender": "cb73d9408c4720e230387d956eb0f829d8a4dd2c1055f96257167e14e7169074", 80 | "value": { 81 | "unit": 18, 82 | "value": "0" 83 | } 84 | } 85 | ] 86 | } 87 | ], 88 | "contracts": [], 89 | "miner": { 90 | "address": "38f388fadf4a6a35c61c3f88194ec5ae162c8944", 91 | "balance": { 92 | "objectName": "", 93 | "value": "1000000", 94 | "unit": 12 95 | }, 96 | "name": "user1", 97 | "secret": "cb73d9408c4720e230387d956eb0f829d8a4dd2c1055f96257167e14e7169074" 98 | }, 99 | "title": "Default_1", 100 | "transactions": [ 101 | { 102 | "contractId": "Sample", 103 | "functionId": "Sample", 104 | "gas": { 105 | "value": "250000" 106 | }, 107 | "gasAuto": true, 108 | "gasPrice": { 109 | "unit": 18, 110 | "value": "100000" 111 | }, 112 | "isContractCreation": true, 113 | "isFunctionCall": true, 114 | "label": "Sample.Sample()", 115 | "parameters": { 116 | "v": 12 117 | }, 118 | "saveStatus": true, 119 | "sender": "cb73d9408c4720e230387d956eb0f829d8a4dd2c1055f96257167e14e7169074", 120 | "value": { 121 | "unit": 18, 122 | "value": "0" 123 | } 124 | } 125 | ] 126 | } 127 | ], 128 | "defaultStateIndex": 0 129 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Plutus 2 | This repository will contain the source code that constitutes each component of Plutus Decentralized Exchange Network utilizing Ethereum. 3 | For more information see (https://plutus.it/) and the Plutus white paper (https://plutus.it/assets/Plutus.it-White-Paper-v1.0.pdf). 4 | ## Plutons 5 | Tokens implemented on the Ethereum blockchain. Used to reward users for making purchases on the Plutus Mobile App. 6 | Uses the (draft) Token standard (https://github.com/ethereum/EIPs/issues/20) and is based on the example: https://github.com/ethereum/dapp-bin/blob/master/standardized_contract_apis/currency.sol 7 | The Pluton contract will be created by the Plutus board, and have 20,000,000 tokens initially. The first initial 850,000 Plutons will be distributed after the crowdsale, as explained at https://getplutons.plutus.it/. 8 | The remaining tokens will be distributed by the rebate contract, which in turn is controlled by the PlutusDEX. 9 | 10 | ## PlutusDEX 11 | The main source code of the Plutus Decentralized Exchange Network (PlutusDEX - https://dex.plutus.it) written in Solidity (https://solidity.readthedocs.org/en/latest/). 12 | Stores data associated with trades and regulates the trade of fiat currency for Bitcoin or Pluton. Matches Plutus Mobile App users to traders with the best price. 13 | ## Issuer 14 | Regulates user rebate rewards and issues Plutons to users accordingly. 15 | ## Plutus User 16 | Stores all data associated with a single user. Allows the user to send Plutons and to interact with traders via PlutusDEX. 17 | ### Trader 18 | Registers a trader with Plutus so they can begin using PlutusDEX. 19 | 20 | 21 | 22 | # Development 23 | 24 | ## Installation 25 | * Install truffle. See http://truffle.readthedocs.org/en/latest/getting_started/client/ 26 | * Install ethereum testrpc https://github.com/ethereumjs/testrpc 27 | * Install bitcoin testnet https://github.com/freewil/bitcoin-testnet-box. Using docker: 28 | ** https://github.com/freewil/bitcoin-testnet-box#using-with-docker 29 | ** remark: http://testnetwallet.com/wallet looks nice, but haven't used it yet 30 | 31 | ## Doing Development 32 | * Run ethereum testnet by executing `testrpc` 33 | * Run bitcoin testnet executing `docker run -t -i freewil/bitcoin-testnet-box` 34 | * Run `truffle compile` to compile contracts in contracts dir 35 | 36 | ## Deployment 37 | * To deploy on test: 38 | ** Run `geth --rpc --testnet --unlock 0` 39 | ** `truffle deploy -e test` 40 | * To deploy on production: 41 | ** Run `geth --rpc --unlock 0` 42 | Where you can replace the 0 with your preferred account 43 | ** `truffle deploy -e production` 44 | In both cases, add the generated contract files as well, and note the addresses. 45 | -------------------------------------------------------------------------------- /app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | MetaCoin - Default Truffle App 5 | 6 | 7 | 8 | 9 | 10 |

MetaCoin

11 |

Example Truffle Dapp

12 |

You have META

13 | 14 |
15 |

Send

16 |
17 |
18 |

19 |

20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/javascripts/app.js: -------------------------------------------------------------------------------- 1 | var accounts; 2 | var account; 3 | var balance; 4 | 5 | function setStatus(message) { 6 | var status = document.getElementById("status"); 7 | status.innerHTML = message; 8 | }; 9 | 10 | function refreshBalance() { 11 | var meta = MetaCoin.deployed(); 12 | 13 | meta.getBalance.call(account, {from: account}).then(function(value) { 14 | var balance_element = document.getElementById("balance"); 15 | balance_element.innerHTML = value.valueOf(); 16 | }).catch(function(e) { 17 | console.log(e); 18 | setStatus("Error getting balance; see log."); 19 | }); 20 | }; 21 | 22 | function sendCoin() { 23 | var meta = MetaCoin.deployed(); 24 | 25 | var amount = parseInt(document.getElementById("amount").value); 26 | var receiver = document.getElementById("receiver").value; 27 | 28 | setStatus("Initiating transaction... (please wait)"); 29 | 30 | meta.sendCoin(receiver, amount, {from: account}).then(function() { 31 | setStatus("Transaction complete!"); 32 | refreshBalance(); 33 | }).catch(function(e) { 34 | console.log(e); 35 | setStatus("Error sending coin; see log."); 36 | }); 37 | }; 38 | 39 | window.onload = function() { 40 | web3.eth.getAccounts(function(err, accs) { 41 | if (err != null) { 42 | alert("There was an error fetching your accounts."); 43 | return; 44 | } 45 | 46 | if (accs.length == 0) { 47 | alert("Couldn't get any accounts! Make sure your Ethereum client is configured correctly."); 48 | return; 49 | } 50 | 51 | accounts = accs; 52 | account = accounts[0]; 53 | 54 | refreshBalance(); 55 | }); 56 | } 57 | -------------------------------------------------------------------------------- /app/stylesheets/app.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin-left: 25%; 3 | margin-right: 25%; 4 | margin-top: 10%; 5 | font-family: "Open Sans", sans-serif; 6 | } 7 | 8 | label { 9 | display: inline-block; 10 | width: 100px; 11 | } 12 | 13 | input { 14 | width: 500px; 15 | padding: 5px; 16 | font-size: 16px; 17 | } 18 | 19 | button { 20 | font-size: 16px; 21 | padding: 5px; 22 | } 23 | 24 | h1, h2 { 25 | display: inline-block; 26 | vertical-align: middle; 27 | margin-top: 0px; 28 | margin-bottom: 10px; 29 | } 30 | 31 | h2 { 32 | color: #AAA; 33 | font-size: 32px; 34 | } 35 | 36 | h3 { 37 | font-weight: normal; 38 | color: #AAA; 39 | font-size: 24px; 40 | } 41 | 42 | .black { 43 | color: black; 44 | } 45 | 46 | #balance { 47 | color: black; 48 | } 49 | -------------------------------------------------------------------------------- /contracts/Migrations.sol: -------------------------------------------------------------------------------- 1 | contract Migrations { 2 | address public owner; 3 | uint public last_completed_migration; 4 | 5 | modifier restricted() { 6 | if (msg.sender == owner) _ 7 | } 8 | 9 | function Migrations() { 10 | owner = msg.sender; 11 | } 12 | 13 | function setCompleted(uint completed) restricted { 14 | last_completed_migration = completed; 15 | } 16 | 17 | function upgrade(address new_address) restricted { 18 | Migrations upgraded = Migrations(new_address); 19 | upgraded.setCompleted(last_completed_migration); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /contracts/NameReg.sol: -------------------------------------------------------------------------------- 1 | contract NameReg { 2 | struct RegistryEntry { 3 | address owner; 4 | address addr; 5 | bytes32 content; 6 | address sub; 7 | } 8 | 9 | mapping ( string => RegistryEntry ) records; 10 | 11 | event Changed(string name, bytes32 indexed __hash_name); 12 | 13 | function reserve(string _name) returns (bool _success) { 14 | if (records[_name].owner == 0) { 15 | records[_name].owner = msg.sender; 16 | Changed(_name, sha3(_name)); 17 | _success = true; 18 | } 19 | else _success = false; 20 | } 21 | 22 | function owner(string _name) returns (address _r) { 23 | _r = records[_name].owner; 24 | } 25 | 26 | function transfer(string _name, address _newOwner) { 27 | if (records[_name].owner == msg.sender) { 28 | records[_name].owner = _newOwner; 29 | Changed(_name, sha3(_name)); 30 | } 31 | } 32 | 33 | function setAddr(string _name, address _addr) { 34 | if (records[_name].owner == msg.sender) { 35 | records[_name].addr = _addr; 36 | Changed(_name, sha3(_name)); 37 | } 38 | } 39 | 40 | function addr(string _name) returns (address _r) { 41 | _r = records[_name].addr; 42 | } 43 | 44 | function setContent(string _name, bytes32 _content) { 45 | if (records[_name].owner == msg.sender) { 46 | records[_name].content = _content; 47 | Changed(_name, sha3(_name)); 48 | } 49 | } 50 | 51 | function content(string _name) returns (bytes32 _r) { 52 | _r = records[_name].content; 53 | } 54 | 55 | function setSubRegistrar(string _name, address _subRegistrar) { 56 | if (records[_name].owner == msg.sender) { 57 | records[_name].sub = _subRegistrar; 58 | Changed(_name, sha3(_name)); 59 | } 60 | } 61 | 62 | function subRegistrar(string _name) returns (address _r) { 63 | _r = records[_name].sub; 64 | } 65 | 66 | function disown(string _name) { 67 | if (records[_name].owner == msg.sender) { 68 | records[_name].owner = 0; 69 | Changed(_name, sha3(_name)); 70 | } 71 | } 72 | } 73 | 74 | -------------------------------------------------------------------------------- /contracts/Pluton.sol: -------------------------------------------------------------------------------- 1 | /* 2 | The Pluton Contract implements the standard token functionality (https://github.com/ethereum/EIPs/issues/20) as well as the following OPTIONAL extras intended for use by humans. 3 | 4 | Pluton contract extends HumanStandardToken, https://github.com/consensys/tokens 5 | 6 | .*/ 7 | contract Token { 8 | 9 | /// @return total amount of tokens 10 | function totalSupply() constant returns (uint256 supply) {} 11 | 12 | /// @param _owner The address from which the balance will be retrieved 13 | /// @return The balance 14 | function balanceOf(address _owner) constant returns (uint256 balance) {} 15 | 16 | /// @notice send `_value` token to `_to` from `msg.sender` 17 | /// @param _to The address of the recipient 18 | /// @param _value The amount of token to be transferred 19 | /// @return Whether the transfer was successful or not 20 | function transfer(address _to, uint256 _value) returns (bool success) {} 21 | 22 | /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` 23 | /// @param _from The address of the sender 24 | /// @param _to The address of the recipient 25 | /// @param _value The amount of token to be transferred 26 | /// @return Whether the transfer was successful or not 27 | function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {} 28 | 29 | /// @notice `msg.sender` approves `_addr` to spend `_value` tokens 30 | /// @param _spender The address of the account able to transfer the tokens 31 | /// @param _value The amount of wei to be approved for transfer 32 | /// @return Whether the approval was successful or not 33 | function approve(address _spender, uint256 _value) returns (bool success) {} 34 | 35 | /// @param _owner The address of the account owning tokens 36 | /// @param _spender The address of the account able to transfer the tokens 37 | /// @return Amount of remaining tokens allowed to spent 38 | function allowance(address _owner, address _spender) constant returns (uint256 remaining) {} 39 | 40 | event Transfer(address indexed _from, address indexed _to, uint256 _value); 41 | event Approval(address indexed _owner, address indexed _spender, uint256 _value); 42 | } 43 | 44 | 45 | contract StandardToken is Token { 46 | 47 | function transfer(address _to, uint256 _value) returns (bool success) { 48 | //Default assumes totalSupply can't be over max (2^256 - 1). 49 | //If your token leaves out totalSupply and can issue more tokens as time goes on, you need to check if it doesn't wrap. 50 | //Replace the if with this one instead. 51 | //if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) { 52 | if (balances[msg.sender] >= _value && _value > 0) { 53 | balances[msg.sender] -= _value; 54 | balances[_to] += _value; 55 | Transfer(msg.sender, _to, _value); 56 | return true; 57 | } else { return false; } 58 | } 59 | 60 | function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { 61 | //same as above. Replace this line with the following if you want to protect against wrapping uints. 62 | //if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) { 63 | if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) { 64 | balances[_to] += _value; 65 | balances[_from] -= _value; 66 | allowed[_from][msg.sender] -= _value; 67 | Transfer(_from, _to, _value); 68 | return true; 69 | } else { return false; } 70 | } 71 | 72 | function balanceOf(address _owner) constant returns (uint256 balance) { 73 | return balances[_owner]; 74 | } 75 | 76 | function approve(address _spender, uint256 _value) returns (bool success) { 77 | allowed[msg.sender][_spender] = _value; 78 | Approval(msg.sender, _spender, _value); 79 | return true; 80 | } 81 | 82 | function allowance(address _owner, address _spender) constant returns (uint256 remaining) { 83 | return allowed[_owner][_spender]; 84 | } 85 | 86 | mapping (address => uint256) balances; 87 | mapping (address => mapping (address => uint256)) allowed; 88 | uint256 public totalSupply; 89 | } 90 | 91 | 92 | contract HumanStandardToken is StandardToken { 93 | 94 | function () { 95 | //if ether is sent to this address, send it back. 96 | throw; 97 | } 98 | 99 | /* Public variables of the token */ 100 | 101 | /* 102 | NOTE: 103 | The following variables are OPTIONAL vanities. One does not have to include them. 104 | They allow one to customise the token contract & in no way influences the core functionality. 105 | Some wallets/interfaces might not even bother to look at this information. 106 | */ 107 | string public name; //fancy name: eg Simon Bucks 108 | uint8 public decimals; //How many decimals to show. ie. There could 1000 base units with 3 decimals. Meaning 0.980 SBX = 980 base units. It's like comparing 1 wei to 1 ether. 109 | string public symbol; //An identifier: eg SBX 110 | string public version = 'H0.1'; //human 0.1 standard. Just an arbitrary versioning scheme. 111 | 112 | function HumanStandardToken( 113 | uint256 _initialAmount, 114 | string _tokenName, 115 | uint8 _decimalUnits, 116 | string _tokenSymbol 117 | ) { 118 | balances[msg.sender] = _initialAmount; // Give the creator all initial tokens 119 | totalSupply = _initialAmount; // Update total supply 120 | name = _tokenName; // Set the name for display purposes 121 | decimals = _decimalUnits; // Amount of decimals for display purposes 122 | symbol = _tokenSymbol; // Set the symbol for display purposes 123 | } 124 | 125 | /* Approves and then calls the receiving contract */ 126 | function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { 127 | allowed[msg.sender][_spender] = _value; 128 | Approval(msg.sender, _spender, _value); 129 | 130 | //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. 131 | //receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData) 132 | //it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead. 133 | if(!_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) { throw; } 134 | return true; 135 | } 136 | } 137 | 138 | // Creates 20,000,000.000000000000000000 Pluton (PLU) Tokens 139 | contract Pluton is HumanStandardToken(20000000000000000000000000, "Pluton", 18, "PLU") {} 140 | -------------------------------------------------------------------------------- /contracts/PlutonDistribution.sol: -------------------------------------------------------------------------------- 1 | import "mortal.sol"; 2 | 3 | contract PlutonDistribution is mortal { 4 | 5 | mapping ( address => uint256 ) distributedAmount; 6 | //EtherTransaction[1] etherTransactions = [EtherTransaction(hex"5487b714c0659731efaf9021e2ac161153e01b0259221f378a4202551af52695",1184207878095000)]; 7 | //BitcoinTransaction[695] bitcoinTransactions; 8 | 9 | function PlutonDistribution() { 10 | } 11 | 12 | function distributeIfNeeded(address _toAddress, uint256 _totalAmount) onlyowner returns (bool _success) { 13 | uint256 _amountDistributed = distributedAmount[_toAddress]; 14 | uint256 _amountLeft = _totalAmount - _amountDistributed; 15 | if (_amountLeft>0) { 16 | distributedAmount[_toAddress]=distributedAmount[_toAddress]+_amountLeft; 17 | } 18 | _success = true; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /contracts/PlutusDex.sol: -------------------------------------------------------------------------------- 1 | contract PlutusDex { 2 | enum CurrencySymbol { EUR, GBP, USD } 3 | //Addresses of ethereum accounts that are approved to verify bitcoin transactions, 4 | //, verify/perform deposit of fiat to escrow account and verify/perform deposit 5 | //of fiat to vdc 6 | mapping(address => bool) approvedTraders; 7 | 8 | modifier aprrovedTrader() { 9 | if(approvedTraders[msg.sender]) _ 10 | } 11 | 12 | struct FiatDeposit { 13 | address trader; 14 | uint fiatDeposited; 15 | CurrencySymbol fiatSymbol; 16 | uint btcAsked; 17 | //From https://forum.ethereum.org/discussion/3139/store-bitcoin-address-in-smart-contract 18 | bytes20 btcAddress; //Public address to deposit the bitcoin too 19 | } 20 | 21 | mapping(address => FiatDeposit) fiatDeposits; 22 | 23 | uint btcTradingVolume; 24 | 25 | event FiatDeposited(address trader, uint fiatDeposited, CurrencySymbol fiatSymbol, uint btcAsked, bytes20 btcAddress); 26 | 27 | event VdcLoaded(bytes32 userVdcIban, uint fiatAmount, CurrencySymbol fiatSymbol, uint btcTradingVolume); 28 | 29 | function PlutusDex() { 30 | approvedTraders[msg.sender] = true; 31 | btcTradingVolume = 0; 32 | } 33 | 34 | function depositFiat(address trader, uint fiatDeposited, CurrencySymbol fiatSymbol, uint btcAsked, bytes20 btcAddress) aprrovedTrader { 35 | fiatDeposits[trader] = FiatDeposit(trader, fiatDeposited, fiatSymbol, btcAsked, btcAddress); 36 | //Emit event, to notify all plutus-users 37 | FiatDeposited(trader, fiatDeposited, fiatSymbol, btcAsked, btcAddress); 38 | } 39 | 40 | /** 41 | * Offer amount of BTC to specified trader. 42 | * Handling of cheapest price should all be done offchain. 43 | */ 44 | function offerBtc(address trader, uint btcOffered, bytes32 userVdcIban) aprrovedTrader returns(bool result) { 45 | //TODO some Null check 46 | FiatDeposit deposited = fiatDeposits[trader]; 47 | uint btcTraded; 48 | if (deposited.btcAsked < btcOffered) { 49 | btcTraded = btcOffered; 50 | } else { 51 | btcTraded = deposited.btcAsked; 52 | } 53 | uint fiatReceived = deposited.fiatDeposited * (btcTraded / btcOffered); 54 | deposited.btcAsked -= btcTraded; 55 | deposited.fiatDeposited -= fiatReceived; 56 | btcTradingVolume += btcTraded; 57 | //Notify user 58 | VdcLoaded(userVdcIban, fiatReceived, deposited.fiatSymbol, btcTradingVolume); 59 | return true; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /contracts/PlutusUser.sol: -------------------------------------------------------------------------------- 1 | import "owned.sol"; 2 | import "Pluton.sol"; 3 | import "PlutusDex.sol"; 4 | import "NameReg.sol"; 5 | 6 | /** 7 | Contract of user of Plutus. 8 | 9 | Work in progress. Do no use yet 10 | */ 11 | contract PlutusUser is owned { 12 | //TODO conform to std contract if any 13 | NameReg namereg; 14 | //Virtual debit card ID 15 | bytes32 userVdcIban; 16 | address plutusApprovedCentralAddr; 17 | function PlutusUser(bytes32 _userVdcIban, NameReg _namereg) { 18 | owner = msg.sender; 19 | userVdcIban = _userVdcIban; 20 | namereg = _namereg; 21 | } 22 | 23 | function sendTokenFromDex(address _to, uint _amount) onlyowner returns(bool result) { 24 | Pluton pluton = Pluton(namereg.addr('Plutons')); 25 | return pluton.transferFrom(owner, _to, _amount); 26 | } 27 | 28 | function offerBtcFromApp(address _trader, uint _btcOffered) onlyowner returns(bool result) { 29 | PlutusDex plutusDex = PlutusDex(namereg.addr('PlutusDex')); 30 | return plutusDex.offerBtc( _trader, _btcOffered, userVdcIban); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /contracts/Trader.sol: -------------------------------------------------------------------------------- 1 | import "owned.sol"; 2 | 3 | contract Trader is owned { 4 | event TraderRegistered; 5 | } 6 | -------------------------------------------------------------------------------- /contracts/owned.sol: -------------------------------------------------------------------------------- 1 | contract owned{ 2 | function owned() { 3 | owner = msg.sender; 4 | } 5 | 6 | modifier onlyowner() { 7 | if(msg.sender==owner) _ 8 | } 9 | 10 | address owner; 11 | } -------------------------------------------------------------------------------- /environments/development/config.js: -------------------------------------------------------------------------------- 1 | module.exports = {} 2 | -------------------------------------------------------------------------------- /environments/production/config.js: -------------------------------------------------------------------------------- 1 | module.exports = {} 2 | -------------------------------------------------------------------------------- /environments/staging/config.js: -------------------------------------------------------------------------------- 1 | module.exports = {} 2 | -------------------------------------------------------------------------------- /environments/test/config.js: -------------------------------------------------------------------------------- 1 | module.exports = {} 2 | -------------------------------------------------------------------------------- /environments/test/contracts/HumanStandardToken.sol.js: -------------------------------------------------------------------------------- 1 | // Factory "morphs" into a Pudding class. 2 | // The reasoning is that calling load in each context 3 | // is cumbersome. 4 | 5 | (function() { 6 | 7 | var contract_data = { 8 | abi: [{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"},{"name":"_extraData","type":"bytes"}],"name":"approveAndCall","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"type":"function"},{"inputs":[{"name":"_initialAmount","type":"uint256"},{"name":"_tokenName","type":"string"},{"name":"_decimalUnits","type":"uint8"},{"name":"_tokenSymbol","type":"string"}],"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Approval","type":"event"}], 9 | binary: "60a060405260066060527f506c75746f6e00000000000000000000000000000000000000000000000000006080526003805460008290527f506c75746f6e000000000000000000000000000000000000000000000000000c82556100a390600080516020610ab2833981519152602060026001841615610100026000190190931692909204601f01919091048101905b80821115610135576000815560010161008f565b50506004805460ff1990811660081790915560408051808201909152600381527f504c5500000000000000000000000000000000000000000000000000000000006020918201908152600580546000829052915190931660061783556101399160026001831615610100026000190190921691909104601f0104600080516020610a928339815191529081019061008f565b5090565b505060408051808201909152600481527f48302e31000000000000000000000000000000000000000000000000000000006020918201908152600680546000829052915160ff19166008178155916101cc9160026001821615610100026000190190911604601f01047ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f9081019061008f565b5050604051610ad2380380610ad283398101604052808051906020019091908051820191906020018051906020019091908051820191906020015050600160a060020a033316600090815260208181526040822086905560028681556003805487519482905290936001821615610100026000190190911691909104601f908101839004600080516020610ab28339815191529081019390919088019083901061028957805160ff19168380011785555b506102b992915061008f565b8280016001018555821561027d579182015b8281111561027d57825182600050559160200191906001019061029b565b50506004805460ff1916831790556005805482516000839052602060026001841615610100026000190190931692909204601f908101839004600080516020610a928339815191529081019390919086019083901061032b57805160ff19168380011785555b5061035b92915061008f565b8280016001018555821561031f579182015b8281111561031f57825182600050559160200191906001019061033d565b505050505050610722806103706000396000f3006060604052361561008d5760e060020a600035046306fdde038114610095578063095ea7b3146100f257806318160ddd1461015d57806323b872dd14610166578063313ce567146102c757806354fd4d50146102d357806370a082311461033057806395d89b411461035e578063a9059cbb146103bb578063cae9ca511461044d578063dd62ed3e14610639575b610000610002565b61066d60038054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b61034c60043560243533600160a060020a03908116600081815260016020908152604080832094871680845294825282208590556060858152919392917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a35060015b92915050565b61034c60025481565b61034c600435602435604435600160a060020a0383166000908152602081905260408120548290108015906101b9575060016020908152604080832033600160a060020a03168452909152812054829010155b80156101c55750600082115b1561071d57816000600050600085600160a060020a03168152602001908152602001600020600082828250540192505081905550816000600050600086600160a060020a03168152602001908152602001600020600082828250540392505081905550816001600050600086600160a060020a03168152602001908152602001600020600050600033600160a060020a0316815260200190815260200160002060008282825054039250508190555082600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3506001610632565b6106db60045460ff1681565b61066d60068054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b600160a060020a03600435166000908152602081905260409020545b60408051918252519081900360200190f35b61066d60058054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b61034c60043560243533600160a060020a03166000908152602081905260408120548290108015906103ed5750600082115b1561071857604080822080548490039055600160a060020a03808516808452918320805485019055606084815233909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602090a3506001610157565b60806020604435600481810135601f81018490049093028401604052606083815261034c94823594602480359560649493910191908190838280828437509496505050505050506000826001600050600033600160a060020a03168152602001908152602001600020600050600086600160a060020a031681526020019081526020016000206000508190555083600160a060020a031660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815260200150602e019050604051809103902060e060020a8091040260e060020a9004338530866040518560e060020a0281526004018085600160a060020a0316815260200184815260200183600160a060020a031681526020018280519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156105d45780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000876161da5a03f1505060408051868152905133600160a060020a031692507f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259181900360200190a35060015b9392505050565b61034c600435602435600160a060020a03808316600090815260016020908152604080832093851683529290522054610157565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156106cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6060908152602090f35b820191906000526020600020905b8154815290600101906020018083116106f357829003601f168201915b505050505081565b610157565b61063256036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b", 10 | unlinked_binary: "60a060405260066060527f506c75746f6e00000000000000000000000000000000000000000000000000006080526003805460008290527f506c75746f6e000000000000000000000000000000000000000000000000000c82556100a390600080516020610ab2833981519152602060026001841615610100026000190190931692909204601f01919091048101905b80821115610135576000815560010161008f565b50506004805460ff1990811660081790915560408051808201909152600381527f504c5500000000000000000000000000000000000000000000000000000000006020918201908152600580546000829052915190931660061783556101399160026001831615610100026000190190921691909104601f0104600080516020610a928339815191529081019061008f565b5090565b505060408051808201909152600481527f48302e31000000000000000000000000000000000000000000000000000000006020918201908152600680546000829052915160ff19166008178155916101cc9160026001821615610100026000190190911604601f01047ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f9081019061008f565b5050604051610ad2380380610ad283398101604052808051906020019091908051820191906020018051906020019091908051820191906020015050600160a060020a033316600090815260208181526040822086905560028681556003805487519482905290936001821615610100026000190190911691909104601f908101839004600080516020610ab28339815191529081019390919088019083901061028957805160ff19168380011785555b506102b992915061008f565b8280016001018555821561027d579182015b8281111561027d57825182600050559160200191906001019061029b565b50506004805460ff1916831790556005805482516000839052602060026001841615610100026000190190931692909204601f908101839004600080516020610a928339815191529081019390919086019083901061032b57805160ff19168380011785555b5061035b92915061008f565b8280016001018555821561031f579182015b8281111561031f57825182600050559160200191906001019061033d565b505050505050610722806103706000396000f3006060604052361561008d5760e060020a600035046306fdde038114610095578063095ea7b3146100f257806318160ddd1461015d57806323b872dd14610166578063313ce567146102c757806354fd4d50146102d357806370a082311461033057806395d89b411461035e578063a9059cbb146103bb578063cae9ca511461044d578063dd62ed3e14610639575b610000610002565b61066d60038054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b61034c60043560243533600160a060020a03908116600081815260016020908152604080832094871680845294825282208590556060858152919392917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a35060015b92915050565b61034c60025481565b61034c600435602435604435600160a060020a0383166000908152602081905260408120548290108015906101b9575060016020908152604080832033600160a060020a03168452909152812054829010155b80156101c55750600082115b1561071d57816000600050600085600160a060020a03168152602001908152602001600020600082828250540192505081905550816000600050600086600160a060020a03168152602001908152602001600020600082828250540392505081905550816001600050600086600160a060020a03168152602001908152602001600020600050600033600160a060020a0316815260200190815260200160002060008282825054039250508190555082600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3506001610632565b6106db60045460ff1681565b61066d60068054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b600160a060020a03600435166000908152602081905260409020545b60408051918252519081900360200190f35b61066d60058054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b61034c60043560243533600160a060020a03166000908152602081905260408120548290108015906103ed5750600082115b1561071857604080822080548490039055600160a060020a03808516808452918320805485019055606084815233909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602090a3506001610157565b60806020604435600481810135601f81018490049093028401604052606083815261034c94823594602480359560649493910191908190838280828437509496505050505050506000826001600050600033600160a060020a03168152602001908152602001600020600050600086600160a060020a031681526020019081526020016000206000508190555083600160a060020a031660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815260200150602e019050604051809103902060e060020a8091040260e060020a9004338530866040518560e060020a0281526004018085600160a060020a0316815260200184815260200183600160a060020a031681526020018280519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156105d45780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000876161da5a03f1505060408051868152905133600160a060020a031692507f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259181900360200190a35060015b9392505050565b61034c600435602435600160a060020a03808316600090815260016020908152604080832093851683529290522054610157565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156106cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6060908152602090f35b820191906000526020600020905b8154815290600101906020018083116106f357829003601f168201915b505050505081565b610157565b61063256036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b", 11 | address: "", 12 | generated_with: "2.0.9", 13 | contract_name: "HumanStandardToken" 14 | }; 15 | 16 | function Contract() { 17 | if (Contract.Pudding == null) { 18 | throw new Error("HumanStandardToken error: Please call load() first before creating new instance of this contract."); 19 | } 20 | 21 | Contract.Pudding.apply(this, arguments); 22 | }; 23 | 24 | Contract.load = function(Pudding) { 25 | Contract.Pudding = Pudding; 26 | 27 | Pudding.whisk(contract_data, Contract); 28 | 29 | // Return itself for backwards compatibility. 30 | return Contract; 31 | } 32 | 33 | Contract.new = function() { 34 | if (Contract.Pudding == null) { 35 | throw new Error("HumanStandardToken error: Please call load() first before calling new()."); 36 | } 37 | 38 | return Contract.Pudding.new.apply(Contract, arguments); 39 | }; 40 | 41 | Contract.at = function() { 42 | if (Contract.Pudding == null) { 43 | throw new Error("HumanStandardToken error: Please call load() first before calling at()."); 44 | } 45 | 46 | return Contract.Pudding.at.apply(Contract, arguments); 47 | }; 48 | 49 | Contract.deployed = function() { 50 | if (Contract.Pudding == null) { 51 | throw new Error("HumanStandardToken error: Please call load() first before calling deployed()."); 52 | } 53 | 54 | return Contract.Pudding.deployed.apply(Contract, arguments); 55 | }; 56 | 57 | if (typeof module != "undefined" && typeof module.exports != "undefined") { 58 | module.exports = Contract; 59 | } else { 60 | // There will only be one version of Pudding in the browser, 61 | // and we can use that. 62 | window.HumanStandardToken = Contract; 63 | } 64 | 65 | })(); 66 | -------------------------------------------------------------------------------- /environments/test/contracts/HumanStandardTokenFactory.sol.js: -------------------------------------------------------------------------------- 1 | // Factory "morphs" into a Pudding class. 2 | // The reasoning is that calling load in each context 3 | // is cumbersome. 4 | 5 | (function() { 6 | 7 | var contract_data = { 8 | abi: [{"constant":false,"inputs":[{"name":"_initialAmount","type":"uint256"},{"name":"_name","type":"string"},{"name":"_decimals","type":"uint8"},{"name":"_symbol","type":"string"}],"name":"createHumanStandardToken","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"created","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[],"name":"humanStandardByteCode","outputs":[{"name":"","type":"bytes"}],"type":"function"},{"constant":false,"inputs":[],"name":"createdByMe","outputs":[{"name":"","type":"address[]"}],"type":"function"},{"constant":false,"inputs":[{"name":"_tokenContract","type":"address"}],"name":"verifyHumanStandardToken","outputs":[{"name":"","type":"bool"}],"type":"function"},{"inputs":[],"type":"constructor"}], 9 | binary: "600c60609081527f56657269667920546f6b656e000000000000000000000000000000000000000060805260e06040819052600360a08181527f565458000000000000000000000000000000000000000000000000000000000060c05260009361021793612710939192908690819081908790879087908790610ad2806113cc833990810185815261012082018490526080610100830181815286516101608501528651929390926101408201926101809092019190808381848e6004600f6020601f860104028e01f150905090810190601f1680156100f35780820380516001836020036101000a031916815260200191505b508381038252848181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f16801561014c5780820380516001836020036101000a031916815260200191505b509650505050505050604051809103906000f0915081905080600160a060020a031663a9059cbb3389604051837c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a03168152602001828152602001925050506020604051808303816000876161da5a03f1156100025750505033600160a060020a0316600090815260208190526040902080546001810180835582818380158290116102f0578183600052602060002091820191016102f09190610297565b90506102458160408051602081810183526000918290529151833b8082529092909182918401853c50919050565b60016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106102ab57805160ff19168380011785555b506102db9291505b808211156102ec5760008155600101610297565b8280016001018555821561028f579182015b8281111561028f5782518260005055916020019190600101906102bd565b5050506110b3806103196000396000f35b5090565b5050506000928352506020909120018054600160a060020a03191683179055509594505050505056606060405260e060020a600035046308216c0f81146100475780635f8dead31461026f578063acad94ae146102ab578063dc3f65d314610307578063fc94dd1814610380575b005b602060248035600481810135601f8101859004909402608090810160405260608581526103b4958335959394604494929392019181908382808284375050604080516020606435808b0135601f8101839004830284018301909452838352979998359897608497509195506024919091019350909150819084018382808284375094965050505050505060006000600086868686604051610ad2806105e183390180858152602001806020018460ff168152602001806020018381038352868181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156101585780820380516001836020036101000a031916815260200191505b508381038252848181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156101b15780820380516001836020036101000a031916815260200191505b509650505050505050604051809103906000f0915081905080600160a060020a031663a9059cbb33896040518360e060020a0281526004018083600160a060020a03168152602001828152602001925050506020604051808303816000876161da5a03f11561000257505050600160a060020a0333168352602083905260408320805460018101808355828183801582901161059d5781836000526020600020918201910161059d91905b808211156105dd578a815560010161025c565b6103b460043560243560006020819052828152604090208054829081101561000257506000908152602090200154600160a060020a0316905081565b6103d0600180546020600282841615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156104c55780601f1061049a576101008083540402835291602001916104c5565b6000606081815233600160a060020a031682526020828152604092839020805491820260a0908101909452608082815261043e949092908282801561037657602002820191906000526020600020905b8154600160a060020a0316815260019190910190602001808311610357575b5050505050905090565b610488600435608060405260006060818152816104d98460a060408190526080849052813b808252808560c0853c50919050565b60408051600160a060020a039092168252519081900360200190f35b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156104305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60405180806020018281038252838181518152602001915080519060200190602002808383829060006004602084601f0104600f02600301f1509050019250505060405180910390f35b60408051918252519081900360200190f35b820191906000526020600020905b8154815290600101906020018083116104a857829003601f168201915b505050505081565b600192505b5050919050565b915060016000508054600181600116156101000203166002900490508251141515610507576104d2565b6001015b81518110156104cd57600160005081815460018160011615610100020316600290048110156100025790908154600116156105695790845260208082047fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60191065b9054901a60f860020a02828281518110156100025790602001015160f860020a900460f860020a02141515610503576104d2565b50505091909060005260206000209001600050805473ffffffffffffffffffffffffffffffffffffffff1916841790555090915081905050949350505050565b50905660a060405260066060527f506c75746f6e00000000000000000000000000000000000000000000000000006080526003805460008290527f506c75746f6e000000000000000000000000000000000000000000000000000c82556100a390600080516020610ab2833981519152602060026001841615610100026000190190931692909204601f01919091048101905b80821115610135576000815560010161008f565b50506004805460ff1990811660081790915560408051808201909152600381527f504c5500000000000000000000000000000000000000000000000000000000006020918201908152600580546000829052915190931660061783556101399160026001831615610100026000190190921691909104601f0104600080516020610a928339815191529081019061008f565b5090565b505060408051808201909152600481527f48302e31000000000000000000000000000000000000000000000000000000006020918201908152600680546000829052915160ff19166008178155916101cc9160026001821615610100026000190190911604601f01047ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f9081019061008f565b5050604051610ad2380380610ad283398101604052808051906020019091908051820191906020018051906020019091908051820191906020015050600160a060020a033316600090815260208181526040822086905560028681556003805487519482905290936001821615610100026000190190911691909104601f908101839004600080516020610ab28339815191529081019390919088019083901061028957805160ff19168380011785555b506102b992915061008f565b8280016001018555821561027d579182015b8281111561027d57825182600050559160200191906001019061029b565b50506004805460ff1916831790556005805482516000839052602060026001841615610100026000190190931692909204601f908101839004600080516020610a928339815191529081019390919086019083901061032b57805160ff19168380011785555b5061035b92915061008f565b8280016001018555821561031f579182015b8281111561031f57825182600050559160200191906001019061033d565b505050505050610722806103706000396000f3006060604052361561008d5760e060020a600035046306fdde038114610095578063095ea7b3146100f257806318160ddd1461015d57806323b872dd14610166578063313ce567146102c757806354fd4d50146102d357806370a082311461033057806395d89b411461035e578063a9059cbb146103bb578063cae9ca511461044d578063dd62ed3e14610639575b610000610002565b61066d60038054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b61034c60043560243533600160a060020a03908116600081815260016020908152604080832094871680845294825282208590556060858152919392917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a35060015b92915050565b61034c60025481565b61034c600435602435604435600160a060020a0383166000908152602081905260408120548290108015906101b9575060016020908152604080832033600160a060020a03168452909152812054829010155b80156101c55750600082115b1561071d57816000600050600085600160a060020a03168152602001908152602001600020600082828250540192505081905550816000600050600086600160a060020a03168152602001908152602001600020600082828250540392505081905550816001600050600086600160a060020a03168152602001908152602001600020600050600033600160a060020a0316815260200190815260200160002060008282825054039250508190555082600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3506001610632565b6106db60045460ff1681565b61066d60068054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b600160a060020a03600435166000908152602081905260409020545b60408051918252519081900360200190f35b61066d60058054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b61034c60043560243533600160a060020a03166000908152602081905260408120548290108015906103ed5750600082115b1561071857604080822080548490039055600160a060020a03808516808452918320805485019055606084815233909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602090a3506001610157565b60806020604435600481810135601f81018490049093028401604052606083815261034c94823594602480359560649493910191908190838280828437509496505050505050506000826001600050600033600160a060020a03168152602001908152602001600020600050600086600160a060020a031681526020019081526020016000206000508190555083600160a060020a031660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815260200150602e019050604051809103902060e060020a8091040260e060020a9004338530866040518560e060020a0281526004018085600160a060020a0316815260200184815260200183600160a060020a031681526020018280519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156105d45780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000876161da5a03f1505060408051868152905133600160a060020a031692507f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259181900360200190a35060015b9392505050565b61034c600435602435600160a060020a03808316600090815260016020908152604080832093851683529290522054610157565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156106cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6060908152602090f35b820191906000526020600020905b8154815290600101906020018083116106f357829003601f168201915b505050505081565b610157565b61063256036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b60a060405260066060527f506c75746f6e00000000000000000000000000000000000000000000000000006080526003805460008290527f506c75746f6e000000000000000000000000000000000000000000000000000c82556100a390600080516020610ab2833981519152602060026001841615610100026000190190931692909204601f01919091048101905b80821115610135576000815560010161008f565b50506004805460ff1990811660081790915560408051808201909152600381527f504c5500000000000000000000000000000000000000000000000000000000006020918201908152600580546000829052915190931660061783556101399160026001831615610100026000190190921691909104601f0104600080516020610a928339815191529081019061008f565b5090565b505060408051808201909152600481527f48302e31000000000000000000000000000000000000000000000000000000006020918201908152600680546000829052915160ff19166008178155916101cc9160026001821615610100026000190190911604601f01047ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f9081019061008f565b5050604051610ad2380380610ad283398101604052808051906020019091908051820191906020018051906020019091908051820191906020015050600160a060020a033316600090815260208181526040822086905560028681556003805487519482905290936001821615610100026000190190911691909104601f908101839004600080516020610ab28339815191529081019390919088019083901061028957805160ff19168380011785555b506102b992915061008f565b8280016001018555821561027d579182015b8281111561027d57825182600050559160200191906001019061029b565b50506004805460ff1916831790556005805482516000839052602060026001841615610100026000190190931692909204601f908101839004600080516020610a928339815191529081019390919086019083901061032b57805160ff19168380011785555b5061035b92915061008f565b8280016001018555821561031f579182015b8281111561031f57825182600050559160200191906001019061033d565b505050505050610722806103706000396000f3006060604052361561008d5760e060020a600035046306fdde038114610095578063095ea7b3146100f257806318160ddd1461015d57806323b872dd14610166578063313ce567146102c757806354fd4d50146102d357806370a082311461033057806395d89b411461035e578063a9059cbb146103bb578063cae9ca511461044d578063dd62ed3e14610639575b610000610002565b61066d60038054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b61034c60043560243533600160a060020a03908116600081815260016020908152604080832094871680845294825282208590556060858152919392917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a35060015b92915050565b61034c60025481565b61034c600435602435604435600160a060020a0383166000908152602081905260408120548290108015906101b9575060016020908152604080832033600160a060020a03168452909152812054829010155b80156101c55750600082115b1561071d57816000600050600085600160a060020a03168152602001908152602001600020600082828250540192505081905550816000600050600086600160a060020a03168152602001908152602001600020600082828250540392505081905550816001600050600086600160a060020a03168152602001908152602001600020600050600033600160a060020a0316815260200190815260200160002060008282825054039250508190555082600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3506001610632565b6106db60045460ff1681565b61066d60068054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b600160a060020a03600435166000908152602081905260409020545b60408051918252519081900360200190f35b61066d60058054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b61034c60043560243533600160a060020a03166000908152602081905260408120548290108015906103ed5750600082115b1561071857604080822080548490039055600160a060020a03808516808452918320805485019055606084815233909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602090a3506001610157565b60806020604435600481810135601f81018490049093028401604052606083815261034c94823594602480359560649493910191908190838280828437509496505050505050506000826001600050600033600160a060020a03168152602001908152602001600020600050600086600160a060020a031681526020019081526020016000206000508190555083600160a060020a031660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815260200150602e019050604051809103902060e060020a8091040260e060020a9004338530866040518560e060020a0281526004018085600160a060020a0316815260200184815260200183600160a060020a031681526020018280519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156105d45780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000876161da5a03f1505060408051868152905133600160a060020a031692507f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259181900360200190a35060015b9392505050565b61034c600435602435600160a060020a03808316600090815260016020908152604080832093851683529290522054610157565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156106cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6060908152602090f35b820191906000526020600020905b8154815290600101906020018083116106f357829003601f168201915b505050505081565b610157565b61063256036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b", 10 | unlinked_binary: "600c60609081527f56657269667920546f6b656e000000000000000000000000000000000000000060805260e06040819052600360a08181527f565458000000000000000000000000000000000000000000000000000000000060c05260009361021793612710939192908690819081908790879087908790610ad2806113cc833990810185815261012082018490526080610100830181815286516101608501528651929390926101408201926101809092019190808381848e6004600f6020601f860104028e01f150905090810190601f1680156100f35780820380516001836020036101000a031916815260200191505b508381038252848181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f16801561014c5780820380516001836020036101000a031916815260200191505b509650505050505050604051809103906000f0915081905080600160a060020a031663a9059cbb3389604051837c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a03168152602001828152602001925050506020604051808303816000876161da5a03f1156100025750505033600160a060020a0316600090815260208190526040902080546001810180835582818380158290116102f0578183600052602060002091820191016102f09190610297565b90506102458160408051602081810183526000918290529151833b8082529092909182918401853c50919050565b60016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106102ab57805160ff19168380011785555b506102db9291505b808211156102ec5760008155600101610297565b8280016001018555821561028f579182015b8281111561028f5782518260005055916020019190600101906102bd565b5050506110b3806103196000396000f35b5090565b5050506000928352506020909120018054600160a060020a03191683179055509594505050505056606060405260e060020a600035046308216c0f81146100475780635f8dead31461026f578063acad94ae146102ab578063dc3f65d314610307578063fc94dd1814610380575b005b602060248035600481810135601f8101859004909402608090810160405260608581526103b4958335959394604494929392019181908382808284375050604080516020606435808b0135601f8101839004830284018301909452838352979998359897608497509195506024919091019350909150819084018382808284375094965050505050505060006000600086868686604051610ad2806105e183390180858152602001806020018460ff168152602001806020018381038352868181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156101585780820380516001836020036101000a031916815260200191505b508381038252848181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156101b15780820380516001836020036101000a031916815260200191505b509650505050505050604051809103906000f0915081905080600160a060020a031663a9059cbb33896040518360e060020a0281526004018083600160a060020a03168152602001828152602001925050506020604051808303816000876161da5a03f11561000257505050600160a060020a0333168352602083905260408320805460018101808355828183801582901161059d5781836000526020600020918201910161059d91905b808211156105dd578a815560010161025c565b6103b460043560243560006020819052828152604090208054829081101561000257506000908152602090200154600160a060020a0316905081565b6103d0600180546020600282841615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156104c55780601f1061049a576101008083540402835291602001916104c5565b6000606081815233600160a060020a031682526020828152604092839020805491820260a0908101909452608082815261043e949092908282801561037657602002820191906000526020600020905b8154600160a060020a0316815260019190910190602001808311610357575b5050505050905090565b610488600435608060405260006060818152816104d98460a060408190526080849052813b808252808560c0853c50919050565b60408051600160a060020a039092168252519081900360200190f35b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156104305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60405180806020018281038252838181518152602001915080519060200190602002808383829060006004602084601f0104600f02600301f1509050019250505060405180910390f35b60408051918252519081900360200190f35b820191906000526020600020905b8154815290600101906020018083116104a857829003601f168201915b505050505081565b600192505b5050919050565b915060016000508054600181600116156101000203166002900490508251141515610507576104d2565b6001015b81518110156104cd57600160005081815460018160011615610100020316600290048110156100025790908154600116156105695790845260208082047fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60191065b9054901a60f860020a02828281518110156100025790602001015160f860020a900460f860020a02141515610503576104d2565b50505091909060005260206000209001600050805473ffffffffffffffffffffffffffffffffffffffff1916841790555090915081905050949350505050565b50905660a060405260066060527f506c75746f6e00000000000000000000000000000000000000000000000000006080526003805460008290527f506c75746f6e000000000000000000000000000000000000000000000000000c82556100a390600080516020610ab2833981519152602060026001841615610100026000190190931692909204601f01919091048101905b80821115610135576000815560010161008f565b50506004805460ff1990811660081790915560408051808201909152600381527f504c5500000000000000000000000000000000000000000000000000000000006020918201908152600580546000829052915190931660061783556101399160026001831615610100026000190190921691909104601f0104600080516020610a928339815191529081019061008f565b5090565b505060408051808201909152600481527f48302e31000000000000000000000000000000000000000000000000000000006020918201908152600680546000829052915160ff19166008178155916101cc9160026001821615610100026000190190911604601f01047ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f9081019061008f565b5050604051610ad2380380610ad283398101604052808051906020019091908051820191906020018051906020019091908051820191906020015050600160a060020a033316600090815260208181526040822086905560028681556003805487519482905290936001821615610100026000190190911691909104601f908101839004600080516020610ab28339815191529081019390919088019083901061028957805160ff19168380011785555b506102b992915061008f565b8280016001018555821561027d579182015b8281111561027d57825182600050559160200191906001019061029b565b50506004805460ff1916831790556005805482516000839052602060026001841615610100026000190190931692909204601f908101839004600080516020610a928339815191529081019390919086019083901061032b57805160ff19168380011785555b5061035b92915061008f565b8280016001018555821561031f579182015b8281111561031f57825182600050559160200191906001019061033d565b505050505050610722806103706000396000f3006060604052361561008d5760e060020a600035046306fdde038114610095578063095ea7b3146100f257806318160ddd1461015d57806323b872dd14610166578063313ce567146102c757806354fd4d50146102d357806370a082311461033057806395d89b411461035e578063a9059cbb146103bb578063cae9ca511461044d578063dd62ed3e14610639575b610000610002565b61066d60038054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b61034c60043560243533600160a060020a03908116600081815260016020908152604080832094871680845294825282208590556060858152919392917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a35060015b92915050565b61034c60025481565b61034c600435602435604435600160a060020a0383166000908152602081905260408120548290108015906101b9575060016020908152604080832033600160a060020a03168452909152812054829010155b80156101c55750600082115b1561071d57816000600050600085600160a060020a03168152602001908152602001600020600082828250540192505081905550816000600050600086600160a060020a03168152602001908152602001600020600082828250540392505081905550816001600050600086600160a060020a03168152602001908152602001600020600050600033600160a060020a0316815260200190815260200160002060008282825054039250508190555082600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3506001610632565b6106db60045460ff1681565b61066d60068054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b600160a060020a03600435166000908152602081905260409020545b60408051918252519081900360200190f35b61066d60058054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b61034c60043560243533600160a060020a03166000908152602081905260408120548290108015906103ed5750600082115b1561071857604080822080548490039055600160a060020a03808516808452918320805485019055606084815233909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602090a3506001610157565b60806020604435600481810135601f81018490049093028401604052606083815261034c94823594602480359560649493910191908190838280828437509496505050505050506000826001600050600033600160a060020a03168152602001908152602001600020600050600086600160a060020a031681526020019081526020016000206000508190555083600160a060020a031660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815260200150602e019050604051809103902060e060020a8091040260e060020a9004338530866040518560e060020a0281526004018085600160a060020a0316815260200184815260200183600160a060020a031681526020018280519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156105d45780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000876161da5a03f1505060408051868152905133600160a060020a031692507f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259181900360200190a35060015b9392505050565b61034c600435602435600160a060020a03808316600090815260016020908152604080832093851683529290522054610157565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156106cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6060908152602090f35b820191906000526020600020905b8154815290600101906020018083116106f357829003601f168201915b505050505081565b610157565b61063256036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b60a060405260066060527f506c75746f6e00000000000000000000000000000000000000000000000000006080526003805460008290527f506c75746f6e000000000000000000000000000000000000000000000000000c82556100a390600080516020610ab2833981519152602060026001841615610100026000190190931692909204601f01919091048101905b80821115610135576000815560010161008f565b50506004805460ff1990811660081790915560408051808201909152600381527f504c5500000000000000000000000000000000000000000000000000000000006020918201908152600580546000829052915190931660061783556101399160026001831615610100026000190190921691909104601f0104600080516020610a928339815191529081019061008f565b5090565b505060408051808201909152600481527f48302e31000000000000000000000000000000000000000000000000000000006020918201908152600680546000829052915160ff19166008178155916101cc9160026001821615610100026000190190911604601f01047ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f9081019061008f565b5050604051610ad2380380610ad283398101604052808051906020019091908051820191906020018051906020019091908051820191906020015050600160a060020a033316600090815260208181526040822086905560028681556003805487519482905290936001821615610100026000190190911691909104601f908101839004600080516020610ab28339815191529081019390919088019083901061028957805160ff19168380011785555b506102b992915061008f565b8280016001018555821561027d579182015b8281111561027d57825182600050559160200191906001019061029b565b50506004805460ff1916831790556005805482516000839052602060026001841615610100026000190190931692909204601f908101839004600080516020610a928339815191529081019390919086019083901061032b57805160ff19168380011785555b5061035b92915061008f565b8280016001018555821561031f579182015b8281111561031f57825182600050559160200191906001019061033d565b505050505050610722806103706000396000f3006060604052361561008d5760e060020a600035046306fdde038114610095578063095ea7b3146100f257806318160ddd1461015d57806323b872dd14610166578063313ce567146102c757806354fd4d50146102d357806370a082311461033057806395d89b411461035e578063a9059cbb146103bb578063cae9ca511461044d578063dd62ed3e14610639575b610000610002565b61066d60038054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b61034c60043560243533600160a060020a03908116600081815260016020908152604080832094871680845294825282208590556060858152919392917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a35060015b92915050565b61034c60025481565b61034c600435602435604435600160a060020a0383166000908152602081905260408120548290108015906101b9575060016020908152604080832033600160a060020a03168452909152812054829010155b80156101c55750600082115b1561071d57816000600050600085600160a060020a03168152602001908152602001600020600082828250540192505081905550816000600050600086600160a060020a03168152602001908152602001600020600082828250540392505081905550816001600050600086600160a060020a03168152602001908152602001600020600050600033600160a060020a0316815260200190815260200160002060008282825054039250508190555082600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3506001610632565b6106db60045460ff1681565b61066d60068054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b600160a060020a03600435166000908152602081905260409020545b60408051918252519081900360200190f35b61066d60058054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b61034c60043560243533600160a060020a03166000908152602081905260408120548290108015906103ed5750600082115b1561071857604080822080548490039055600160a060020a03808516808452918320805485019055606084815233909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602090a3506001610157565b60806020604435600481810135601f81018490049093028401604052606083815261034c94823594602480359560649493910191908190838280828437509496505050505050506000826001600050600033600160a060020a03168152602001908152602001600020600050600086600160a060020a031681526020019081526020016000206000508190555083600160a060020a031660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815260200150602e019050604051809103902060e060020a8091040260e060020a9004338530866040518560e060020a0281526004018085600160a060020a0316815260200184815260200183600160a060020a031681526020018280519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156105d45780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000876161da5a03f1505060408051868152905133600160a060020a031692507f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259181900360200190a35060015b9392505050565b61034c600435602435600160a060020a03808316600090815260016020908152604080832093851683529290522054610157565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156106cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6060908152602090f35b820191906000526020600020905b8154815290600101906020018083116106f357829003601f168201915b505050505081565b610157565b61063256036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b", 11 | address: "", 12 | generated_with: "2.0.9", 13 | contract_name: "HumanStandardTokenFactory" 14 | }; 15 | 16 | function Contract() { 17 | if (Contract.Pudding == null) { 18 | throw new Error("HumanStandardTokenFactory error: Please call load() first before creating new instance of this contract."); 19 | } 20 | 21 | Contract.Pudding.apply(this, arguments); 22 | }; 23 | 24 | Contract.load = function(Pudding) { 25 | Contract.Pudding = Pudding; 26 | 27 | Pudding.whisk(contract_data, Contract); 28 | 29 | // Return itself for backwards compatibility. 30 | return Contract; 31 | } 32 | 33 | Contract.new = function() { 34 | if (Contract.Pudding == null) { 35 | throw new Error("HumanStandardTokenFactory error: Please call load() first before calling new()."); 36 | } 37 | 38 | return Contract.Pudding.new.apply(Contract, arguments); 39 | }; 40 | 41 | Contract.at = function() { 42 | if (Contract.Pudding == null) { 43 | throw new Error("HumanStandardTokenFactory error: Please call load() first before calling at()."); 44 | } 45 | 46 | return Contract.Pudding.at.apply(Contract, arguments); 47 | }; 48 | 49 | Contract.deployed = function() { 50 | if (Contract.Pudding == null) { 51 | throw new Error("HumanStandardTokenFactory error: Please call load() first before calling deployed()."); 52 | } 53 | 54 | return Contract.Pudding.deployed.apply(Contract, arguments); 55 | }; 56 | 57 | if (typeof module != "undefined" && typeof module.exports != "undefined") { 58 | module.exports = Contract; 59 | } else { 60 | // There will only be one version of Pudding in the browser, 61 | // and we can use that. 62 | window.HumanStandardTokenFactory = Contract; 63 | } 64 | 65 | })(); 66 | -------------------------------------------------------------------------------- /environments/test/contracts/NameReg.sol.js: -------------------------------------------------------------------------------- 1 | // Factory "morphs" into a Pudding class. 2 | // The reasoning is that calling load in each context 3 | // is cumbersome. 4 | 5 | (function() { 6 | 7 | var contract_data = { 8 | abi: [{"constant":false,"inputs":[{"name":"_name","type":"string"}],"name":"disown","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_addr","type":"address"}],"name":"setAddr","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"}],"name":"addr","outputs":[{"name":"_r","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"}],"name":"subRegistrar","outputs":[{"name":"_r","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"}],"name":"reserve","outputs":[{"name":"_success","type":"bool"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_subRegistrar","type":"address"}],"name":"setSubRegistrar","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"}],"name":"content","outputs":[{"name":"_r","type":"bytes32"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"}],"name":"owner","outputs":[{"name":"_r","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_newOwner","type":"address"}],"name":"transfer","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_content","type":"bytes32"}],"name":"setContent","outputs":[],"type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"name","type":"string"},{"indexed":true,"name":"__hash_name","type":"bytes32"}],"name":"Changed","type":"event"}], 9 | binary: "6060604052610da8806100126000396000f3606060405236156100825760e060020a600035046301bd40518114610084578063213b9eb814610243578063511b1df9146104035780637f445c24146104a2578063ae999ece14610541578063ccf4f413146106fd578063dd54a62f146108bd578063df55b41a1461094c578063fbf58b3e146109eb578063fd6f543014610bad575b005b60206004803580820135601f810184900490930260809081016040526060848152610082946024939192918401918190838280828437509496505050505050506040518151600160a060020a033316916000918491908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060000160009054906101000a9004600160a060020a0316600160a060020a0316141561024057604051815160009182918491908190608090808381848960046020601f850104600f02600301f150905001915050908152602001604051809103902060005060000160006101000a815481600160a060020a030219169083021790555080604051808280519060200190808383829060006004602084601f0104600f02600301f1509050019150506040518091039020600080516020610d888339815191528260405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156102325780820380516001836020036101000a031916815260200191505b509250505060405180910390a25b50565b60206004803580820135601f8101849004909302608090810160405260608481526100829460249391929184019181908382808284375094965050933593505050506040518251600160a060020a033316916000918591908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060000160009054906101000a9004600160a060020a0316600160a060020a03161415610ba957604051825182916000918591908190608090808381848960046020601f850104600f02600301f150905001915050908152602001604051809103902060005060010160006101000a815481600160a060020a030219169083021790555081604051808280519060200190808383829060006004602084601f0104600f02600301f1509050019150506040518091039020600080516020610d888339815191528360405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f168015610b9b5780820380516001836020036101000a03191681526020019150509250505060405180910390a25050565b60206004803580820135601f810184900490930260809081016040526060848152610d5994602493919291840191819083828082843750949650505050505050604051815160009182918491908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060010160009054906101000a9004600160a060020a031690508050919050565b60206004803580820135601f810184900490930260809081016040526060848152610d5994602493919291840191819083828082843750949650505050505050604051815160009182918491908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060030160009054906101000a9004600160a060020a031690508050919050565b60206004803580820135601f810184900490930260809081016040526060848152610d7694602493919291840191819083828082843750949650505050505050604051815160009182918491908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060000160009054906101000a9004600160a060020a0316600160a060020a0316600014156106f8576040518251339183918591908190608090808381848960046020601f850104600f02600301f150905001915050908152602001604051809103902060005060000160006101000a815481600160a060020a030219169083021790555081604051808280519060200190808383829060006004602084601f0104600f02600301f1509050019150506040518091039020600080516020610d888339815191528360405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156106e75780820380516001836020036101000a031916815260200191505b509250505060405180910390a25060015b919050565b60206004803580820135601f8101849004909302608090810160405260608481526100829460249391929184019181908382808284375094965050933593505050506040518251600160a060020a033316916000918591908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060000160009054906101000a9004600160a060020a0316600160a060020a03161415610ba957604051825182916000918591908190608090808381848960046020601f850104600f02600301f150905001915050908152602001604051809103902060005060030160006101000a815481600160a060020a030219169083021790555081604051808280519060200190808383829060006004602084601f0104600f02600301f1509050019150506040518091039020600080516020610d888339815191528360405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f168015610b9b5780820380516001836020036101000a03191681526020019150509250505060405180910390a25050565b60206004803580820135601f810184900490930260809081016040526060848152610d7694602493919291840191819083828082843750949650505050505050604051815160009182918491908190608090808381848960046003600f6020601f8701040201f15090500191505090815260200160405180910390206000506002016000505490508050919050565b60206004803580820135601f810184900490930260809081016040526060848152610d5994602493919291840191819083828082843750949650505050505050604051815160009182918491908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060000160009054906101000a9004600160a060020a031690508050919050565b60206004803580820135601f8101849004909302608090810160405260608481526100829460249391929184019181908382808284375094965050933593505050506040518251600160a060020a033316916000918591908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060000160009054906101000a9004600160a060020a0316600160a060020a03161415610ba957604051825182916000918591908190608090808381848960046020601f850104600f02600301f150905001915050908152602001604051809103902060005060000160006101000a815481600160a060020a030219169083021790555081604051808280519060200190808383829060006004602084601f0104600f02600301f1509050019150506040518091039020600080516020610d888339815191528360405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f168015610b9b5780820380516001836020036101000a031916815260200191505b509250505060405180910390a25b5050565b60206004803580820135601f8101849004909302608090810160405260608481526100829460249391929184019181908382808284375094965050933593505050506040518251600160a060020a033316916000918591908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060000160009054906101000a9004600160a060020a0316600160a060020a03161415610ba957604051825182916000918591908190608090808381848960046020601f850104600f02600301f15090500191505090815260200160405180910390206000506002016000508190555081604051808280519060200190808383829060006004602084601f0104600f02600301f1509050019150506040518091039020600080516020610d888339815191528360405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f168015610b9b5780820380516001836020036101000a03191681526020019150509250505060405180910390a25050565b60408051600160a060020a03929092168252519081900360200190f35b60408051918252519081900360200190f34b4c8cd9c614bb1b37d86665a7f831631a2746887318288557c9004817c5d945", 10 | unlinked_binary: "6060604052610da8806100126000396000f3606060405236156100825760e060020a600035046301bd40518114610084578063213b9eb814610243578063511b1df9146104035780637f445c24146104a2578063ae999ece14610541578063ccf4f413146106fd578063dd54a62f146108bd578063df55b41a1461094c578063fbf58b3e146109eb578063fd6f543014610bad575b005b60206004803580820135601f810184900490930260809081016040526060848152610082946024939192918401918190838280828437509496505050505050506040518151600160a060020a033316916000918491908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060000160009054906101000a9004600160a060020a0316600160a060020a0316141561024057604051815160009182918491908190608090808381848960046020601f850104600f02600301f150905001915050908152602001604051809103902060005060000160006101000a815481600160a060020a030219169083021790555080604051808280519060200190808383829060006004602084601f0104600f02600301f1509050019150506040518091039020600080516020610d888339815191528260405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156102325780820380516001836020036101000a031916815260200191505b509250505060405180910390a25b50565b60206004803580820135601f8101849004909302608090810160405260608481526100829460249391929184019181908382808284375094965050933593505050506040518251600160a060020a033316916000918591908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060000160009054906101000a9004600160a060020a0316600160a060020a03161415610ba957604051825182916000918591908190608090808381848960046020601f850104600f02600301f150905001915050908152602001604051809103902060005060010160006101000a815481600160a060020a030219169083021790555081604051808280519060200190808383829060006004602084601f0104600f02600301f1509050019150506040518091039020600080516020610d888339815191528360405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f168015610b9b5780820380516001836020036101000a03191681526020019150509250505060405180910390a25050565b60206004803580820135601f810184900490930260809081016040526060848152610d5994602493919291840191819083828082843750949650505050505050604051815160009182918491908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060010160009054906101000a9004600160a060020a031690508050919050565b60206004803580820135601f810184900490930260809081016040526060848152610d5994602493919291840191819083828082843750949650505050505050604051815160009182918491908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060030160009054906101000a9004600160a060020a031690508050919050565b60206004803580820135601f810184900490930260809081016040526060848152610d7694602493919291840191819083828082843750949650505050505050604051815160009182918491908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060000160009054906101000a9004600160a060020a0316600160a060020a0316600014156106f8576040518251339183918591908190608090808381848960046020601f850104600f02600301f150905001915050908152602001604051809103902060005060000160006101000a815481600160a060020a030219169083021790555081604051808280519060200190808383829060006004602084601f0104600f02600301f1509050019150506040518091039020600080516020610d888339815191528360405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156106e75780820380516001836020036101000a031916815260200191505b509250505060405180910390a25060015b919050565b60206004803580820135601f8101849004909302608090810160405260608481526100829460249391929184019181908382808284375094965050933593505050506040518251600160a060020a033316916000918591908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060000160009054906101000a9004600160a060020a0316600160a060020a03161415610ba957604051825182916000918591908190608090808381848960046020601f850104600f02600301f150905001915050908152602001604051809103902060005060030160006101000a815481600160a060020a030219169083021790555081604051808280519060200190808383829060006004602084601f0104600f02600301f1509050019150506040518091039020600080516020610d888339815191528360405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f168015610b9b5780820380516001836020036101000a03191681526020019150509250505060405180910390a25050565b60206004803580820135601f810184900490930260809081016040526060848152610d7694602493919291840191819083828082843750949650505050505050604051815160009182918491908190608090808381848960046003600f6020601f8701040201f15090500191505090815260200160405180910390206000506002016000505490508050919050565b60206004803580820135601f810184900490930260809081016040526060848152610d5994602493919291840191819083828082843750949650505050505050604051815160009182918491908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060000160009054906101000a9004600160a060020a031690508050919050565b60206004803580820135601f8101849004909302608090810160405260608481526100829460249391929184019181908382808284375094965050933593505050506040518251600160a060020a033316916000918591908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060000160009054906101000a9004600160a060020a0316600160a060020a03161415610ba957604051825182916000918591908190608090808381848960046020601f850104600f02600301f150905001915050908152602001604051809103902060005060000160006101000a815481600160a060020a030219169083021790555081604051808280519060200190808383829060006004602084601f0104600f02600301f1509050019150506040518091039020600080516020610d888339815191528360405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f168015610b9b5780820380516001836020036101000a031916815260200191505b509250505060405180910390a25b5050565b60206004803580820135601f8101849004909302608090810160405260608481526100829460249391929184019181908382808284375094965050933593505050506040518251600160a060020a033316916000918591908190608090808381848960046003600f6020601f8701040201f150905001915050908152602001604051809103902060005060000160009054906101000a9004600160a060020a0316600160a060020a03161415610ba957604051825182916000918591908190608090808381848960046020601f850104600f02600301f15090500191505090815260200160405180910390206000506002016000508190555081604051808280519060200190808383829060006004602084601f0104600f02600301f1509050019150506040518091039020600080516020610d888339815191528360405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f168015610b9b5780820380516001836020036101000a03191681526020019150509250505060405180910390a25050565b60408051600160a060020a03929092168252519081900360200190f35b60408051918252519081900360200190f34b4c8cd9c614bb1b37d86665a7f831631a2746887318288557c9004817c5d945", 11 | address: "", 12 | generated_with: "2.0.9", 13 | contract_name: "NameReg" 14 | }; 15 | 16 | function Contract() { 17 | if (Contract.Pudding == null) { 18 | throw new Error("NameReg error: Please call load() first before creating new instance of this contract."); 19 | } 20 | 21 | Contract.Pudding.apply(this, arguments); 22 | }; 23 | 24 | Contract.load = function(Pudding) { 25 | Contract.Pudding = Pudding; 26 | 27 | Pudding.whisk(contract_data, Contract); 28 | 29 | // Return itself for backwards compatibility. 30 | return Contract; 31 | } 32 | 33 | Contract.new = function() { 34 | if (Contract.Pudding == null) { 35 | throw new Error("NameReg error: Please call load() first before calling new()."); 36 | } 37 | 38 | return Contract.Pudding.new.apply(Contract, arguments); 39 | }; 40 | 41 | Contract.at = function() { 42 | if (Contract.Pudding == null) { 43 | throw new Error("NameReg error: Please call load() first before calling at()."); 44 | } 45 | 46 | return Contract.Pudding.at.apply(Contract, arguments); 47 | }; 48 | 49 | Contract.deployed = function() { 50 | if (Contract.Pudding == null) { 51 | throw new Error("NameReg error: Please call load() first before calling deployed()."); 52 | } 53 | 54 | return Contract.Pudding.deployed.apply(Contract, arguments); 55 | }; 56 | 57 | if (typeof module != "undefined" && typeof module.exports != "undefined") { 58 | module.exports = Contract; 59 | } else { 60 | // There will only be one version of Pudding in the browser, 61 | // and we can use that. 62 | window.NameReg = Contract; 63 | } 64 | 65 | })(); 66 | -------------------------------------------------------------------------------- /environments/test/contracts/Plutons.sol.js: -------------------------------------------------------------------------------- 1 | // Factory "morphs" into a Pudding class. 2 | // The reasoning is that calling load in each context 3 | // is cumbersome. 4 | 5 | (function() { 6 | 7 | var contract_data = { 8 | abi: [{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"},{"name":"_extraData","type":"bytes"}],"name":"approveAndCall","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Approval","type":"event"}], 9 | binary: "60a060405260066060527f506c75746f6e00000000000000000000000000000000000000000000000000006080526003805460008290527f506c75746f6e000000000000000000000000000000000000000000000000000c82556100a390600080516020610ae9833981519152602060026001841615610100026000190190931692909204601f01919091048101905b80821115610135576000815560010161008f565b50506004805460ff1990811660081790915560408051808201909152600381527f504c5500000000000000000000000000000000000000000000000000000000006020918201908152600580546000829052915190931660061783556101399160026001831615610100026000190190921691909104601f0104600080516020610ac98339815191529081019061008f565b5090565b505060408051808201909152600481527f48302e31000000000000000000000000000000000000000000000000000000006020918201908152600680546000829052915160ff19166008178155916101cc9160026001821615610100026000190190911604601f01047ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f9081019061008f565b5050604080518082018252600681527f506c75746f6e00000000000000000000000000000000000000000000000000006020828101919091528251808401909352600383527f504c550000000000000000000000000000000000000000000000000000000000908301526301312d0091600890600160a060020a033316600090815260208181526040822086905560028681556003805487519482905290936001821615610100026000190190911691909104601f908101839004600080516020610ae9833981519152908101939091908801908390106102c057805160ff19168380011785555b506102f092915061008f565b828001600101855582156102b4579182015b828111156102b45782518260005055916020019190600101906102d2565b50506004805460ff1916831790556005805482516000839052602060026001841615610100026000190190931692909204601f908101839004600080516020610ac98339815191529081019390919086019083901061036257805160ff19168380011785555b5061039292915061008f565b82800160010185558215610356579182015b82811115610356578251826000505591602001919060010190610374565b505050505050610722806103a76000396000f3006060604052361561008d5760e060020a600035046306fdde038114610095578063095ea7b3146100f257806318160ddd1461015d57806323b872dd14610166578063313ce567146102c757806354fd4d50146102d357806370a082311461033057806395d89b411461035e578063a9059cbb146103bb578063cae9ca511461044d578063dd62ed3e14610639575b610000610002565b61066d60038054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b61034c60043560243533600160a060020a03908116600081815260016020908152604080832094871680845294825282208590556060858152919392917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a35060015b92915050565b61034c60025481565b61034c600435602435604435600160a060020a0383166000908152602081905260408120548290108015906101b9575060016020908152604080832033600160a060020a03168452909152812054829010155b80156101c55750600082115b1561071d57816000600050600085600160a060020a03168152602001908152602001600020600082828250540192505081905550816000600050600086600160a060020a03168152602001908152602001600020600082828250540392505081905550816001600050600086600160a060020a03168152602001908152602001600020600050600033600160a060020a0316815260200190815260200160002060008282825054039250508190555082600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3506001610632565b6106db60045460ff1681565b61066d60068054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b600160a060020a03600435166000908152602081905260409020545b60408051918252519081900360200190f35b61066d60058054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b61034c60043560243533600160a060020a03166000908152602081905260408120548290108015906103ed5750600082115b1561071857604080822080548490039055600160a060020a03808516808452918320805485019055606084815233909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602090a3506001610157565b60806020604435600481810135601f81018490049093028401604052606083815261034c94823594602480359560649493910191908190838280828437509496505050505050506000826001600050600033600160a060020a03168152602001908152602001600020600050600086600160a060020a031681526020019081526020016000206000508190555083600160a060020a031660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815260200150602e019050604051809103902060e060020a8091040260e060020a9004338530866040518560e060020a0281526004018085600160a060020a0316815260200184815260200183600160a060020a031681526020018280519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156105d45780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000876161da5a03f1505060408051868152905133600160a060020a031692507f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259181900360200190a35060015b9392505050565b61034c600435602435600160a060020a03808316600090815260016020908152604080832093851683529290522054610157565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156106cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6060908152602090f35b820191906000526020600020905b8154815290600101906020018083116106f357829003601f168201915b505050505081565b610157565b61063256036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b", 10 | unlinked_binary: "60a060405260066060527f506c75746f6e00000000000000000000000000000000000000000000000000006080526003805460008290527f506c75746f6e000000000000000000000000000000000000000000000000000c82556100a390600080516020610ae9833981519152602060026001841615610100026000190190931692909204601f01919091048101905b80821115610135576000815560010161008f565b50506004805460ff1990811660081790915560408051808201909152600381527f504c5500000000000000000000000000000000000000000000000000000000006020918201908152600580546000829052915190931660061783556101399160026001831615610100026000190190921691909104601f0104600080516020610ac98339815191529081019061008f565b5090565b505060408051808201909152600481527f48302e31000000000000000000000000000000000000000000000000000000006020918201908152600680546000829052915160ff19166008178155916101cc9160026001821615610100026000190190911604601f01047ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f9081019061008f565b5050604080518082018252600681527f506c75746f6e00000000000000000000000000000000000000000000000000006020828101919091528251808401909352600383527f504c550000000000000000000000000000000000000000000000000000000000908301526301312d0091600890600160a060020a033316600090815260208181526040822086905560028681556003805487519482905290936001821615610100026000190190911691909104601f908101839004600080516020610ae9833981519152908101939091908801908390106102c057805160ff19168380011785555b506102f092915061008f565b828001600101855582156102b4579182015b828111156102b45782518260005055916020019190600101906102d2565b50506004805460ff1916831790556005805482516000839052602060026001841615610100026000190190931692909204601f908101839004600080516020610ac98339815191529081019390919086019083901061036257805160ff19168380011785555b5061039292915061008f565b82800160010185558215610356579182015b82811115610356578251826000505591602001919060010190610374565b505050505050610722806103a76000396000f3006060604052361561008d5760e060020a600035046306fdde038114610095578063095ea7b3146100f257806318160ddd1461015d57806323b872dd14610166578063313ce567146102c757806354fd4d50146102d357806370a082311461033057806395d89b411461035e578063a9059cbb146103bb578063cae9ca511461044d578063dd62ed3e14610639575b610000610002565b61066d60038054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b61034c60043560243533600160a060020a03908116600081815260016020908152604080832094871680845294825282208590556060858152919392917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a35060015b92915050565b61034c60025481565b61034c600435602435604435600160a060020a0383166000908152602081905260408120548290108015906101b9575060016020908152604080832033600160a060020a03168452909152812054829010155b80156101c55750600082115b1561071d57816000600050600085600160a060020a03168152602001908152602001600020600082828250540192505081905550816000600050600086600160a060020a03168152602001908152602001600020600082828250540392505081905550816001600050600086600160a060020a03168152602001908152602001600020600050600033600160a060020a0316815260200190815260200160002060008282825054039250508190555082600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3506001610632565b6106db60045460ff1681565b61066d60068054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b600160a060020a03600435166000908152602081905260409020545b60408051918252519081900360200190f35b61066d60058054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156107105780601f106106e557610100808354040283529160200191610710565b61034c60043560243533600160a060020a03166000908152602081905260408120548290108015906103ed5750600082115b1561071857604080822080548490039055600160a060020a03808516808452918320805485019055606084815233909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602090a3506001610157565b60806020604435600481810135601f81018490049093028401604052606083815261034c94823594602480359560649493910191908190838280828437509496505050505050506000826001600050600033600160a060020a03168152602001908152602001600020600050600086600160a060020a031681526020019081526020016000206000508190555083600160a060020a031660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815260200150602e019050604051809103902060e060020a8091040260e060020a9004338530866040518560e060020a0281526004018085600160a060020a0316815260200184815260200183600160a060020a031681526020018280519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156105d45780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000876161da5a03f1505060408051868152905133600160a060020a031692507f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259181900360200190a35060015b9392505050565b61034c600435602435600160a060020a03808316600090815260016020908152604080832093851683529290522054610157565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156106cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6060908152602090f35b820191906000526020600020905b8154815290600101906020018083116106f357829003601f168201915b505050505081565b610157565b61063256036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b", 11 | address: "", 12 | generated_with: "2.0.9", 13 | contract_name: "Plutons" 14 | }; 15 | 16 | function Contract() { 17 | if (Contract.Pudding == null) { 18 | throw new Error("Plutons error: Please call load() first before creating new instance of this contract."); 19 | } 20 | 21 | Contract.Pudding.apply(this, arguments); 22 | }; 23 | 24 | Contract.load = function(Pudding) { 25 | Contract.Pudding = Pudding; 26 | 27 | Pudding.whisk(contract_data, Contract); 28 | 29 | // Return itself for backwards compatibility. 30 | return Contract; 31 | } 32 | 33 | Contract.new = function() { 34 | if (Contract.Pudding == null) { 35 | throw new Error("Plutons error: Please call load() first before calling new()."); 36 | } 37 | 38 | return Contract.Pudding.new.apply(Contract, arguments); 39 | }; 40 | 41 | Contract.at = function() { 42 | if (Contract.Pudding == null) { 43 | throw new Error("Plutons error: Please call load() first before calling at()."); 44 | } 45 | 46 | return Contract.Pudding.at.apply(Contract, arguments); 47 | }; 48 | 49 | Contract.deployed = function() { 50 | if (Contract.Pudding == null) { 51 | throw new Error("Plutons error: Please call load() first before calling deployed()."); 52 | } 53 | 54 | return Contract.Pudding.deployed.apply(Contract, arguments); 55 | }; 56 | 57 | if (typeof module != "undefined" && typeof module.exports != "undefined") { 58 | module.exports = Contract; 59 | } else { 60 | // There will only be one version of Pudding in the browser, 61 | // and we can use that. 62 | window.Plutons = Contract; 63 | } 64 | 65 | })(); 66 | -------------------------------------------------------------------------------- /environments/test/contracts/PlutusDex.sol.js: -------------------------------------------------------------------------------- 1 | // Factory "morphs" into a Pudding class. 2 | // The reasoning is that calling load in each context 3 | // is cumbersome. 4 | 5 | (function() { 6 | 7 | var contract_data = { 8 | abi: [{"constant":false,"inputs":[{"name":"trader","type":"address"},{"name":"fiatDeposited","type":"uint256"},{"name":"fiatSymbol","type":"uint8"},{"name":"btcAsked","type":"uint256"},{"name":"btcAddress","type":"bytes20"}],"name":"depositFiat","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"trader","type":"address"},{"name":"btcOffered","type":"uint256"},{"name":"userVdcIban","type":"bytes32"}],"name":"offerBtc","outputs":[{"name":"result","type":"bool"}],"type":"function"},{"inputs":[],"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"trader","type":"address"},{"indexed":false,"name":"fiatDeposited","type":"uint256"},{"indexed":false,"name":"fiatSymbol","type":"PlutusDex.CurrencySymbol"},{"indexed":false,"name":"btcAsked","type":"uint256"},{"indexed":false,"name":"btcAddress","type":"bytes20"}],"name":"FiatDeposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"userVdcIban","type":"bytes32"},{"indexed":false,"name":"fiatAmount","type":"uint256"},{"indexed":false,"name":"fiatSymbol","type":"PlutusDex.CurrencySymbol"},{"indexed":false,"name":"btcTradingVolume","type":"uint256"}],"name":"VdcLoaded","type":"event"}], 9 | binary: "6060604052600160a060020a0333166000908152602081905260408120805460ff19166001179055600255610219806100386000396000f3606060405260e060020a6000350463a673e81d8114610026578063ed80577d1461012f575b005b610024600435602435604435606435608435600160a060020a03331660009081526020819052604090205460ff16156101285761010060408181526060879052608086905260a085815260c085905260e0849052600160a060020a038816600081815260016020819052939020805473ffffffffffffffffffffffffffffffffffffffff199081168b17825593810189905560028101805460ff1916891790556003810187905560040180549093166c010000000000000000000000008604179092559082526101208690526101408590526101608490526101808390527fb381da80508e7a8c6bae91ec57c281616be06e46b00dcc005a6be5fbaf45e5b491a15b5050505050565b61018f600435602435604435600160a060020a03331660009081526020819052604081205481908190819060ff161561020f57600160a060020a0387168152600160205260408120600381015490935086901015610199578591506101a1565b6060908152602090f35b600383015491505b5060038201805460018401805491849003909255868304810290819003909155600280548301808255908401546060878152608084815260ff9290921660a05260c0929092527f78293d06810c9d9e6cb7a15bd0e585b7183688dddb81acf9f500d7357a08bcec91a1600193505b505050939250505056", 10 | unlinked_binary: "6060604052600160a060020a0333166000908152602081905260408120805460ff19166001179055600255610219806100386000396000f3606060405260e060020a6000350463a673e81d8114610026578063ed80577d1461012f575b005b610024600435602435604435606435608435600160a060020a03331660009081526020819052604090205460ff16156101285761010060408181526060879052608086905260a085815260c085905260e0849052600160a060020a038816600081815260016020819052939020805473ffffffffffffffffffffffffffffffffffffffff199081168b17825593810189905560028101805460ff1916891790556003810187905560040180549093166c010000000000000000000000008604179092559082526101208690526101408590526101608490526101808390527fb381da80508e7a8c6bae91ec57c281616be06e46b00dcc005a6be5fbaf45e5b491a15b5050505050565b61018f600435602435604435600160a060020a03331660009081526020819052604081205481908190819060ff161561020f57600160a060020a0387168152600160205260408120600381015490935086901015610199578591506101a1565b6060908152602090f35b600383015491505b5060038201805460018401805491849003909255868304810290819003909155600280548301808255908401546060878152608084815260ff9290921660a05260c0929092527f78293d06810c9d9e6cb7a15bd0e585b7183688dddb81acf9f500d7357a08bcec91a1600193505b505050939250505056", 11 | address: "", 12 | generated_with: "2.0.9", 13 | contract_name: "PlutusDex" 14 | }; 15 | 16 | function Contract() { 17 | if (Contract.Pudding == null) { 18 | throw new Error("PlutusDex error: Please call load() first before creating new instance of this contract."); 19 | } 20 | 21 | Contract.Pudding.apply(this, arguments); 22 | }; 23 | 24 | Contract.load = function(Pudding) { 25 | Contract.Pudding = Pudding; 26 | 27 | Pudding.whisk(contract_data, Contract); 28 | 29 | // Return itself for backwards compatibility. 30 | return Contract; 31 | } 32 | 33 | Contract.new = function() { 34 | if (Contract.Pudding == null) { 35 | throw new Error("PlutusDex error: Please call load() first before calling new()."); 36 | } 37 | 38 | return Contract.Pudding.new.apply(Contract, arguments); 39 | }; 40 | 41 | Contract.at = function() { 42 | if (Contract.Pudding == null) { 43 | throw new Error("PlutusDex error: Please call load() first before calling at()."); 44 | } 45 | 46 | return Contract.Pudding.at.apply(Contract, arguments); 47 | }; 48 | 49 | Contract.deployed = function() { 50 | if (Contract.Pudding == null) { 51 | throw new Error("PlutusDex error: Please call load() first before calling deployed()."); 52 | } 53 | 54 | return Contract.Pudding.deployed.apply(Contract, arguments); 55 | }; 56 | 57 | if (typeof module != "undefined" && typeof module.exports != "undefined") { 58 | module.exports = Contract; 59 | } else { 60 | // There will only be one version of Pudding in the browser, 61 | // and we can use that. 62 | window.PlutusDex = Contract; 63 | } 64 | 65 | })(); 66 | -------------------------------------------------------------------------------- /environments/test/contracts/PlutusUser.sol.js: -------------------------------------------------------------------------------- 1 | // Factory "morphs" into a Pudding class. 2 | // The reasoning is that calling load in each context 3 | // is cumbersome. 4 | 5 | (function() { 6 | 7 | var contract_data = { 8 | abi: [{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"sendTokenFromDex","outputs":[{"name":"result","type":"bool"}],"type":"function"},{"constant":false,"inputs":[{"name":"_trader","type":"address"},{"name":"_btcOffered","type":"uint256"}],"name":"offerBtcFromApp","outputs":[{"name":"result","type":"bool"}],"type":"function"},{"inputs":[{"name":"_userVdcIban","type":"bytes32"},{"name":"_namereg","type":"address"}],"type":"constructor"}], 9 | binary: "60606040818152806102ac833960a09052516080516000805433600160a060020a0319918216811782161782556002939093556001805490931690911790915561025e90819061004e90396000f3606060405260e060020a600035046317bf8f50811461002657806390f551ec14610138575b005b61024c60043560243560008054819033600160a060020a03908116911614156101315760015460e060020a63511b1df90260609081526020606481815260076084527f506c75746f6e730000000000000000000000000000000000000000000000000060a452600160a060020a03939093169263511b1df99260c492918187876161da5a03f11561000257505060408051805193547f23b872dd000000000000000000000000000000000000000000000000000000008252600160a060020a039081166004830152808816602483015260448201879052915191841692506323b872dd916064828101926020929190829003018188876161da5a03f115610002575050604051519250505b5092915050565b61024c60043560243560008054819033600160a060020a03908116911614156101315760015460e060020a63511b1df90260609081526020606481815260096084527f506c75747573446578000000000000000000000000000000000000000000000060a452600160a060020a03939093169263511b1df99260c492918187876161da5a03f1156100025750506040805180516002547fed80577d000000000000000000000000000000000000000000000000000000008352600160a060020a03808a1660048501526024840189905260448401919091529251909450918416925063ed80577d916064828101926020929190829003018188876161da5a03f1156100025750506040515192506101319050565b60408051918252519081900360200190f3", 10 | unlinked_binary: "60606040818152806102ac833960a09052516080516000805433600160a060020a0319918216811782161782556002939093556001805490931690911790915561025e90819061004e90396000f3606060405260e060020a600035046317bf8f50811461002657806390f551ec14610138575b005b61024c60043560243560008054819033600160a060020a03908116911614156101315760015460e060020a63511b1df90260609081526020606481815260076084527f506c75746f6e730000000000000000000000000000000000000000000000000060a452600160a060020a03939093169263511b1df99260c492918187876161da5a03f11561000257505060408051805193547f23b872dd000000000000000000000000000000000000000000000000000000008252600160a060020a039081166004830152808816602483015260448201879052915191841692506323b872dd916064828101926020929190829003018188876161da5a03f115610002575050604051519250505b5092915050565b61024c60043560243560008054819033600160a060020a03908116911614156101315760015460e060020a63511b1df90260609081526020606481815260096084527f506c75747573446578000000000000000000000000000000000000000000000060a452600160a060020a03939093169263511b1df99260c492918187876161da5a03f1156100025750506040805180516002547fed80577d000000000000000000000000000000000000000000000000000000008352600160a060020a03808a1660048501526024840189905260448401919091529251909450918416925063ed80577d916064828101926020929190829003018188876161da5a03f1156100025750506040515192506101319050565b60408051918252519081900360200190f3", 11 | address: "", 12 | generated_with: "2.0.9", 13 | contract_name: "PlutusUser" 14 | }; 15 | 16 | function Contract() { 17 | if (Contract.Pudding == null) { 18 | throw new Error("PlutusUser error: Please call load() first before creating new instance of this contract."); 19 | } 20 | 21 | Contract.Pudding.apply(this, arguments); 22 | }; 23 | 24 | Contract.load = function(Pudding) { 25 | Contract.Pudding = Pudding; 26 | 27 | Pudding.whisk(contract_data, Contract); 28 | 29 | // Return itself for backwards compatibility. 30 | return Contract; 31 | } 32 | 33 | Contract.new = function() { 34 | if (Contract.Pudding == null) { 35 | throw new Error("PlutusUser error: Please call load() first before calling new()."); 36 | } 37 | 38 | return Contract.Pudding.new.apply(Contract, arguments); 39 | }; 40 | 41 | Contract.at = function() { 42 | if (Contract.Pudding == null) { 43 | throw new Error("PlutusUser error: Please call load() first before calling at()."); 44 | } 45 | 46 | return Contract.Pudding.at.apply(Contract, arguments); 47 | }; 48 | 49 | Contract.deployed = function() { 50 | if (Contract.Pudding == null) { 51 | throw new Error("PlutusUser error: Please call load() first before calling deployed()."); 52 | } 53 | 54 | return Contract.Pudding.deployed.apply(Contract, arguments); 55 | }; 56 | 57 | if (typeof module != "undefined" && typeof module.exports != "undefined") { 58 | module.exports = Contract; 59 | } else { 60 | // There will only be one version of Pudding in the browser, 61 | // and we can use that. 62 | window.PlutusUser = Contract; 63 | } 64 | 65 | })(); 66 | -------------------------------------------------------------------------------- /environments/test/contracts/SampleRecipient.sol.js: -------------------------------------------------------------------------------- 1 | // Factory "morphs" into a Pudding class. 2 | // The reasoning is that calling load in each context 3 | // is cumbersome. 4 | 5 | (function() { 6 | 7 | var contract_data = { 8 | abi: [{"constant":true,"inputs":[],"name":"value","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"tokenContract","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[],"name":"extraData","outputs":[{"name":"","type":"bytes"}],"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_value","type":"uint256"},{"name":"_tokenContract","type":"address"},{"name":"_extraData","type":"bytes"}],"name":"receiveApproval","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"from","outputs":[{"name":"","type":"address"}],"type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_value","type":"uint256"}],"name":"ReceivedApproval","type":"event"}], 9 | binary: "60606040526102ff806100126000396000f3606060405260e060020a60003504633fa4f245811461004757806355a373d614610050578063609d3334146100625780638f4ffcb1146100bf578063d5ce3389146101c0575b005b6101d260015481565b6101dc600254600160a060020a031681565b6101ef60038054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156102885780601f1061025d57610100808354040283529160200191610288565b60806020600460643581810135601f81018490049093028401604052606083815261004594833594602480359560443595909460849490939290910191908190838280828437509496505050505050506000805473ffffffffffffffffffffffffffffffffffffffff199081168617825560018581556002805490921685178255835160038054948190529360209281161561010002600019011692909204601f908101919091047fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b908101929160809083901061029057805160ff19168380011785555b506102c09291505b808211156102fb57600081556001016101ac565b6101dc600054600160a060020a031681565b6060908152602090f35b600160a060020a03166060908152602090f35b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f16801561024f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b820191906000526020600020905b81548152906001019060200180831161026b57829003601f168201915b505050505081565b828001600101855582156101a4579182015b828111156101a45782518260005055916020019190600101906102a2565b50506040805184815290517f2db24179b782aab7c5ab64add7f84d4f6c845d0779695371f29be1f658d043cd9181900360200190a150505050565b509056", 10 | unlinked_binary: "60606040526102ff806100126000396000f3606060405260e060020a60003504633fa4f245811461004757806355a373d614610050578063609d3334146100625780638f4ffcb1146100bf578063d5ce3389146101c0575b005b6101d260015481565b6101dc600254600160a060020a031681565b6101ef60038054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156102885780601f1061025d57610100808354040283529160200191610288565b60806020600460643581810135601f81018490049093028401604052606083815261004594833594602480359560443595909460849490939290910191908190838280828437509496505050505050506000805473ffffffffffffffffffffffffffffffffffffffff199081168617825560018581556002805490921685178255835160038054948190529360209281161561010002600019011692909204601f908101919091047fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b908101929160809083901061029057805160ff19168380011785555b506102c09291505b808211156102fb57600081556001016101ac565b6101dc600054600160a060020a031681565b6060908152602090f35b600160a060020a03166060908152602090f35b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f16801561024f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b820191906000526020600020905b81548152906001019060200180831161026b57829003601f168201915b505050505081565b828001600101855582156101a4579182015b828111156101a45782518260005055916020019190600101906102a2565b50506040805184815290517f2db24179b782aab7c5ab64add7f84d4f6c845d0779695371f29be1f658d043cd9181900360200190a150505050565b509056", 11 | address: "", 12 | generated_with: "2.0.9", 13 | contract_name: "SampleRecipient" 14 | }; 15 | 16 | function Contract() { 17 | if (Contract.Pudding == null) { 18 | throw new Error("SampleRecipient error: Please call load() first before creating new instance of this contract."); 19 | } 20 | 21 | Contract.Pudding.apply(this, arguments); 22 | }; 23 | 24 | Contract.load = function(Pudding) { 25 | Contract.Pudding = Pudding; 26 | 27 | Pudding.whisk(contract_data, Contract); 28 | 29 | // Return itself for backwards compatibility. 30 | return Contract; 31 | } 32 | 33 | Contract.new = function() { 34 | if (Contract.Pudding == null) { 35 | throw new Error("SampleRecipient error: Please call load() first before calling new()."); 36 | } 37 | 38 | return Contract.Pudding.new.apply(Contract, arguments); 39 | }; 40 | 41 | Contract.at = function() { 42 | if (Contract.Pudding == null) { 43 | throw new Error("SampleRecipient error: Please call load() first before calling at()."); 44 | } 45 | 46 | return Contract.Pudding.at.apply(Contract, arguments); 47 | }; 48 | 49 | Contract.deployed = function() { 50 | if (Contract.Pudding == null) { 51 | throw new Error("SampleRecipient error: Please call load() first before calling deployed()."); 52 | } 53 | 54 | return Contract.Pudding.deployed.apply(Contract, arguments); 55 | }; 56 | 57 | if (typeof module != "undefined" && typeof module.exports != "undefined") { 58 | module.exports = Contract; 59 | } else { 60 | // There will only be one version of Pudding in the browser, 61 | // and we can use that. 62 | window.SampleRecipient = Contract; 63 | } 64 | 65 | })(); 66 | -------------------------------------------------------------------------------- /environments/test/contracts/StandardToken.sol.js: -------------------------------------------------------------------------------- 1 | // Factory "morphs" into a Pudding class. 2 | // The reasoning is that calling load in each context 3 | // is cumbersome. 4 | 5 | (function() { 6 | 7 | var contract_data = { 8 | abi: [{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Approval","type":"event"}], 9 | binary: "6060604052610321806100126000396000f3606060405236156100565760e060020a6000350463095ea7b3811461005857806318160ddd146100c357806323b872dd146100cc57806370a0823114610230578063a9059cbb14610256578063dd62ed3e146102e8575b005b61024c60043560243533600160a060020a03908116600081815260016020908152604080832094871680845294825282208590556060858152919392917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a35060015b92915050565b61024c60025481565b61024c600435602435604435600160a060020a03831660009081526020819052604081205482901080159061011f575060016020908152604080832033600160a060020a03168452909152812054829010155b801561012b5750600082115b1561022957816000600050600085600160a060020a03168152602001908152602001600020600082828250540192505081905550816000600050600086600160a060020a03168152602001908152602001600020600082828250540392505081905550816001600050600086600160a060020a03168152602001908152602001600020600050600033600160a060020a0316815260200190815260200160002060008282825054039250508190555082600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35060015b9392505050565b600160a060020a03600435166000908152602081905260409020545b6060908152602090f35b61024c60043560243533600160a060020a03166000908152602081905260408120548290108015906102885750600082115b1561031c57604080822080548490039055600160a060020a03808516808452918320805485019055606084815233909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602090a35060016100bd565b61024c600435602435600160a060020a038083166000908152600160209081526040808320938516835292905220546100bd565b6100bd56", 10 | unlinked_binary: "6060604052610321806100126000396000f3606060405236156100565760e060020a6000350463095ea7b3811461005857806318160ddd146100c357806323b872dd146100cc57806370a0823114610230578063a9059cbb14610256578063dd62ed3e146102e8575b005b61024c60043560243533600160a060020a03908116600081815260016020908152604080832094871680845294825282208590556060858152919392917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a35060015b92915050565b61024c60025481565b61024c600435602435604435600160a060020a03831660009081526020819052604081205482901080159061011f575060016020908152604080832033600160a060020a03168452909152812054829010155b801561012b5750600082115b1561022957816000600050600085600160a060020a03168152602001908152602001600020600082828250540192505081905550816000600050600086600160a060020a03168152602001908152602001600020600082828250540392505081905550816001600050600086600160a060020a03168152602001908152602001600020600050600033600160a060020a0316815260200190815260200160002060008282825054039250508190555082600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35060015b9392505050565b600160a060020a03600435166000908152602081905260409020545b6060908152602090f35b61024c60043560243533600160a060020a03166000908152602081905260408120548290108015906102885750600082115b1561031c57604080822080548490039055600160a060020a03808516808452918320805485019055606084815233909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602090a35060016100bd565b61024c600435602435600160a060020a038083166000908152600160209081526040808320938516835292905220546100bd565b6100bd56", 11 | address: "", 12 | generated_with: "2.0.9", 13 | contract_name: "StandardToken" 14 | }; 15 | 16 | function Contract() { 17 | if (Contract.Pudding == null) { 18 | throw new Error("StandardToken error: Please call load() first before creating new instance of this contract."); 19 | } 20 | 21 | Contract.Pudding.apply(this, arguments); 22 | }; 23 | 24 | Contract.load = function(Pudding) { 25 | Contract.Pudding = Pudding; 26 | 27 | Pudding.whisk(contract_data, Contract); 28 | 29 | // Return itself for backwards compatibility. 30 | return Contract; 31 | } 32 | 33 | Contract.new = function() { 34 | if (Contract.Pudding == null) { 35 | throw new Error("StandardToken error: Please call load() first before calling new()."); 36 | } 37 | 38 | return Contract.Pudding.new.apply(Contract, arguments); 39 | }; 40 | 41 | Contract.at = function() { 42 | if (Contract.Pudding == null) { 43 | throw new Error("StandardToken error: Please call load() first before calling at()."); 44 | } 45 | 46 | return Contract.Pudding.at.apply(Contract, arguments); 47 | }; 48 | 49 | Contract.deployed = function() { 50 | if (Contract.Pudding == null) { 51 | throw new Error("StandardToken error: Please call load() first before calling deployed()."); 52 | } 53 | 54 | return Contract.Pudding.deployed.apply(Contract, arguments); 55 | }; 56 | 57 | if (typeof module != "undefined" && typeof module.exports != "undefined") { 58 | module.exports = Contract; 59 | } else { 60 | // There will only be one version of Pudding in the browser, 61 | // and we can use that. 62 | window.StandardToken = Contract; 63 | } 64 | 65 | })(); 66 | -------------------------------------------------------------------------------- /environments/test/contracts/Standard_Token.sol.js: -------------------------------------------------------------------------------- 1 | // Factory "morphs" into a Pudding class. 2 | // The reasoning is that calling load in each context 3 | // is cumbersome. 4 | 5 | (function() { 6 | 7 | var contract_data = { 8 | abi: [], 9 | binary: "606060405260068060106000396000f3606060405200", 10 | unlinked_binary: "606060405260068060106000396000f3606060405200", 11 | address: "", 12 | generated_with: "2.0.9", 13 | contract_name: "Standard_Token" 14 | }; 15 | 16 | function Contract() { 17 | if (Contract.Pudding == null) { 18 | throw new Error("Standard_Token error: Please call load() first before creating new instance of this contract."); 19 | } 20 | 21 | Contract.Pudding.apply(this, arguments); 22 | }; 23 | 24 | Contract.load = function(Pudding) { 25 | Contract.Pudding = Pudding; 26 | 27 | Pudding.whisk(contract_data, Contract); 28 | 29 | // Return itself for backwards compatibility. 30 | return Contract; 31 | } 32 | 33 | Contract.new = function() { 34 | if (Contract.Pudding == null) { 35 | throw new Error("Standard_Token error: Please call load() first before calling new()."); 36 | } 37 | 38 | return Contract.Pudding.new.apply(Contract, arguments); 39 | }; 40 | 41 | Contract.at = function() { 42 | if (Contract.Pudding == null) { 43 | throw new Error("Standard_Token error: Please call load() first before calling at()."); 44 | } 45 | 46 | return Contract.Pudding.at.apply(Contract, arguments); 47 | }; 48 | 49 | Contract.deployed = function() { 50 | if (Contract.Pudding == null) { 51 | throw new Error("Standard_Token error: Please call load() first before calling deployed()."); 52 | } 53 | 54 | return Contract.Pudding.deployed.apply(Contract, arguments); 55 | }; 56 | 57 | if (typeof module != "undefined" && typeof module.exports != "undefined") { 58 | module.exports = Contract; 59 | } else { 60 | // There will only be one version of Pudding in the browser, 61 | // and we can use that. 62 | window.Standard_Token = Contract; 63 | } 64 | 65 | })(); 66 | -------------------------------------------------------------------------------- /environments/test/contracts/Token.sol.js: -------------------------------------------------------------------------------- 1 | // Factory "morphs" into a Pudding class. 2 | // The reasoning is that calling load in each context 3 | // is cumbersome. 4 | 5 | (function() { 6 | 7 | var contract_data = { 8 | abi: [{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"supply","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Approval","type":"event"}], 9 | binary: "6060604052605d8060106000396000f360606040523615604f5760e060020a6000350463095ea7b38114605157806318160ddd14605157806323b872dd14605157806370a08231146051578063a9059cbb146051578063dd62ed3e146051575b005b60006060908152602090f3", 10 | unlinked_binary: "6060604052605d8060106000396000f360606040523615604f5760e060020a6000350463095ea7b38114605157806318160ddd14605157806323b872dd14605157806370a08231146051578063a9059cbb146051578063dd62ed3e146051575b005b60006060908152602090f3", 11 | address: "", 12 | generated_with: "2.0.9", 13 | contract_name: "Token" 14 | }; 15 | 16 | function Contract() { 17 | if (Contract.Pudding == null) { 18 | throw new Error("Token error: Please call load() first before creating new instance of this contract."); 19 | } 20 | 21 | Contract.Pudding.apply(this, arguments); 22 | }; 23 | 24 | Contract.load = function(Pudding) { 25 | Contract.Pudding = Pudding; 26 | 27 | Pudding.whisk(contract_data, Contract); 28 | 29 | // Return itself for backwards compatibility. 30 | return Contract; 31 | } 32 | 33 | Contract.new = function() { 34 | if (Contract.Pudding == null) { 35 | throw new Error("Token error: Please call load() first before calling new()."); 36 | } 37 | 38 | return Contract.Pudding.new.apply(Contract, arguments); 39 | }; 40 | 41 | Contract.at = function() { 42 | if (Contract.Pudding == null) { 43 | throw new Error("Token error: Please call load() first before calling at()."); 44 | } 45 | 46 | return Contract.Pudding.at.apply(Contract, arguments); 47 | }; 48 | 49 | Contract.deployed = function() { 50 | if (Contract.Pudding == null) { 51 | throw new Error("Token error: Please call load() first before calling deployed()."); 52 | } 53 | 54 | return Contract.Pudding.deployed.apply(Contract, arguments); 55 | }; 56 | 57 | if (typeof module != "undefined" && typeof module.exports != "undefined") { 58 | module.exports = Contract; 59 | } else { 60 | // There will only be one version of Pudding in the browser, 61 | // and we can use that. 62 | window.Token = Contract; 63 | } 64 | 65 | })(); 66 | -------------------------------------------------------------------------------- /environments/test/contracts/TokenTester.sol.js: -------------------------------------------------------------------------------- 1 | // Factory "morphs" into a Pudding class. 2 | // The reasoning is that calling load in each context 3 | // is cumbersome. 4 | 5 | (function() { 6 | 7 | var contract_data = { 8 | abi: [{"constant":true,"inputs":[],"name":"tokenContractAddress","outputs":[{"name":"","type":"address"}],"type":"function"}], 9 | binary: "606060405260428060106000396000f3606060405260e060020a600035046382edaf948114601a575b005b603860005473ffffffffffffffffffffffffffffffffffffffff1681565b6060908152602090f3", 10 | unlinked_binary: "606060405260428060106000396000f3606060405260e060020a600035046382edaf948114601a575b005b603860005473ffffffffffffffffffffffffffffffffffffffff1681565b6060908152602090f3", 11 | address: "0xcbdc49b26c54653824e1c4033b030b0eddc35d2b", 12 | generated_with: "2.0.9", 13 | contract_name: "TokenTester" 14 | }; 15 | 16 | function Contract() { 17 | if (Contract.Pudding == null) { 18 | throw new Error("TokenTester error: Please call load() first before creating new instance of this contract."); 19 | } 20 | 21 | Contract.Pudding.apply(this, arguments); 22 | }; 23 | 24 | Contract.load = function(Pudding) { 25 | Contract.Pudding = Pudding; 26 | 27 | Pudding.whisk(contract_data, Contract); 28 | 29 | // Return itself for backwards compatibility. 30 | return Contract; 31 | } 32 | 33 | Contract.new = function() { 34 | if (Contract.Pudding == null) { 35 | throw new Error("TokenTester error: Please call load() first before calling new()."); 36 | } 37 | 38 | return Contract.Pudding.new.apply(Contract, arguments); 39 | }; 40 | 41 | Contract.at = function() { 42 | if (Contract.Pudding == null) { 43 | throw new Error("TokenTester error: Please call load() first before calling at()."); 44 | } 45 | 46 | return Contract.Pudding.at.apply(Contract, arguments); 47 | }; 48 | 49 | Contract.deployed = function() { 50 | if (Contract.Pudding == null) { 51 | throw new Error("TokenTester error: Please call load() first before calling deployed()."); 52 | } 53 | 54 | return Contract.Pudding.deployed.apply(Contract, arguments); 55 | }; 56 | 57 | if (typeof module != "undefined" && typeof module.exports != "undefined") { 58 | module.exports = Contract; 59 | } else { 60 | // There will only be one version of Pudding in the browser, 61 | // and we can use that. 62 | window.TokenTester = Contract; 63 | } 64 | 65 | })(); 66 | -------------------------------------------------------------------------------- /environments/test/contracts/Trader.sol.js: -------------------------------------------------------------------------------- 1 | // Factory "morphs" into a Pudding class. 2 | // The reasoning is that calling load in each context 3 | // is cumbersome. 4 | 5 | (function() { 6 | 7 | var contract_data = { 8 | abi: [{"anonymous":false,"inputs":[],"name":"TraderRegistered","type":"event"}], 9 | binary: "606060405260008054600160a060020a0319163317905560068060226000396000f3606060405200", 10 | unlinked_binary: "606060405260008054600160a060020a0319163317905560068060226000396000f3606060405200", 11 | address: "", 12 | generated_with: "2.0.9", 13 | contract_name: "Trader" 14 | }; 15 | 16 | function Contract() { 17 | if (Contract.Pudding == null) { 18 | throw new Error("Trader error: Please call load() first before creating new instance of this contract."); 19 | } 20 | 21 | Contract.Pudding.apply(this, arguments); 22 | }; 23 | 24 | Contract.load = function(Pudding) { 25 | Contract.Pudding = Pudding; 26 | 27 | Pudding.whisk(contract_data, Contract); 28 | 29 | // Return itself for backwards compatibility. 30 | return Contract; 31 | } 32 | 33 | Contract.new = function() { 34 | if (Contract.Pudding == null) { 35 | throw new Error("Trader error: Please call load() first before calling new()."); 36 | } 37 | 38 | return Contract.Pudding.new.apply(Contract, arguments); 39 | }; 40 | 41 | Contract.at = function() { 42 | if (Contract.Pudding == null) { 43 | throw new Error("Trader error: Please call load() first before calling at()."); 44 | } 45 | 46 | return Contract.Pudding.at.apply(Contract, arguments); 47 | }; 48 | 49 | Contract.deployed = function() { 50 | if (Contract.Pudding == null) { 51 | throw new Error("Trader error: Please call load() first before calling deployed()."); 52 | } 53 | 54 | return Contract.Pudding.deployed.apply(Contract, arguments); 55 | }; 56 | 57 | if (typeof module != "undefined" && typeof module.exports != "undefined") { 58 | module.exports = Contract; 59 | } else { 60 | // There will only be one version of Pudding in the browser, 61 | // and we can use that. 62 | window.Trader = Contract; 63 | } 64 | 65 | })(); 66 | -------------------------------------------------------------------------------- /environments/test/contracts/owned.sol.js: -------------------------------------------------------------------------------- 1 | // Factory "morphs" into a Pudding class. 2 | // The reasoning is that calling load in each context 3 | // is cumbersome. 4 | 5 | (function() { 6 | 7 | var contract_data = { 8 | abi: [{"inputs":[],"type":"constructor"}], 9 | binary: "606060405260008054600160a060020a0319163317905560068060226000396000f3606060405200", 10 | unlinked_binary: "606060405260008054600160a060020a0319163317905560068060226000396000f3606060405200", 11 | address: "", 12 | generated_with: "2.0.9", 13 | contract_name: "owned" 14 | }; 15 | 16 | function Contract() { 17 | if (Contract.Pudding == null) { 18 | throw new Error("owned error: Please call load() first before creating new instance of this contract."); 19 | } 20 | 21 | Contract.Pudding.apply(this, arguments); 22 | }; 23 | 24 | Contract.load = function(Pudding) { 25 | Contract.Pudding = Pudding; 26 | 27 | Pudding.whisk(contract_data, Contract); 28 | 29 | // Return itself for backwards compatibility. 30 | return Contract; 31 | } 32 | 33 | Contract.new = function() { 34 | if (Contract.Pudding == null) { 35 | throw new Error("owned error: Please call load() first before calling new()."); 36 | } 37 | 38 | return Contract.Pudding.new.apply(Contract, arguments); 39 | }; 40 | 41 | Contract.at = function() { 42 | if (Contract.Pudding == null) { 43 | throw new Error("owned error: Please call load() first before calling at()."); 44 | } 45 | 46 | return Contract.Pudding.at.apply(Contract, arguments); 47 | }; 48 | 49 | Contract.deployed = function() { 50 | if (Contract.Pudding == null) { 51 | throw new Error("owned error: Please call load() first before calling deployed()."); 52 | } 53 | 54 | return Contract.Pudding.deployed.apply(Contract, arguments); 55 | }; 56 | 57 | if (typeof module != "undefined" && typeof module.exports != "undefined") { 58 | module.exports = Contract; 59 | } else { 60 | // There will only be one version of Pudding in the browser, 61 | // and we can use that. 62 | window.owned = Contract; 63 | } 64 | 65 | })(); 66 | -------------------------------------------------------------------------------- /migrations/1_initial_migration.js: -------------------------------------------------------------------------------- 1 | module.exports = function(deployer) { 2 | deployer.deploy(Migrations); 3 | }; 4 | -------------------------------------------------------------------------------- /migrations/2_deploy_contracts.js: -------------------------------------------------------------------------------- 1 | module.exports = function(deployer) { 2 | deployer.deploy(Pluton); 3 | }; 4 | -------------------------------------------------------------------------------- /test/humanStandardToken.js: -------------------------------------------------------------------------------- 1 | contract("HumanStandardToken", function(accounts) { 2 | 3 | //CREATION 4 | 5 | it("creation: should create an initial balance of 10000 for the creator", function(done) { 6 | HumanStandardToken.new(10000, 'Simon Bucks', 1, 'SBX', {from: accounts[0]}).then(function(ctr) { 7 | return ctr.balanceOf.call(accounts[0]); 8 | }).then(function (result) { 9 | assert.strictEqual(result.toNumber(), 10000); 10 | done(); 11 | }).catch(done); 12 | }); 13 | 14 | it("creation: test correct setting of vanity information", function(done) { 15 | var ctr; 16 | HumanStandardToken.new(10000, 'Simon Bucks', 1, 'SBX', {from: accounts[0]}).then(function(result) { 17 | ctr = result; 18 | return ctr.name.call(); 19 | }).then(function (result) { 20 | assert.strictEqual(result, 'Simon Bucks'); 21 | return ctr.decimals.call(); 22 | }).then(function(result) { 23 | assert.strictEqual(result.toNumber(), 1); 24 | return ctr.symbol.call(); 25 | }).then(function(result) { 26 | assert.strictEqual(result, 'SBX'); 27 | done(); 28 | }).catch(done); 29 | }); 30 | 31 | it("creation: should succeed in creating over 2^256 - 1 (max) tokens", function(done) { 32 | //2^256 - 1 33 | HumanStandardToken.new('115792089237316195423570985008687907853269984665640564039457584007913129639935', 'Simon Bucks', 1, 'SBX', {from: accounts[0]}).then(function(ctr) { 34 | return ctr.totalSupply(); 35 | }).then(function (result) { 36 | var match = result.equals('1.15792089237316195423570985008687907853269984665640564039457584007913129639935e+77'); 37 | assert.isTrue(match); 38 | done(); 39 | }).catch(done); 40 | }); 41 | 42 | //TRANSERS 43 | //normal transfers without approvals. 44 | 45 | //this is not *good* enough as the contract could still throw an error otherwise. 46 | //ideally one should check balances before and after, but estimateGas currently always throws an error. 47 | //it's not giving estimate on gas used in the event of an error. 48 | it("transfers: ether transfer should be reversed.", function(done) { 49 | var ctr; 50 | HumanStandardToken.new(10000, 'Simon Bucks', 1, 'SBX', {from: accounts[0]}).then(function(result) { 51 | ctr = result; 52 | return web3.eth.sendTransaction({from: accounts[0], to: ctr.address, value: web3.toWei("10", "Ether")}); 53 | }).catch(function(result) { 54 | done(); 55 | }).catch(done); 56 | }); 57 | 58 | 59 | it("transfers: should transfer 10000 to accounts[1] with accounts[0] having 10000", function(done) { 60 | var ctr; 61 | HumanStandardToken.new(10000, 'Simon Bucks', 1, 'SBX', {from: accounts[0]}).then(function(result) { 62 | ctr = result; 63 | return ctr.transfer(accounts[1], 10000, {from: accounts[0]}); 64 | }).then(function (result) { 65 | return ctr.balanceOf.call(accounts[1]); 66 | }).then(function (result) { 67 | assert.strictEqual(result.toNumber(), 10000); 68 | done(); 69 | }).catch(done); 70 | }); 71 | 72 | it("transfers: should fail when trying to transfer 10001 to accounts[1] with accounts[0] having 10000", function(done) { 73 | var ctr; 74 | HumanStandardToken.new(10000, 'Simon Bucks', 1, 'SBX', {from: accounts[0]}).then(function(result) { 75 | ctr = result; 76 | return ctr.transfer.call(accounts[1], 10001, {from: accounts[0]}); 77 | }).then(function (result) { 78 | assert.isFalse(result); 79 | done(); 80 | }).catch(done); 81 | }); 82 | 83 | it("transfers: should fail when trying to transfer zero.", function(done) { 84 | var ctr; 85 | HumanStandardToken.new(10000, 'Simon Bucks', 1, 'SBX', {from: accounts[0]}).then(function(result) { 86 | ctr = result; 87 | return ctr.transfer.call(accounts[1], 0, {from: accounts[0]}); 88 | }).then(function (result) { 89 | assert.isFalse(result); 90 | done(); 91 | }).catch(done); 92 | }); 93 | 94 | //NOTE: testing uint256 wrapping is impossible in this standard token since you can't supply > 2^256 -1. 95 | 96 | //todo: transfer max amounts. 97 | 98 | //APPROVALS 99 | 100 | it("approvals: msg.sender should approve 100 to accounts[1]", function(done) { 101 | var ctr = null; 102 | HumanStandardToken.new(10000, 'Simon Bucks', 1, 'SBX', {from: accounts[0]}).then(function(result) { 103 | ctr = result; 104 | return ctr.approve(accounts[1], 100, {from: accounts[0]}); 105 | }).then(function (result) { 106 | return ctr.allowance.call(accounts[0], accounts[1]); 107 | }).then(function (result) { 108 | assert.strictEqual(result.toNumber(), 100); 109 | done(); 110 | }).catch(done); 111 | }); 112 | 113 | it("approvals: msg.sender should approve 100 to SampleRecipient and then NOTIFY SampleRecipient", function(done) { 114 | var ctr = null; 115 | var sampleCtr = null 116 | HumanStandardToken.new(10000, 'Simon Bucks', 1, 'SBX', {from: accounts[0]}).then(function(result) { 117 | ctr = result; 118 | return SampleRecipient.new({from: accounts[0]}); 119 | }).then(function(result) { 120 | sampleCtr = result; 121 | return ctr.approveAndCall(sampleCtr.address, 100, '0x42', {from: accounts[0]}); 122 | }).then(function (result) { 123 | return ctr.allowance.call(accounts[0], sampleCtr.address); 124 | }).then(function (result) { 125 | assert.strictEqual(result.toNumber(), 100); 126 | return sampleCtr.value.call(); 127 | }).then(function (result) { 128 | assert.strictEqual(result.toNumber(), 100); 129 | done(); 130 | }).catch(done); 131 | }); 132 | 133 | //bit overkill. But is for testing a bug 134 | it("approvals: msg.sender approves accounts[1] of 100 & withdraws 20 once.", function(done) { 135 | var ctr = null; 136 | HumanStandardToken.new(10000, 'Simon Bucks', 1, 'SBX', {from: accounts[0]}).then(function(result) { 137 | ctr = result; 138 | return ctr.balanceOf.call(accounts[0]); 139 | }).then(function (result) { 140 | assert.strictEqual(result.toNumber(), 10000); 141 | return ctr.approve(accounts[1], 100, {from: accounts[0]}); 142 | }).then(function (result) { 143 | return ctr.balanceOf.call(accounts[2]); 144 | }).then(function (result) { 145 | assert.strictEqual(result.toNumber(), 0); 146 | return ctr.allowance.call(accounts[0], accounts[1]); 147 | }).then(function (result) { 148 | assert.strictEqual(result.toNumber(), 100); 149 | return ctr.transferFrom.call(accounts[0], accounts[2], 20, {from: accounts[1]}); 150 | }).then(function (result) { 151 | return ctr.transferFrom(accounts[0], accounts[2], 20, {from: accounts[1]}); 152 | }).then(function (result) { 153 | return ctr.allowance.call(accounts[0], accounts[1]); 154 | }).then(function (result) { 155 | assert.strictEqual(result.toNumber(), 80); 156 | return ctr.balanceOf.call(accounts[2]); 157 | }).then(function (result) { 158 | assert.strictEqual(result.toNumber(), 20); 159 | return ctr.balanceOf.call(accounts[0]); 160 | }).then(function (result) { 161 | assert.strictEqual(result.toNumber(), 9980); 162 | done(); 163 | }).catch(done); 164 | }); 165 | 166 | //should approve 100 of msg.sender & withdraw 50, twice. (should succeed) 167 | it("approvals: msg.sender approves accounts[1] of 100 & withdraws 20 twice.", function(done) { 168 | var ctr = null; 169 | HumanStandardToken.new(10000, 'Simon Bucks', 1, 'SBX', {from: accounts[0]}).then(function(result) { 170 | ctr = result; 171 | return ctr.approve(accounts[1], 100, {from: accounts[0]}); 172 | }).then(function (result) { 173 | return ctr.allowance.call(accounts[0], accounts[1]); 174 | }).then(function (result) { 175 | assert.strictEqual(result.toNumber(), 100); 176 | return ctr.transferFrom(accounts[0], accounts[2], 20, {from: accounts[1]}); 177 | }).then(function (result) { 178 | return ctr.allowance.call(accounts[0], accounts[1]); 179 | }).then(function (result) { 180 | assert.strictEqual(result.toNumber(), 80); 181 | return ctr.balanceOf.call(accounts[2]); 182 | }).then(function (result) { 183 | assert.strictEqual(result.toNumber(), 20); 184 | return ctr.balanceOf.call(accounts[0]); 185 | }).then(function (result) { 186 | assert.strictEqual(result.toNumber(), 9980); 187 | //FIRST tx done. 188 | //onto next. 189 | return ctr.transferFrom(accounts[0], accounts[2], 20, {from: accounts[1]}); 190 | }).then(function (result) { 191 | return ctr.allowance.call(accounts[0], accounts[1]); 192 | }).then(function (result) { 193 | assert.strictEqual(result.toNumber(), 60); 194 | return ctr.balanceOf.call(accounts[2]); 195 | }).then(function (result) { 196 | assert.strictEqual(result.toNumber(), 40); 197 | return ctr.balanceOf.call(accounts[0]); 198 | }).then(function (result) { 199 | assert.strictEqual(result.toNumber(), 9960); 200 | done(); 201 | }).catch(done); 202 | }); 203 | 204 | //should approve 100 of msg.sender & withdraw 50 & 60 (should fail). 205 | it("approvals: msg.sender approves accounts[1] of 100 & withdraws 50 & 60 (2nd tx should fail)", function(done) { 206 | var ctr = null; 207 | HumanStandardToken.new(10000, 'Simon Bucks', 1, 'SBX', {from: accounts[0]}).then(function(result) { 208 | ctr = result; 209 | return ctr.approve(accounts[1], 100, {from: accounts[0]}); 210 | }).then(function (result) { 211 | return ctr.allowance.call(accounts[0], accounts[1]); 212 | }).then(function (result) { 213 | assert.strictEqual(result.toNumber(), 100); 214 | return ctr.transferFrom(accounts[0], accounts[2], 50, {from: accounts[1]}); 215 | }).then(function (result) { 216 | return ctr.allowance.call(accounts[0], accounts[1]); 217 | }).then(function (result) { 218 | assert.strictEqual(result.toNumber(), 50); 219 | return ctr.balanceOf.call(accounts[2]); 220 | }).then(function (result) { 221 | assert.strictEqual(result.toNumber(), 50); 222 | return ctr.balanceOf.call(accounts[0]); 223 | }).then(function (result) { 224 | assert.strictEqual(result.toNumber(), 9950); 225 | //FIRST tx done. 226 | //onto next. 227 | return ctr.transferFrom.call(accounts[0], accounts[2], 60, {from: accounts[1]}); 228 | }).then(function (result) { 229 | assert.isFalse(result); 230 | done(); 231 | }).catch(done); 232 | }); 233 | 234 | it("approvals: attempt withdrawal from acconut with no allowance (should fail)", function(done) { 235 | var ctr = null; 236 | HumanStandardToken.new(10000, 'Simon Bucks', 1, 'SBX', {from: accounts[0]}).then(function(result) { 237 | ctr = result; 238 | return ctr.transferFrom.call(accounts[0], accounts[2], 60, {from: accounts[1]}); 239 | }).then(function (result) { 240 | assert.isFalse(result); 241 | done(); 242 | }).catch(done); 243 | }); 244 | 245 | it("approvals: allow accounts[1] 100 to withdraw from accounts[0]. Withdraw 60 and then approve 0 & attempt transfer.", function(done) { 246 | var ctr = null; 247 | HumanStandardToken.new(10000, 'Simon Bucks', 1, 'SBX', {from: accounts[0]}).then(function(result) { 248 | ctr = result; 249 | return ctr.approve(accounts[1], 100, {from: accounts[0]}); 250 | }).then(function (result) { 251 | return ctr.transferFrom(accounts[0], accounts[2], 60, {from: accounts[1]}); 252 | }).then(function (result) { 253 | return ctr.approve(accounts[1], 0, {from: accounts[0]}); 254 | }).then(function (result) { 255 | return ctr.transferFrom.call(accounts[0], accounts[2], 10, {from: accounts[1]}); 256 | }).then(function (result) { 257 | assert.isFalse(result); 258 | done(); 259 | }).catch(done); 260 | }); 261 | 262 | it("approvals: approve max (2^256 - 1)", function(done) { 263 | var ctr = null; 264 | HumanStandardToken.new(10000, 'Simon Bucks', 1, 'SBX', {from: accounts[0]}).then(function(result) { 265 | ctr = result; 266 | return ctr.approve(accounts[1],'115792089237316195423570985008687907853269984665640564039457584007913129639935' , {from: accounts[0]}); 267 | }).then(function (result) { 268 | return ctr.allowance(accounts[0], accounts[1]); 269 | }).then(function (result) { 270 | var match = result.equals('1.15792089237316195423570985008687907853269984665640564039457584007913129639935e+77'); 271 | assert.isTrue(match); 272 | done(); 273 | }).catch(done); 274 | }); 275 | 276 | //todo, max approvals. 277 | 278 | }); 279 | -------------------------------------------------------------------------------- /test/humanStandardTokenFactory.js: -------------------------------------------------------------------------------- 1 | //This currently throws a stack underflow, and thus commented out. Contract is correctly deployed, but createHumanStandardToken throws underflow. 2 | //Replicated under testrpc and debugging to fix this. 3 | 4 | //There is a live working version at: 0x7A3d7A4434058709f18337dfF02F90235760A405 5 | 6 | /*contract("HumanStandardTokenFactory", function(accounts) { 7 | 8 | it("Verify A Human Standard Token Once Deployed", function(done) { 9 | console.log(HumanStandardTokenFactory); 10 | var factory = HumanStandardTokenFactory.at(HumanStandardTokenFactory.deployed_address); 11 | console.log(factory); 12 | return factory.createHumanStandardToken(100000, "Simon Bucks", 2, "SBX", {from: accounts[0]}) 13 | .then(function(tokenContractAddr) { 14 | console.log(tokenContractAddr); 15 | return factory.verifyHumanStandardToken(tokenContractAddr); 16 | }).then(function (result) { 17 | console.log(result); 18 | assert.strictEqual(result, true); 19 | done(); 20 | }).catch(done); 21 | }); 22 | });*/ 23 | -------------------------------------------------------------------------------- /test/tokenTester.js: -------------------------------------------------------------------------------- 1 | //currently commented out as TokenTester is causing a OOG error due to the Factory being too big 2 | //Not fully needed as factory & separate tests cover token creation. 3 | 4 | /*contract("TokenTester", function(accounts) { 5 | it("creates 10000 initial tokens", function(done) { 6 | var tester = TokenTester.at(TokenTester.deployed_address); 7 | tester.tokenContractAddress.call() 8 | .then(function(tokenContractAddr) { 9 | var tokenContract = HumanStandardToken.at(tokenContractAddr); 10 | return tokenContract.balanceOf.call(TokenTester.deployed_address); 11 | }).then(function (result) { 12 | assert.strictEqual(result.toNumber(), 10000); // 10000 as specified in TokenTester.sol 13 | done(); 14 | }).catch(done); 15 | }); 16 | 17 | //todo:add test on retrieving addresses 18 | });*/ 19 | -------------------------------------------------------------------------------- /truffle.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | build: { 3 | "index.html": "index.html", 4 | "app.js": [ 5 | "javascripts/app.js" 6 | ], 7 | "app.css": [ 8 | "stylesheets/app.css" 9 | ], 10 | "images/": "images/" 11 | }, 12 | deploy: [ 13 | "Pluton" 14 | ], 15 | rpc: { 16 | host: "localhost", 17 | port: 8545 18 | }, 19 | networks: { 20 | "live": { 21 | network_id: 1, // Ethereum public network 22 | // optional config values 23 | // host - defaults to "localhost" 24 | // port - defaults to 8545 25 | // gas 26 | // gasPrice 27 | // from - default address to use for any transaction Truffle makes during migrations 28 | }, 29 | "morden": { 30 | network_id: 2, // Official Ethereum test network 31 | }, 32 | "staging": { 33 | network_id: 927 // custom private network 34 | // use default rpc settings 35 | }, 36 | "development": { 37 | network_id: "default" 38 | } 39 | } 40 | }; 41 | --------------------------------------------------------------------------------