Este mini-guia compreende as ferramentas necessárias para executar contratos com o Mist e desenvolver Dapps utilizando uma rede local privada.
- Instalar Mist
| 0x329b5b7c699c2bc3bff7ecbcb0ae29f5ce1f811e |
| var express = require('express'); | |
| var app = express(); | |
| var server = require('http').createServer(app); | |
| var bodyParser = require('body-parser') | |
| app.use( bodyParser.json() ); | |
| app.use(bodyParser.urlencoded({ | |
| extended: true | |
| })); |
| public function getDimensions(&$products) | |
| { | |
| $width = 0; | |
| $height = 0; | |
| $depth = 0; | |
| $weight = 0; | |
| foreach ($products as &$product) { | |
| if ($product['weight']) { | |
| if (self::$weightUnit == 'KGS') { |
| pragma solidity ^0.4.18; | |
| /* New ERC23 contract interface */ | |
| //https://github.com/ethereum/EIPs/issues/223 | |
| contract ERC223 { | |
| // Get the total token supply | |
| function totalSupply() public constant returns (uint _supply); | |
| //Compatibility with ERC20 transfer | |
| function transfer(address to, uint value) public returns (bool ok); |
| pragma solidity ^0.4.18; | |
| //https://github.com/ethereum/EIPs/issues/223 | |
| contract ERC223Token { | |
| string public name = "GoBlockchain Token"; | |
| uint8 public decimals = 0; | |
| string public symbol = "GBC"; | |
| string public version = "GBC 1.0"; | |
| uint256 public totalSupply; | |
| mapping(address => uint) balancesOf; |
| // prama informa a EVM a versão do solidity, | |
| pragma solidity ^0.4.18; | |
| contract Pessoa { | |
| //variável do tipo string | |
| string public nome; | |
| string public email; | |
| //eventos | |
| event LogPersonEmailAlterado(address _pessoa, string emailAlterado); | |
| // construtor |
| //defini a versão de compilação do solidty | |
| pragma solidity ^0.4.18; | |
| contract RegisterNameToken { | |
| //variável map onde a chave é uma array de bytes e o valor booleano(true ou false) | |
| mapping (bytes32=>bool) mapNames; | |
| //array de bytes | |
| bytes32[] public names; | |
| //evento para ser utilizado como callback pela nossa aplicação web | |
| event LogNameRegistered(string _name, uint256 time); |
| pragma solidity 0.4.18; | |
| contract DepositWithdraw { | |
| address private owner; | |
| event LogDebug(uint256 amount); | |
| event LogDepositReceived(address sender, uint256 value); | |
| Depositor[] public depositors; | |
| function DepositWithdraw() public { | |
| owner = msg.sender; |