10  Prática sobre Ferramentas de Desenvolvimento e Frameworks Ethereum: Introdução aos Testes e Deploy com Truffle

Introdução aos Testes e Deploy com Truffle

Resumo
Nesta aula são apresentadas algumas ferramentas de Desenvolvimento e Frameworks para o desenvolvimento e implantação de Contratos Inteligentes. Introduz o Truffle framework, que pode ser usado para testar, implantar contratos inteligentes. Vamos explorar os comandos test e migrate para executarmos testes e fazermos a implantação dos contratos. Faremos deploy para as redes simuladas do truffle, do ganache e para a Rede Privada Local, a etherprivate.

10.1 Introdução

Nesta prática são apresentadas algumas ferramentas de Desenvolvimento e Frameworks para o desenvolvimento e implantação de Contratos Inteligentes. Introduz o Truffle framework, que também pode ser usado para testar, migrar contratos inteligentes.

  • Apresentação de Ferramentas de Desenvolvimento e Frameworks.
  • Explorar o uso do Truffle para testar e implantar contratos.

10.2 Instalação das Ferramentas

  1. Instale as outras ferramentas: Node.js, Ganache e Ganache-CLI, Truffle, Drizzle, Embark e outras ferramentas indicadas no capítulo. O truffle utiliza o nodejs nas versões v14-v18 (https://trufflesuite.com/docs/truffle/how-to/install/)

  2. Instale o nvm para configurar a versão desejada para o Node.js e as bibliotecas necessárias.

$ sudo apt-get install nvm
$ nvm install 18
  1. Instale o Truffle.
$ npm install -g truffle
  1. Verifique a versão instalada das ferramentas.
$ truffle --version
Truffle v5.11.5 (core: 5.11.5)
Ganache v7.9.1
Solidity v0.5.16 (solc-js)
Node v18.16.0
Web3.js v1.10.0
$

Comandos possíves com o Truffle:

$ truffle --help
Truffle v5.11.5 - a development framework for Ethereum

Usage: truffle <command> [options]

Commands:
  truffle build      Execute build pipeline (if configuration present)
  truffle call       Call read-only contract function with arguments
  truffle compile    Compile contract source files
  truffle config     Set user-level configuration options
  truffle console    Run a console with contract abstractions and commands
                     available
  truffle create     Helper to create new contracts, migrations and tests
  truffle dashboard  Start Truffle Dashboard to sign development transactions
                     using browser wallet
  truffle db         Database interface commands
  truffle debug      Interactively debug any transaction on the blockchain
  truffle deploy     (alias for migrate)
  truffle develop    Open a console with a local development blockchain
  truffle exec       Execute a JS module within this Truffle environment
  truffle help       List all commands or provide information about a specific
                     command
  truffle init       Initialize new and empty Ethereum project
  truffle migrate    Run migrations to deploy contracts
  truffle networks   Show addresses for deployed contracts on each network
  truffle obtain     Fetch and cache a specified compiler
  truffle opcode     Print the compiled opcodes for a given contract
  truffle preserve   Save data to decentralized storage platforms like IPFS and
                     Filecoin
  truffle run        Run a third-party command
  truffle test       Run JavaScript and Solidity tests
  truffle unbox      Download a Truffle Box, a pre-built Truffle project
  truffle version    Show version number and exit
  truffle watch      Watch filesystem for changes and rebuild the project
                     automatically

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

See more at https://trufflesuite.com/docs/
For Ethereum JSON-RPC documentation see https://ganache.dev
$ 

10.3 Criando a estrutura básica do projeto com o Truffle

Iremos criar a estrutura de um projeto básico. Crie um diretório com o nome do projeto, aqui estou utilizando o nome projeto-helloworld-truffle, crie e acesse o diretório.

[src]$ mkdir projeto-helloworld-truffle
[src]$ cd projeto-helloworld-truffle/

Utilize o comando truffle init para inicializar a estrutura básica do projeto (skeleton).

[projeto-helloworld-truffle]$ truffle init

Starting init...
================

> Copying project files to .../src/projeto-helloworld-truffle

Init successful, sweet!

Try our scaffold commands to get started:
  $ truffle create contract YourContractName # scaffold a contract
  $ truffle create test YourTestName         # scaffold a test

http://trufflesuite.com/docs

[projeto-helloworld-truffle]$ ls
contracts  migrations  test  truffle-config.js
[projeto-helloworld-truffle]$
[src]$ tree projeto-helloworld-truffle/
projeto-helloworld-truffle/
|-- contracts
|-- migrations
|-- test
|-- truffle-config.js

3 directories, 1 files

Se verificarem os diretórios criados contracts, migrations e test estão vazios e foi criado um arquivo de configuração truffle-config.js.

  • contracts: diretório para os contratos.
  • migrations: diretório para os scripts de implantação (deploy).
  • test: diretório para os arquivos de teste.
  • truffle-config.js: Arquivo de configuração do Truffle.

Vamos criar um contrato com nome de Greeter para testarmos.

[projeto-helloworld-truffle]$ truffle create contract Greeter
[projeto-helloworld-truffle]$ ls contracts/
Greeter.sol

Notem que o arquivo Greeter.sol foi criado dentro do diretório contracts.

[src]$ tree projeto-helloworld-truffle/
projeto-helloworld-truffle/
|-- contracts
  |-- Greeter.sol
|-- migrations
|-- test
|-- truffle-config.js

3 directories, 2 files

Editando o contrato Greeter.sol temos uma estrutura básica já criada pelo Truffle.

// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;

contract Greeter {
  constructor() public {
  }
}

Altere o código do Greeter.sol para:

// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;

contract Greeter {
    string private _greeting = "Hello, World!";
    
    function greet() external view returns(string memory) {
        return _greeting;
    }
    function setGreeting(string calldata greeting) external {
        _greeting = greeting;
    }
}

Vamos criar um teste para o contrato Greeter:

[projeto-helloworld-truffle]$ truffle create test greeter_test
[projeto-helloworld-truffle]$ tree ../projeto-helloworld-truffle
../projeto-helloworld-truffle
|-- contracts
    |-- Greeter.sol
|-- migrations
|-- test
    |-- greeter_test.js
|-- truffle-config.js

4 directories, 3 files

Edite o arquivo test/greeter_test.js e altere o código para:

const GreeterContract = artifacts.require("Greeter");

/*
 * uncomment accounts to access the test accounts made available by the
 * Ethereum client
 * See docs: https://www.trufflesuite.com/docs/truffle/testing/writing-tests-in-javascript
 */
contract("Greeter", () => {
  it("has been deployed successfully", async () => {
    const greeter = await GreeterContract.deployed();
    assert(greeter, "contract was not deployed");
  });
});

Se tentarmos executar o teste para o Greeter, o teste irá falhar e emitirá uma mensagem que o contrato não existe, pois não foi feito o deploy para a rede detectada.

[projeto-helloworld-truffle]$ truffle test

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Artifacts written to /tmp/test--524485-YnO69Mn4D3rq
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


  Contract: Greeter
    1) has been deployed successfully
    > No events were emitted


  0 passing (68ms)
  1 failing

  1) Contract: Greeter
       has been deployed successfully:
     Error: Greeter has not been deployed to detected network (network/artifact mismatch)
      at Object.checkNetworkArtifactMatch (/home/rogerio/.nvm/versions/node/v18.16.0/lib/node_modules/truffle/build/ webpack:/packages/contract/lib/utils/index.js:256:1)
      at Function.deployed (/home/rogerio/.nvm/versions/node/v18.16.0/lib/node_modules/truffle/build/ webpack:/packages/contract/lib/contract/constructorMethods.js:83:1)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at Context.<anonymous> (test/greeter_test.js:10:21)

Toda vez que executamos o comando truffle test, o Truffle compila os contratos e então implanta eles para uma rede de teste. Para fazer o deploy precisamos de um outro arquivo migrations.

Migrations são scripts escritos em JavaScript que são usados para automatizar a implantação dos contratos.

Crie o arquivo migrations/2_deploy_greeter.js:

[projeto-helloworld-truffle]$ touch migrations/2_deploy_greeter.js

Edite o arquivo migrations/2_deploy_greeter.js e altere seu conteúdo para:

const GreeterContract = artifacts.require("Greeter");

module.exports = function(deployer) {
    deployer.deploy(GreeterContract);
}

Agora o comando de teste pode ser executado novamente:

[projeto-helloworld-truffle]$ truffle test

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Artifacts written to /tmp/test--525087-Mn9TjRLsIpEK
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


  Contract: Greeter
    [ok] has been deployed successfully


  1 passing (48ms)

Voltemos ao arquivo de teste test/greeter_test.js para adicionarmos um teste para a função greet().

describe("greet()", () => {
  it("returns 'Hello, World!'", async () => {
  const greeter = await GreeterContract.deployed();
  const expected = "Hello, World!";
  const actual = await greeter.greet();
  assert.equal(actual, expected, "greeted with 'Hello, World!'");
  });
});

Executando o teste novamente:

[projeto-helloworld-truffle]$ truffle test

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Artifacts written to /tmp/test--525218-DtJhC1dxt2xO
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


  Contract: Greeter
    [ok] has been deployed successfully

  greet()
    [ok] returns 'Hello, World!'


  2 passing (72ms)

Caso a função greet() não estivesse definida em Greeter.sol o teste falharia e uma mensagem de erro que ela não está definida seria emitida. (Comentei a função para vermos a mensagem).

[projeto-helloworld-truffle]$ truffle test

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Artifacts written to /tmp/test--525417-6OKN7bdHq2gv
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


  Contract: Greeter
    [ok] has been deployed successfully

  greet()
    1) returns 'Hello, World!'


  1 passing (36ms)
  1 failing

  1) greet()
       returns 'Hello, World!':
     TypeError: greeter.greet is not a function
      at Context.<anonymous> (test/greeter_test.js:19:32)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

A função function setGreeting(string calldata greeting) pode ser utilizada para definirmos a mensagem de saudação, deixando o comportamento dinâmico. Adicionemos ao arquivo de teste test/greeter_test.js o código para testar a função setGreeting(string...).

contract("Greeter: update greeting", () => {
  describe("setGreeting(string)", () => {
    it("sets greeting to passed in string", async () => {
      const greeter = await GreeterContract.deployed()
      const expected = "Hi there!";
      await greeter.setGreeting(expected);
      const actual = await greeter.greet();
    
      assert.equal(actual, expected, "greeting was not updated");
    });
  });
});

Executando o teste novamente:

[projeto-helloworld-truffle]$ truffle test

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Artifacts written to /tmp/test--525963-QrnPaijOOsvy
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


  Contract: Greeter
    [ok] has been deployed successfully

  greet()
    [ok] returns 'Hello, World!'

  Contract: Greeter: update greeting
    setGreeting(string)
      [ok] sets greeting to passed in string (75ms)


  3 passing (153ms)

Até aqui temos um projeto básico com teste.

10.4 Definindo um dono para o Contrato

Adicionemos ao arquivo de teste do contrato o teste para uma função que retorna o proprietário do contrato.

contract("owner()", (accounts) => {
    it("returns the address of the owner", async () => {
        const greeter = await GreeterContract.deployed();
        const owner = await greeter.owner();
        assert(owner, "the current owner");
    });
  });

Executando os testes novamente irá dar erro pois a função owner() não foi definida.

[projeto-helloworld-truffle]$ truffle test

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Artifacts written to /tmp/test--526818-prsf62z8pH8F
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


  Contract: Greeter
    [ok] has been deployed successfully
    greet()
      [ok] returns 'Hello, World!'
    Contract: Greeter: update greeting
      setGreeting(string)
        [ok] sets greeting to passed in string (82ms)
    owner()
      1) returns the address of the owner
    > No events were emitted


  3 passing (190ms)
  1 failing

  1) Contract: Greeter
       owner()
         returns the address of the owner:
     TypeError: greeter.owner is not a function
      at Context.<anonymous> (test/greeter_test.js:41:35)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

Adicionemos um atributo _owner e a função no Greeter.sol.

// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;

contract Greeter {
    string private _greeting = "Hello, World!";
    address private _owner;
    
    function greet() external view returns(string memory) {
        return _greeting;
    }
    
    function setGreeting(string calldata greeting) external {
        _greeting = greeting;
    }

    function owner() public view returns(address) {
        return _owner;
    }
}

Executando o teste novamente.

[projeto-helloworld-truffle]$ truffle test

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Artifacts written to /tmp/test--527178-w5UnYmv6jPUK
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


  Contract: Greeter
    [ok] has been deployed successfully
    greet()
      [ok] returns 'Hello, World!'
    Contract: Greeter: update greeting
      setGreeting(string)
        [ok] sets greeting to passed in string (84ms)
    owner()
      [ok] returns the address of the owner


  4 passing (200ms)

O que realmente queremos testar é se o endereço em owner é o mesmo endereço que de quem fez o deploy. Adicionemos para isso uma verificação se o endereço de propriedade é o mesmo da conta padrão que fez a implantação do contrato. Para testarmos isso, precisamos recuperar a variável accounts do ambiente de teste do Truffle.

Altere o arquivo de teste para fazer a verificação:

contract("owner()", (accounts) => {
    it("returns the address of the owner", async () => {
        const greeter = await GreeterContract.deployed();
        const owner = await greeter.owner();
        assert(owner, "the current owner");
    });
    
    it("matches the address that originally deployed the contract", async () => {
        const greeter = await GreeterContract.deployed();
        const owner = await greeter.owner();
        const expected = accounts[0];
        assert.equal(owner, expected, "matches address used to deploy contract");
    });
    
  });

A conta também pode ser verificada com o console do Truffle:

[projeto-helloworld-truffle]$ truffle console
truffle(ganache)> accounts
[
  '0x5C93A5B7BDB9bDc43322F774Cb968e3b01Ab3279',
  '0xd6724701fF337dD6512dD7FaD102F58fCA66570f',
  '0x96E3D79D3D7520096302058d28D148D115F7Beba',
  '0x6d68B588E706d70625A9B233F0e750c75dCc5B17',
  '0xD2E25790e56eE9C1E7E2DeD6d52b8fad745F3de6',
  '0x1ED231Ce2f5217C3Ea1714ce93364edC162FB028',
  '0x8F0F639B591219A6221E64D5810E82b6ce22Df23',
  '0x07744DDa152A9ADEEFEae37C7E773a9d4c75b67E',
  '0x339A0d1f045794cfB6e8e78119E8a2C766d61492',
  '0x344b14B22d9EDf6cCdCadf00Fe9Aa78730a66A49'
]
truffle(ganache)> 

Adicione o construtor ao contrato Greeter.sol

// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;

contract Greeter {
    string private _greeting = "Hello, World!";
    address private _owner;

    constructor() public {
        _owner = msg.sender;
    }
    
    function greet() external view returns(string memory) {
        return _greeting;
    }
    
    function setGreeting(string calldata greeting) external {
        _greeting = greeting;
    }

    function owner() public view returns(address) {
        return _owner;
    }
}

Executando o teste novamente.

[projeto-helloworld-truffle]$ truffle test

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Compilation warnings encountered:

    Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
 --> project:/contracts/Greeter.sol:8:5:
  |
8 |     constructor() public {
  |     ^ (Relevant source part starts here and spans across multiple lines).


> Artifacts written to /tmp/test--11618-Leo1b6jeqjDA
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


  Contract: Greeter
    [ok] has been deployed successfully
    greet()
      [ok] returns 'Hello, World!'
    Contract: Greeter: update greeting
      setGreeting(string)
        [ok] sets greeting to passed in string (74ms)
    Contract: owner()
      [ok] returns the address of the owner
      [ok] matches the address that originally deployed the contract


  5 passing (212ms)

[projeto-helloworld-truffle]$ 

Atualize o teste para verificar quando a mensagem for enviada por outra conta.

contract("Greeter: update greeting", (accounts) => {
    describe("setGreeting(string)", () => {
      describe("when message is sent by the owner", () => {
        it("sets greeting to passed in string", async () => {
          const greeter = await GreeterContract.deployed()
          const expected = "The owner changed the message";
          await greeter.setGreeting(expected);
          const actual = await greeter.greet();
          assert.equal(actual, expected, "greeting updated");
        });
      });
    });
    describe("when message is sent by another account", () => {
      it("does not set the greeting", async () => {
        const greeter = await GreeterContract.deployed()
        const expected = await greeter.greet();
        try {
          await greeter.setGreeting("Not the owner", { from: accounts[1] });
        } catch(err) {
          const errorMessage = "Ownable: caller is not the owner"
          assert.equal(err.reason, errorMessage, "greeting should not update");
          return;
        }
        assert(false, "greeting should not update");
      });
    });
  });

Executando o teste novamente irá dar uma falha com a mensagem AssertionError: greeting should not update.

[projeto-helloworld-truffle]$ truffle test

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Compilation warnings encountered:

    Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
 --> project:/contracts/Greeter.sol:8:5:
  |
8 |     constructor() public {
  |     ^ (Relevant source part starts here and spans across multiple lines).


> Artifacts written to /tmp/test--12088-cfSID7YBzW9j
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


  Contract: Greeter
    [ok] has been deployed successfully
    greet()
      [ok] returns 'Hello, World!'
    Contract: Greeter: update greeting
      setGreeting(string)
        [ok] sets greeting to passed in string (72ms)
    Contract: owner()
      [ok] returns the address of the owner
      [ok] matches the address that originally deployed the contract
    Contract: Greeter: update greeting
      setGreeting(string)
        when message is sent by the owner
          [ok] sets greeting to passed in string (66ms)
      when message is sent by another account
        1) does not set the greeting
    > No events were emitted
    > No events were emitted


  6 passing (361ms)
  1 failing

  1) Contract: Greeter
       Contract: Greeter: update greeting
         when message is sent by another account
           does not set the greeting:
     AssertionError: greeting should not update
      at Context.<anonymous> (test/greeter_test.js:94:9)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

Para corrigir esse falha, adicione o código em Greeter.sol após o construtor.

modifier onlyOwner() {
  require(
    msg.sender == _owner,
    "Ownable: caller is not the owner"
  );
  _;
}

E altere a função setGreeting(...) com o modificador onlyOwner.

function setGreeting(string calldata greeting) external onlyOwner {
  _greeting = greeting;
}

Running our tests, we see they are all passing!

[projeto-helloworld-truffle]$ truffle test

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Compilation warnings encountered:

    Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
 --> project:/contracts/Greeter.sol:8:5:
  |
8 |     constructor() public {
  |     ^ (Relevant source part starts here and spans across multiple lines).


> Artifacts written to /tmp/test--12355-rIMOxZTykP2W
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


  Contract: Greeter
    [ok] has been deployed successfully
    greet()
      [ok] returns 'Hello, World!'
    Contract: Greeter: update greeting
      setGreeting(string)
        [ok] sets greeting to passed in string (84ms)
    Contract: owner()
      [ok] returns the address of the owner
      [ok] matches the address that originally deployed the contract
    Contract: Greeter: update greeting
      setGreeting(string)
        when message is sent by the owner
          [ok] sets greeting to passed in string (80ms)
      when message is sent by another account
        [ok] does not set the greeting (363ms)


  7 passing (751ms)

10.5 Utilizando o OpenZeppelin

Uma outra forma de fazer essa implementação de verificação de propriedade pode ser feita com a biblioteca OpenZeppelin que além de já ter algumas implementações que ajudam na criação de contratos que podem ser usadas na criação de tokens, ele também tem contratos que implementam a ideia de propriedade (ownership), e no que implementamos duplicamos esse comportamento. Vamos atualizar o Greeter.sol para utilizar o que já tem pronto na OpenZeppelin.

Instale o pacote openzeppelin-solidity.

[projeto-helloworld-truffle]$ npm install openzeppelin-solidity

added 1 package in 4s

Altere o código do Greeter.sol para:

pragma solidity >=0.4.22 <0.9.0;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
contract Greeter is Ownable {
...rest of file...

O código do Greeter.sol ficando como segue:

// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;

import "openzeppelin-solidity/contracts/access/Ownable.sol";

contract Greeter is Ownable {
  string private _greeting = "Hello, World!";

  function greet() external view returns(string memory) {
    return _greeting;
  }

  function setGreeting(string calldata greeting) external onlyOwner {
    _greeting = greeting;
  }
}

Reexecutando os testes:

[projeto-helloworld-truffle]$ truffle test

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Compiling ./contracts/Greeter_orig.sol
> Compiling openzeppelin-solidity/contracts/access/Ownable.sol

ParserError: Source file requires different compiler version (current compiler is 0.8.21+commit.d9974bed.Emscripten.clang) - note that nightly builds are considered to be strictly less than the released version
 --> openzeppelin-solidity/contracts/access/Ownable.sol:3:1:
  |
3 | pragma solidity >=0.6.0 <0.8.0;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


Error: Truffle is currently using solc 0.8.21, but one or more of your contracts specify "pragma solidity >=0.6.0 <0.8.0".
Please update your truffle config or pragma statement(s).
(See https://trufflesuite.com/docs/truffle/reference/configuration#compiler-configuration for information on
configuring Truffle to use a specific solc compiler version.)

Compilation failed. See above.
Truffle v5.11.5 (core: 5.11.5)
Node v18.16.0

Edite o arquivo projeto-helloworld-truffle/node_modules/openzeppelin-solidity/contracts/access/ Ownable.sol e node_modules/openzeppelin-solidity/contracts/utils/Context.sol e altere a versão "pragma solidity >=0.4.22 <0.9.0;". No Context.sol para evitar o erro:

TypeError: Return argument type address is not implicitly convertible to expected type (type of first return variable) address payable.
  --> openzeppelin-solidity/contracts/utils/Context.sol:17:16:
   |
17 |         return msg.sender;
   |                ^^^^^^^^^^

Alterei o retorno da função com "return payable(msg.sender);" conforme esse link.

Reexecutando o teste:

[projeto-helloworld-truffle]$ truffle test

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Compiling ./contracts/Greeter_orig.sol
> Compiling openzeppelin-solidity/contracts/access/Ownable.sol
> Compiling openzeppelin-solidity/contracts/utils/Context.sol
> Compilation warnings encountered:

    Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
  --> openzeppelin-solidity/contracts/access/Ownable.sol:26:5:
   |
26 |     constructor () internal {
   |     ^ (Relevant source part starts here and spans across multiple lines).

,Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
 --> project:/contracts/Greeter_orig.sol:8:5:
  |
8 |     constructor() public {
  |     ^ (Relevant source part starts here and spans across multiple lines).


> Artifacts written to /tmp/test--16938-FERyshjfYd95
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang

> Duplicate contract names found for Greeter.
> This can cause errors and unknown behavior. Please rename one of your contracts.


  Contract: Greeter
    [ok] has been deployed successfully
    greet()
      [ok] returns 'Hello, World!'
    Contract: Greeter: update greeting
      setGreeting(string)
        [ok] sets greeting to passed in string (100ms)
    Contract: owner()
      [ok] returns the address of the owner
      [ok] matches the address that originally deployed the contract
    Contract: Greeter: update greeting
      setGreeting(string)
        when message is sent by the owner
          [ok] sets greeting to passed in string (70ms)
      when message is sent by another account
        [ok] does not set the greeting (337ms)


  7 passing (731ms)

10.6 Deploy de Contratos com Truffle

10.7 Deploy de Contratos na rede simulada do Truffle

O comando truffle develop instancia uma rede develop do próprio truffle para que possamos executar os mesmos comandos que foram executados na prática anterior: compile, test e migrate. Ao executar o truffle com develop ele cria a rede com contas e uma chave privada que pode ser adicionada inclusive em carteiras como o Metamask para o desenvolvimento. Também disponibiliza um console javascript no qual podemos executar os comandos compile, test e migrate e interagir com o contrato implantado.

[projeto-helloworld-truffle]$ truffle develop
Truffle Develop started at http://127.0.0.1:9545/

Accounts:
(0) 0xfb3e8f1ca22e8455755562f1079c624b1d275a40
(1) 0xa356061b85e3fde50748ecff8a0380a32a8fbe21
(2) 0x91ecc890cd39950ca9bba8bebe97d09ca2923a1c
(3) 0x2b4054dda869aecc226339aa4eb82d314dbb5cea
(4) 0xd4fd1597e66ffa10b1b1018ec43606e460a3e01d
(5) 0x3f7cee18d311f75cd88793d90e9e2a7df66c42f3
(6) 0x95b3caf69bce253b32789473657f20ad4b6e7bc4
(7) 0x302b59284ebdf2db41fced870a5065a68378de41
(8) 0x79fbbd7ca4f9c410dbe088124052b36b5c3c1834
(9) 0xdab16f7d6242ff621125599368e0394139bbe518

Private Keys:
(0) 4001289ac49b138e0b9bc8dc84d2efc7ff65a762222172e0f209c10066868b3e
(1) 595e967e88f985ce432eb81b66310b0e46af411573a21b1eb3bc0cde537c7d16
(2) 35e65622b2275fb776895b100a910d98465525d8b26f6c7af8b255ea94ea46a7
(3) 0bbefd049bba646f1d12f6951609d11eee7c6c9ce60165e8b7846151f0b9038c
(4) fadefaf5addd9c405ded5abfac3a3fe8353d9851ff4c07db69f0c419088fb51c
(5) 40c1f59c548a95193b0c29a08de44b86e8e00febd5a5f472f07f608c6800794e
(6) cd3fe312a1e5cea9de7e5c682b490a705c9a5fa3865453d3e20856ed7e28ff18
(7) 8f2149d53bb179e8214f831e1a81df9427397d673fb7b1c50bbf83a1dfe8cf40
(8) e0266f03fa1d8e42cfc442a067252815e045fc4d9fee8cdc99a96948b885c7f0
(9) 2970a0dc7a753bbc4ddf49016f4b64fe2b57d93ecc872b5396c40e9688860c33

Mnemonic: enable grace credit robust flight demand excuse airport replace episode real emerge

\warning  Important \warning  : This mnemonic was created for you by Truffle. It is not secure.
Ensure you do not use it on production blockchains, or else you risk losing funds.

Resultado para o comando compile:

truffle(develop)> compile

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Compiling ./contracts/Greeter_orig.sol
> Compiling openzeppelin-solidity/contracts/access/Ownable.sol
> Compiling openzeppelin-solidity/contracts/utils/Context.sol
> Compilation warnings encountered:

    Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
 --> project:/contracts/Greeter_orig.sol:8:5:
  |
8 |     constructor() public {
  |     ^ (Relevant source part starts here and spans across multiple lines).


> Artifacts written to /run/media/rogerio/BK-RAG-HP1TB/repositorios/Dropbox/dados/rogerio/UTFPR/docencia/disciplinas/2023/DLT-PPGCC17/2023-2/aulas/md/aula-16-pratica-implementacao-patentidea-app/src/projeto-helloworld-truffle/build/contracts
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang

Resultado para o comando test:

truffle(develop)> test
Using network 'develop'.


Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Artifacts written to /tmp/test--91695-qVv3c3FelTwd
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


  Contract: Greeter
    \checkmark has been deployed successfully
    greet()
      \checkmark returns 'Hello, World!'
    Contract: Greeter: update greeting
      setGreeting(string)
        \checkmark sets greeting to passed in string (58ms)
    Contract: owner()
      \checkmark returns the address of the owner
      \checkmark matches the address that originally deployed the contract
    Contract: Greeter: update greeting
      setGreeting(string)
        when message is sent by the owner
          \checkmark sets greeting to passed in string (60ms)
      when message is sent by another account
        \checkmark does not set the greeting (321ms)


  7 passing (612ms)

Resultado para o comando migrate:

truffle(develop)> migrate

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Artifacts written to /run/media/rogerio/BK-RAG-HP1TB/repositorios/Dropbox/dados/rogerio/UTFPR/docencia/disciplinas/2023/DLT-PPGCC17/2023-2/aulas/md/aula-16-pratica-implementacao-patentidea-app/src/projeto-helloworld-truffle/build/contracts
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


Starting migrations...
======================
> Network name:    'develop'
> Network id:      5777
> Block gas limit: 6721975 (0x6691b7)


2_deploy_greeter.js
===================

   Replacing 'Greeter'
   -------------------
   > transaction hash:    0xb05207d74bae76c3161d9980eff7aa28410658d34d8bc1efb288f9ec37cabb8f
   > Blocks: 0            Seconds: 0
   > contract address:    0xB4B2090600ac50540d72f923c1B1D82CFd03588E
   > block number:        3
   > block timestamp:     1700072774
   > account:             0xFb3E8f1cA22E8455755562f1079C624b1D275A40
   > balance:             99.994969481844831555
   > gas used:            750889 (0xb7529)
   > gas price:           3.192189957 gwei
   > value sent:          0 ETH
   > total cost:          0.002396980324621773 ETH

   > Saving artifacts
   -------------------------------------
   > Total cost:     0.002396980324621773 ETH

Summary
=======
> Total deployments:   1
> Final cost:          0.002396980324621773 ETH

truffle(develop)> 

No console é possível interagirmos com o contrato implantado, verificando suas propriedades e instanciando-o e fazendo chamadas a seus métodos.

truffle(develop)> Greeter.isDeployed()
true
truffle(develop)> Greeter.address
'0xA29E4Ac8fF0eA3ae093D229F21317a9afacefae3'

truffle(develop)> Greeter.deployed().then(function(instance){app = instance})
undefined
truffle(develop)> app.
app.__proto__             app.hasOwnProperty        app.isPrototypeOf         app.propertyIsEnumerable
app.toLocaleString        app.toString              app.valueOf

app.abi                   app.address               app.allEvents             app.call
app.constructor           app.contract              app.estimateGas           app.getPastEvents
app.greet                 app.methods               app.owner                 app.send
app.sendTransaction       app.setGreeting           app.transactionHash

truffle(develop)> app.setGreeting("Olá")
{
  tx: '0x3dca60061687b1c83b91a585f1bcaf774c5de598686dcecd2b450510cc0cf3cc',
  receipt: {
    transactionHash: '0x3dca60061687b1c83b91a585f1bcaf774c5de598686dcecd2b450510cc0cf3cc',
    transactionIndex: 0,
    blockNumber: 5,
    blockHash: '0x0b0a0a08c735261a5bee202d2154b0fcf94b964807ca93ea6d8b6878e61f2954',
    from: '0xfb3e8f1ca22e8455755562f1079c624b1d275a40',
    to: '0xa29e4ac8ff0ea3ae093d229f21317a9afacefae3',
    cumulativeGasUsed: 29786,
    gasUsed: 29786,
    contractAddress: null,
    logs: [],
    logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
    status: true,
    effectiveGasPrice: 3059154467,
    type: '0x2',
    rawLogs: []
  },
  logs: []
}
truffle(develop)> app.greet()
'Olá'
truffle(develop)> 

10.8 Deploy de Contratos em outras Redes

Nesta prática iremos utilizar o truffle para fazermos o deploy (implantação) de contratos para as redes de teste que utilizamos até o momento.

Estamos utilizando as redes simuladas do ganache, a ganache ou ganache-cli no console e a ganache-ui (AppImage), e a Rede Privada Local, a etherprivate.

A etherprivate está executando o servidor RPC no endereço http://127.0.0.1:8559 com o id \(786\), a rede do ganache via console com os comandos ganache ou ganache-cli no http://127.0.0.1:8545 com id \(2525\) e a ganache-ui está executando no endereço http://127.0.0.1:7545 com id \(5777\).

As configurações das redes podem ser passadas para o arquivo truffle-config.js:

 networks: {
    // Useful for testing. The `development` name is special - truffle uses it by default
    // if it's defined here and no other network is specified at the command line.
    // You should run a client (like ganache, geth, or parity) in a separate terminal
    // tab if you use this network and you must also set the `host`, `port` and `network_id`
    // options below to some value.
    //
    // development: {
    //  host: "127.0.0.1",     // Localhost (default: none)
    //  port: 8545,            // Standard Ethereum port (default: none)
    //  network_id: "*",       // Any network (default: none)
    // },
        // Ganache AppImage (ganache-ui).
    ganacheui: { 
      host: "127.0.0.1",     // Localhost (default: none)
      port: 7545,            // Standard Ethereum port (default: none)
      network_id: "5777",       // Any network (default: none)
    },
    // RAGEtherPrivate.
    etherprivate: {
      host: "127.0.0.1",     // Localhost (default: none)
      port: 8559,            // Standard Ethereum port (default: none)
      network_id: "786",       // Any network (default: none)
    },
    // ganache ou ganache-cli (console)
    ganachecli: {
      host: "127.0.0.1",
      port: 8545,
      network_id: "2525",
    },    
  }

10.9 Deploy na Rede do Ganache-UI

Para executarmos o teste semelhante ao que fizemos com o truffle utilizando uma instância própria do ganache, a execução padrão, vamos executar o teste utilizando uma das redes.

Para listarmos as redes disponíveis podemos executar o comando truffle networks:

[projeto-helloworld-truffle]$ truffle networks

Network: etherprivate (id: 786)
  No contracts deployed.

Network: ganachecli (id: 2525)
  No contracts deployed.

Network: ganacheui (id: 5777)
  No contracts deployed.

Vamos iniciar os testes com a rede criada pelo ganache-ui:

[projeto-helloworld-truffle]$ truffle test --network ganacheui
Using network 'ganacheui'.


Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Artifacts written to /tmp/test--66083-j6FX1wSHRuN8
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang
Error:  *** Deployment Failed ***

"Greeter" hit an invalid opcode while deploying. Try:
   * Verifying that your constructor params satisfy all assert conditions.
   * Verifying your constructor code doesn't access an array out of bounds.
   * Adding reason strings to your assert statements.

    at /home/rogerio/.nvm/versions/node/v18.16.0/lib/node_modules/truffle/build/webpack: /packages/deployer/src/deployment.js:330:1
Truffle v5.11.5 (core: 5.11.5)
Node v18.16.0

Deu um erro de falha no deploy por invalid opcode. Aparecendo na interface do ganache que o contrato não foi implantado:

Contrato não implantado

10.10 Deploy na Rede Privada Local

Executando a Rede Privada Local (etherprivate) que criamos nas aulas anteriores com o geth e tentando fazer o teste assim como fizemos com a rede do ganache.

Comando para executar o clef:

[.etherprivate]$ ~/go-ethereum/build/bin/clef --chainid 786 --keystore ~/.etherprivate/keystore --configdir ~/.etherprivate/clef --http

Comando para executar o geth:

[.etherprivate]$ ~/go-ethereum/build/bin/geth --networkid 786 --datadir ~/.etherprivate/ --syncmode full --allow-insecure-unlock  --identity "RAGEtherPrivate" --http --http.addr 127.0.0.1 --http.port 8559 --http.api "eth,net,web3,personal,engine,admin,debug" --keystore ~/.etherprivate/keystore --authrpc.addr localhost --authrpc.port 8551 --authrpc.vhosts localhost --authrpc.jwtsecret ~/.etherprivate/geth/jwtsecret --nodiscover --maxpeers 15 --miner.etherbase=0x2db017e44b03b37755a4b15e14cd799f83de4c13 --signer=/home/rogerio/.etherprivate/clef/clef.ipc

Executando o teste com a Rede Privada Local:

[projeto-helloworld-truffle]$ truffle test --network etherprivate
Using network 'etherprivate'.

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Artifacts written to /tmp/test--67698-I4SVtxqgxyeZ
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang
Error:  *** Deployment Failed ***

"Greeter" hit an invalid opcode while deploying. Try:
   * Verifying that your constructor params satisfy all assert conditions.
   * Verifying your constructor code doesn't access an array out of bounds.
   * Adding reason strings to your assert statements.

    at /home/rogerio/.nvm/versions/node/v18.16.0/lib/node_modules/truffle/build/webpack: /packages/deployer/src/deployment.js:330:1
Truffle v5.11.5 (core: 5.11.5)
Node v18.16.0

Conseguimos mensagens de confirmação no console do clef:

-------------------------------------------
Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
Approve? [y/N]:
> y
-------- List Account request--------------
A request has been made to list all accounts. 
You can select which accounts the caller can see
  [x] 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-22-11.261468773Z--  2db017e44b03b37755a4b15e14cd799f83de4c13
  [x] 0x7A7686aD451d2865A2246E239B674aeFd4c6c27c
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-28-54.934614755Z--  7a7686ad451d2865a2246e239b674aefd4c6c27c
  [x] 0x1BbA02873cC1C11f369a7B692F5F3dE8Ff7bbe80
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-09-05T20-26-34.695386684Z--  1bba02873cc1c11f369a7b692f5f3de8ff7bbe80
-------------------------------------------
Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
Approve? [y/N]:
> y
-------- List Account request--------------
A request has been made to list all accounts. 
You can select which accounts the caller can see
  [x] 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-22-11.261468773Z--  2db017e44b03b37755a4b15e14cd799f83de4c13
  [x] 0x7A7686aD451d2865A2246E239B674aeFd4c6c27c
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-28-54.934614755Z--  7a7686ad451d2865a2246e239b674aefd4c6c27c
  [x] 0x1BbA02873cC1C11f369a7B692F5F3dE8Ff7bbe80
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-09-05T20-26-34.695386684Z--  1bba02873cc1c11f369a7b692f5f3de8ff7bbe80
-------------------------------------------
Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
Approve? [y/N]:
> y

E mensagens na janela de execução do geth:

WARN [10-05|21:31:02.588] Served eth_estimateGas                   conn=127.0.0.1:39264 reqid=12 duration=1.742993ms  err="invalid opcode: PUSH0"

O que explica a mensagem recebida de opcode inválido. Está ocorrendo algum problema de versão entre compilador e conjunto de instruções suportado pela EVM da versão do cliente geth.

Procurando pelo erro “invalid opcode: PUSH0” encontramos uma possível solução no link.

With Solc version 0.8.20, the default EVM version is set to “Shanghai”. A new opcode, PUSHO, was added to the Ethereum Virtual Machine in the Shanghai upgrade. That means the PUSH0 opcode can now be part of the contract’s bytecode. If your private chain does not support it, it will error with the “Invalid opcode” error.

The solution is to manually set the EVM version to some previous version, for example, “Paris” (the version before, also known as The Merge), instead of “Shanghai”, which is the default now.

Dando a solução do que fazer em cada uma das ferramentas. A problema é o que suspeitávamos, erro de versões do código gerado pelo solc e o conjunto de instruções aceito pela EVM.

Como no material cita que a instrução PUSH0 foi adicionada na versão Shanghai da EVM, vamos voltar ao Ganache e configura o hardfork para esta versão.

A versão do Ganache que estávamos rodando é a v2.71 via AppImage

Vamos baixar o código da última release Versão 7.9.0

Instalando diretamente com npm install ganache --global a versão instalada é a \(7.9.1\), mas só tem o ganache e o ganache-cli. O ganache-ui está na versão \(2.7.1\).

10.11 Deploy na Rede do Ganache-cli

Iremos testar o deploy no ganache-cli.

[.etherprivate]$ ganache-cli --chain.chainId 1337 --chain.networkId 2525
ganache v7.9.1 (@ganache/cli: 0.10.1, @ganache/core: 0.10.1)
Starting RPC server

Available Accounts
==================
(0) 0x6bc36F77B80a3225F43482f7e9A79B2aB904D20A (1000 ETH)
(1) 0x63f31ad415907984768e0142349d4fa91f75DBFF (1000 ETH)
(2) 0x5112f12839b3dbaDbfA269c00D47B111399823C3 (1000 ETH)
(3) 0xD34E64e1250169421bc8f90Aa7A9878985A21cB2 (1000 ETH)
(4) 0xf670dc566884317174053fc0962dcfab93caa859 (1000 ETH)
(5) 0xB0eB5b5ff143DDa91C1Fc4E522704e78513490be (1000 ETH)
(6) 0xfC6BF2645BCB7E21033968b6aB78E22c1e67E4Bd (1000 ETH)
(7) 0xA06fdAf174893dc46641749D991bFB4b71C520b3 (1000 ETH)
(8) 0xb88cE5D42AD2685a705eeBda1f1D85750074121e (1000 ETH)
(9) 0x0d4b20f9d5aA4681F281A318BE33aab77a69B425 (1000 ETH)

Private Keys
==================
(0) 0x43dcd3a5c8b1fa55a5a76a28132b61673d7dbf2bcb45195cc5b46913a6b2596b
(1) 0x06b127b2b54722efa1d183f1aa01c676b9cc166ea38052a6cf17bd9d7ee39cf4
(2) 0x757a60ff9c9dcae6061343a0bf0f72d918e9f890292cc47a973e2bfafcae34aa
(3) 0x1e07f70327b14d261f804759bc7f483db764029e1331c0980ba78be50362794a
(4) 0xcbf4f614fd709800293b0f836d509cb2b719b8613658f295d6b7cdb1bda14995
(5) 0xc3c0018cb79be2f0cd523cdc419d3b1f62369e418fea811b7d388355b0bccbdc
(6) 0x0491bfb366bddf689d3d876a5e4391d9e94b7d1176134711d3f6ed2a315c9e00
(7) 0xc8c10efd89ec8d03e5c93ce5650dc69295c398337b1ea7b42fd3b46f01bd87cb
(8) 0xce68c07a81abaf5af757f30b45ff6acb506542ee089b42d6b485b0cc6247c0a0
(9) 0xff7a6a6f23271d47210aadcce3d077c6b64561f814373db03921f7727b02940e

HD Wallet
==================
Mnemonic:      crucial dwarf dilemma fit steak edge comfort submit post try across side
Base HD Path:  m/44'/60'/0'/0/{account_index}

Default Gas Price
==================
2000000000

BlockGas Limit
==================
30000000

Call Gas Limit
==================
50000000

Chain
==================
Hardfork: shanghai
Id:       1337

RPC Listening on 127.0.0.1:8545

Executando o teste com o ganache-cli:

[projeto-helloworld-truffle]$ truffle test --network ganachecli
Using network 'ganachecli'.


Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Artifacts written to /tmp/test--73819-Ro7Bq8RLYVl8
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


  Contract: Greeter
    [ok] has been deployed successfully
    greet()
      [ok] returns 'Hello, World!'
    Contract: Greeter: update greeting
      setGreeting(string)
        [ok] sets greeting to passed in string (92ms)
    Contract: owner()
      [ok] returns the address of the owner
      [ok] matches the address that originally deployed the contract
    Contract: Greeter: update greeting
      setGreeting(string)
        when message is sent by the owner
          [ok] sets greeting to passed in string (81ms)
      when message is sent by another account
        [ok] does not set the greeting (233ms)


  7 passing (663ms)

Fazendo o teste as mensagens aparecem no console onde o ganache-cli foi iniciado:

eth_blockNumber
net_version
eth_accounts
eth_blockNumber
net_version
eth_accounts
eth_getBlockByNumber
eth_accounts
net_version
eth_getBlockByNumber
eth_getBlockByNumber
net_version
eth_getBlockByNumber
eth_estimateGas
net_version
eth_blockNumber
eth_getBlockByNumber
eth_estimateGas
eth_getBlockByNumber
eth_gasPrice
eth_sendTransaction

  Transaction: 0xfcd75097bd69d1b540544e76e784b09e39f53d3b6725e1e4b3489609070cf967
  Contract created: 0x2b47db2070dc85d37b2a844b27b744408b3e50d9
  Gas usage: 736046
  Block number: 1
  Block time: Thu Oct 05 2023 22:55:03 GMT-0300 (Horário Padrão de Brasília)

eth_getTransactionReceipt
eth_getCode
evm_snapshot
Saved snapshot #1
net_version
eth_blockNumber
eth_getBlockByNumber
eth_blockNumber
eth_getBlockByNumber
eth_call
evm_revert
Reverting to snapshot #1
evm_snapshot
Saved snapshot #1
net_version
eth_blockNumber
eth_blockNumber
eth_getBlockByNumber
eth_getBlockByNumber
eth_estimateGas
eth_getBlockByNumber
eth_gasPrice
eth_sendTransaction

  Transaction: 0xb15f8de189ff3c6b0d54ce572bf7d174da34d4e7a3e204cbbae4792e3a8e056b
  Gas usage: 29923
  Block number: 2
  Block time: Thu Oct 05 2023 22:55:03 GMT-0300 (Horário Padrão de Brasília)

eth_getTransactionReceipt
eth_call
evm_revert
Reverting to snapshot #1
evm_snapshot
Saved snapshot #1
net_version
eth_blockNumber
eth_blockNumber
eth_getBlockByNumber
eth_call
eth_blockNumber
eth_blockNumber
eth_getBlockByNumber
eth_call
evm_revert
Reverting to snapshot #1
evm_snapshot
Saved snapshot #1
net_version
eth_blockNumber
eth_blockNumber
eth_getBlockByNumber
eth_getBlockByNumber
eth_estimateGas
eth_getBlockByNumber
eth_gasPrice
eth_sendTransaction

  Transaction: 0x7afb5696774c751f07940a294aa889340d80cd0e96affdbd69533f6ac3cb2342
  Gas usage: 30163
  Block number: 2
  Block time: Thu Oct 05 2023 22:55:03 GMT-0300 (Horário Padrão de Brasília)

eth_getTransactionReceipt
eth_call
eth_blockNumber
eth_blockNumber
eth_getBlockByNumber
eth_call
eth_getBlockByNumber
eth_estimateGas

Executando o deploy para o ganache-cli:

[projeto-helloworld-truffle]$ truffle migrate --network ganachecli

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Artifacts written to /run/media/rogerio/BK-RAG-HP1TB/repositorios/Dropbox/dados/rogerio/UTFPR/docencia/ disciplinas/2023/DLT-PPGCC17/2023-2/aulas/md/aula-12-pratica-ethereum-truffle/src/ projeto-helloworld-truffle/build/contracts
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


Starting migrations...
======================
> Network name:    'ganachecli'
> Network id:      2525
> Block gas limit: 30000000 (0x1c9c380)


2_deploy_greeter.js
===================

   Deploying 'Greeter'
   -------------------
   > transaction hash:    0x11f59962febf44604cbf85692bf7fbef8af82c10c60b41a33f224a1fc8f76b43
   > Blocks: 0            Seconds: 0
   > contract address:    0xd6a8e223C633cedD6770843824776ceee71017AF
   > block number:        3
   > block timestamp:     1696557622
   > account:             0x6bc36F77B80a3225F43482f7e9A79B2aB904D20A
   > balance:             999.995080374293542803
   > gas used:            736046 (0xb3b2e)
   > gas price:           3.174811798 gwei
   > value sent:          0 ETH
   > total cost:          0.002336807524670708 ETH

   > Saving artifacts
   -------------------------------------
   > Total cost:     0.002336807524670708 ETH

Summary
=======
> Total deployments:   1
> Final cost:          0.002336807524670708 ETH

No console do ganache-cli:

eth_blockNumber
net_version
eth_accounts
eth_getBlockByNumber
eth_accounts
net_version
eth_getBlockByNumber
eth_getBlockByNumber
net_version
eth_getBlockByNumber
eth_estimateGas
net_version
eth_blockNumber
eth_getBlockByNumber
eth_estimateGas
eth_getBlockByNumber
eth_gasPrice
eth_sendTransaction

  Transaction: 0x11f59962febf44604cbf85692bf7fbef8af82c10c60b41a33f224a1fc8f76b43
  Contract created: 0xd6a8e223c633cedd6770843824776ceee71017af
  Gas usage: 736046
  Block number: 3
  Block time: Thu Oct 05 2023 23:00:22 GMT-0300 (Horário Padrão de Brasília)

eth_getTransactionReceipt
eth_getCode
eth_getTransactionByHash
eth_getBlockByNumber
eth_getBalance

10.12 Interagindo com o contrato via truffle console

Interagindo com o contrato via truffle console, no link tem outros comandos:

[projeto-helloworld-truffle]$ truffle console --network ganachecli
truffle(ganachecli)> let accounts = await web3.eth.getAccounts()
undefined
truffle(ganachecli)> accounts
[
  '0x6bc36F77B80a3225F43482f7e9A79B2aB904D20A',
  '0x63f31ad415907984768e0142349d4fa91f75DBFF',
  '0x5112f12839b3dbaDbfA269c00D47B111399823C3',
  '0xD34E64e1250169421bc8f90Aa7A9878985A21cB2',
  '0xf670dc566884317174053fc0962dcfab93caa859',
  '0xB0eB5b5ff143DDa91C1Fc4E522704e78513490be',
  '0xfC6BF2645BCB7E21033968b6aB78E22c1e67E4Bd',
  '0xA06fdAf174893dc46641749D991bFB4b71C520b3',
  '0xb88cE5D42AD2685a705eeBda1f1D85750074121e',
  '0x0d4b20f9d5aA4681F281A318BE33aab77a69B425'
]
truffle(ganachecli)> 
truffle(ganachecli)> let newInstance = await Greeter.new()
undefined
truffle(ganachecli)> newInstance.address
'0x1B5834c58E81bb9c8E38607469f7753b7ED2642B'
truffle(ganachecli)> newInstance.greet.call()
'Hello, World!'
truffle(ganachecli)> 

A versão ganache e ganache-cli possibilitam vermos os resultados no console, mas vamos tentar gerar um App.image da versão atual.

#!/bin/bash

# Clone Ganache repository
git clone https://github.com/trufflesuite/ganache.git
cd ganache

# Install dependencies and build Ganache
npm install
npm run build

# Download appimagetool
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86 _64.AppImage
chmod +x appimagetool-x86_64.AppImage
sudo mv appimagetool-x86_64.AppImage /usr/local/bin/appimagetool

# Create an AppImage specification file
echo "app: Ganache" > ganache.appimage.yml
echo "arch: x86_64" >> ganache.appimage.yml

# Package Ganache into an AppImage
appimagetool ganache.appimage.yml out/

# Make the AppImage executable
chmod +x out/Ganache-*.AppImage

# Run Ganache AppImage
./out/Ganache-*.AppImage

No Manjaro não funcionou.

10.13 Alterando a versão da EVM alvo

Uma possibilidade é modificarmos as configurações para gerar para uma das redes suportadas no ganache-ui. A configuração que deixamos foi com hardfork Merge. Vamos alterar na guia chain para a London e alterar o compilador para gerar código para essa versão.

Alterando o hardfork para London

Alteramos no arquivo truffle-config.js as configurações do solc:

// Configure your compilers
  compilers: {
    solc: {
      version: "0.8.21",      // Fetch exact version from sol>
      // evmVersion: "shanghai"
      evmVersion: "london"
    }
  },

Executando o teste para o ganache-ui:

[projeto-helloworld-truffle]$ truffle test --network ganacheui
Using network 'ganacheui'.


Compiling your contracts...
===========================
> Compiling ./contracts/Greeter_orig.sol
> Compilation warnings encountered:

    Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
  -> project:/contracts/Greeter_orig.sol:8:5:
  |
  |     constructor() public {
  |     ^ (Relevant source part starts here and spans across multiple lines).


> Artifacts written to /tmp/test--12014-cC50k96x4sr6
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


  Contract: Greeter
    [ok] has been deployed successfully
    greet()
      [ok] returns 'Hello, World!'
    Contract: Greeter: update greeting
      setGreeting(string)
        [ok] sets greeting to passed in string (55ms)
    Contract: owner()
      [ok] returns the address of the owner
      [ok] matches the address that originally deployed the contract
    Contract: Greeter: update greeting
      setGreeting(string)
        when message is sent by the owner
          [ok] sets greeting to passed in string (48ms)
      when message is sent by another account
        [ok] does not set the greeting (186ms)


  7 passing (474ms)

Fazendo o deploy no ganache-ui:

[projeto-helloworld-truffle]$ truffle migrate --network ganacheui

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter.sol
> Artifacts written to /run/media/rogerio/BK-RAG-HP1TB/repositorios/Dropbox/dados/rogerio/UTFPR/docencia/ disciplinas/2023/DLT-PPGCC17/2023-2/aulas/md/aula-12-pratica-ethereum-truffle/src/ projeto-helloworld-truffle/build/contracts
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


Starting migrations...
======================
> Network name:    'ganacheui'
> Network id:      5777
> Block gas limit: 6721975 (0x6691b7)


2_deploy_greeter.js
===================

   Replacing 'Greeter'
   -------------------
   > transaction hash:    0xbb889e944c83deb0773923ec3292fedbb4f8efa0535a3d0f526730515918bf01
   > Blocks: 0            Seconds: 0
   > contract address:    0x49afd43086A509976C1E6FC91Ff117dAF5Ed798c
   > block number:        4
   > block timestamp:     1696942463
   > account:             0xc01046fecE893706d7d70b4493DFCe8b4aC04BB2
   > balance:             9999999999.994098588342868559
   > gas used:            750631 (0xb7427)
   > gas price:           3.113581798 gwei
   > value sent:          0 ETH
   > total cost:          0.002337151018614538 ETH

   > Saving artifacts
   -------------------------------------
   > Total cost:     0.002337151018614538 ETH

Summary
=======
> Total deployments:   1
> Final cost:          0.002337151018614538 ETH

Uma transação de Contract Creation será criada na lista de transações do ganache-ui.

Contract Creation

O contrato implantado aparece na guia Contratos.

Contrato Implantado

Bloco com o contrato

Detalhe do bloco

10.14 Continuando o Teste na Rede Privada Local

Voltando ao teste para o etherprivate:

[projeto-helloworld-truffle]$ truffle test --network etherprivate
Using network 'etherprivate'.


Compiling your contracts...
===========================
> Compiling ./contracts/Greeter_orig.sol
> Compilation warnings encountered:

    Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
 -> project:/contracts/Greeter_orig.sol:8:5:
  |
  |     constructor() public {
  |     ^ (Relevant source part starts here and spans across multiple lines).


> Artifacts written to /tmp/test--14663-auWPu58P4uaa
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


  Contract: Greeter
    [ok] has been deployed successfully
    greet()
      [ok] returns 'Hello, World!' (43ms)
    Contract: Greeter: update greeting
      setGreeting(string)
        [ok] sets greeting to passed in string (14285ms)
    Contract: owner()
      [ok] returns the address of the owner (39ms)
      [ok] matches the address that originally deployed the contract
    Contract: Greeter: update greeting
      setGreeting(string)
        when message is sent by the owner
          [ok] sets greeting to passed in string (7717ms)
      when message is sent by another account
        [ok] does not set the greeting (350ms)


  7 passing (1m)

Console do clef:

[projeto-helloworld-truffle]$ ~/go-ethereum/build/bin/clef --chainid 786 --keystore ~/.etherprivate/keystore --configdir ~/.etherprivate/clef --http

WARNING!

Clef is an account management tool. It may, like any software, contain bugs.

Please take care to
- backup your keystore files,
- verify that the keystore(s) can be opened with your password.

Clef is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.

Enter 'ok' to proceed:
> ok

INFO [10-10|10:07:59.037] Using CLI as UI-channel 
INFO [10-10|10:07:59.385] Loaded 4byte database                    embeds=268,621 locals=0 local=./4byte-custom.json
WARN [10-10|10:07:59.386] Failed to open master, rules disabled    err="failed stat on /home/rogerio/.etherprivate/clef/masterseed.json: stat /home/rogerio/.etherprivate/clef/masterseed.json: no such file or directory"
INFO [10-10|10:07:59.386] Starting signer                          chainid=786 keystore=/home/rogerio/.etherprivate/keystore light-kdf=false advanced=false
INFO [10-10|10:07:59.388] Smartcard socket file missing, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory"
INFO [10-10|10:07:59.389] Audit logs configured                    file=audit.log
INFO [10-10|10:07:59.391] HTTP endpoint opened                     url=http://127.0.0.1:8550/
INFO [10-10|10:07:59.391] IPC endpoint opened                      url=/home/rogerio/.etherprivate/clef/clef.ipc

------- Signer info -------
* extapi_version : 6.1.0
* extapi_http : http://127.0.0.1:8550/
* extapi_ipc : /home/rogerio/.etherprivate/clef/clef.ipc
* intapi_version : 7.0.1

------- Available accounts -------
0. 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13 at keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-22-11.261468773Z--  2db017e44b03b37755a4b15e14cd799f83de4c13
1. 0x7A7686aD451d2865A2246E239B674aeFd4c6c27c at keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-28-54.934614755Z--  7a7686ad451d2865a2246e239b674aefd4c6c27c
2. 0x1BbA02873cC1C11f369a7B692F5F3dE8Ff7bbe80 at keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-09-05T20-26-34.695386684Z--  1bba02873cc1c11f369a7b692f5f3de8ff7bbe80
-------- List Account request--------------
A request has been made to list all accounts. 
You can select which accounts the caller can see
  [x] 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-22-11.261468773Z-- 2db017e44b03b37755a4b15e14cd799f83de4c13
  [x] 0x7A7686aD451d2865A2246E239B674aeFd4c6c27c
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-28-54.934614755Z-- 7a7686ad451d2865a2246e239b674aefd4c6c27c
  [x] 0x1BbA02873cC1C11f369a7B692F5F3dE8Ff7bbe80
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-09-05T20-26-34.695386684Z-- 1bba02873cc1c11f369a7b692f5f3de8ff7bbe80
-------------------------------------------
Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
Approve? [y/N]:
> y
-------- List Account request--------------
A request has been made to list all accounts. 
You can select which accounts the caller can see
  [x] 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-22-11.261468773Z-- 2db017e44b03b37755a4b15e14cd799f83de4c13
  [x] 0x7A7686aD451d2865A2246E239B674aeFd4c6c27c
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-28-54.934614755Z-- 7a7686ad451d2865a2246e239b674aefd4c6c27c
  [x] 0x1BbA02873cC1C11f369a7B692F5F3dE8Ff7bbe80
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-09-05T20-26-34.695386684Z-- 1bba02873cc1c11f369a7b692f5f3de8ff7bbe80
-------------------------------------------
Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
Approve? [y/N]:
> y
-------- List Account request--------------
A request has been made to list all accounts. 
You can select which accounts the caller can see
  [x] 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-22-11.261468773Z-- 2db017e44b03b37755a4b15e14cd799f83de4c13
  [x] 0x7A7686aD451d2865A2246E239B674aeFd4c6c27c
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-28-54.934614755Z-- 7a7686ad451d2865a2246e239b674aefd4c6c27c
  [x] 0x1BbA02873cC1C11f369a7B692F5F3dE8Ff7bbe80
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-09-05T20-26-34.695386684Z-- 1bba02873cc1c11f369a7b692f5f3de8ff7bbe80
-------------------------------------------
Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
Approve? [y/N]:
> y
--------- Transaction request-------------
to:    <contact creation>
from:               0x2db017E44b03B37755A4b15e14Cd799f83DE4c13 [chksum ok]
value:              0 wei
gas:                0xa1325 (660261)
gasprice: 1000000000 wei
nonce:    0x11 (17)
chainid:  0x312
data:     0x60806040526040518060400160405280600d81526020017f48656c6c6f2c20576f726c6421000000000
00000000000000000000000000000815250600090816200004a91906200031a565b5034801562000058576000
80fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fff
fffffffffffffffffffffffffffffffffffff16021790555062000401565b600081519050919050565b7f4e48
7b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7
f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000
fd5b600060028204905060018216806200012257607f821691505b60208210810362000138576200013762000
0da565b5b50919050565b60008190508160005260206000209050919050565b60006020601f83010490509190
50565b600082821b905092915050565b600060088302620001a27ffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffff8262000163565b620001ae868362000163565b9550801984169350808616
8417925050509392505050565b6000819050919050565b6000819050919050565b6000620001fb620001f5620
001ef84620001c6565b620001d0565b620001c6565b9050919050565b6000819050919050565b620002178362
0001da565b6200022f620002268262000202565b84845462000170565b825550505050565b600090565b62000
24662000237565b620002538184846200020c565b505050565b5b818110156200027b576200026f6000826200
023c565b60018101905062000259565b5050565b601f821115620002ca5762000294816200013e565b6200029
f8462000153565b81016020851015620002af578190505b620002c7620002be8562000153565b830182620002
58565b50505b505050565b600082821c905092915050565b6000620002ef60001984600802620002cf565b198
0831691505092915050565b60006200030a8383620002dc565b9150826002028217905092915050565b620003
2582620000a0565b67ffffffffffffffff811115620003415762000340620000ab565b5b6200034d825462000
109565b6200035a8282856200027f565b600060209050601f8311600181146200039257600084156200037d57
8287015190505b620003898582620002fc565b865550620003f9565b601f198416620003a2866200013e565b6
0005b82811015620003cc57848901518255600182019150602085019450602081019050620003a5565b868310
15620003ec5784890151620003e8601f891682620002dc565b8355505b6001600288020188555050505b50505
0505050565b61078c80620004116000396000f3fe608060405234801561001057600080fd5b50600436106100
415760003560e01c80638da5cb5b14610046578063a413686214610064578063cfae321714610080575b60008
0fd5b61004e61009e565b60405161005b9190610241565b60405180910390f35b61007e600480360381019061
007991906102cb565b6100c8565b005b61008861016e565b60405161009591906103a8565b60405180910390f
35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60
0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffff
fffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610158576040517f08
c379a000000000000000000000000000000000000000000000000000000000815260040161014f90610416565
b60405180910390fd5b818160009182610169929190610686565b505050565b60606000805461017d9061049f
565b80601f01602080910402602001604051908101604052809291908181526020018280546101a99061049f5
65b80156101f65780601f106101cb576101008083540402835291602001916101f6565b820191906000526020
600020905b8154815290600101906020018083116101d957829003601f168201915b5050505050905090565b6
00073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061022b82610200565b9050
919050565b61023b81610220565b82525050565b60006020820190506102566000830184610232565b9291505
0565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f84011261028b5761028a61
0266565b5b8235905067ffffffffffffffff8111156102a8576102a761026b565b5b602083019150836001820
2830111156102c4576102c3610270565b5b9250929050565b600080602083850312156102e2576102e161025c
565b5b600083013567ffffffffffffffff811115610300576102ff610261565b5b61030c85828601610275565
b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83
811015610352578082015181840152602081019050610337565b60008484015250505050565b6000601f19601
f8301169050919050565b600061037a82610318565b6103848185610323565b93506103948185602086016103
34565b61039d8161035e565b840191505092915050565b600060208201905081810360008301526103c281846
1036f565b905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65
72600082015250565b6000610400602083610323565b915061040b826103ca565b602082019050919050565b6
000602082019050818103600083015261042f816103f3565b9050919050565b600082905092915050565b7f4e
487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5
b7f4e487b71000000000000000000000000000000000000000000000000000000006000526022600452602460
00fd5b600060028204905060018216806104b757607f821691505b6020821081036104ca576104c9610470565
b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b
600082821b905092915050565b6000600883026105327ffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffff826104f5565b61053c86836104f5565b955080198416935080861684179250505093
92505050565b6000819050919050565b6000819050919050565b600061058361057e61057984610554565b610
55e565b610554565b9050919050565b6000819050919050565b61059d83610568565b6105b16105a98261058a
565b848454610502565b825550505050565b600090565b6105c66105b9565b6105d1818484610594565b50505
0565b5b818110156105f5576105ea6000826105be565b6001810190506105d7565b5050565b601f8211156106
3a5761060b816104d0565b610614846104e5565b81016020851015610623578190505b61063761062f856104e
5565b8301826105d6565b50505b505050565b600082821c905092915050565b600061065d6000198460080261
063f565b1980831691505092915050565b6000610676838361064c565b9150826002028217905092915050565
b6106908383610436565b67ffffffffffffffff8111156106a9576106a8610441565b5b6106b3825461049f56
5b6106be8282856105f9565b6000601f8311600181146106ed57600084156106db578287013590505b6106e58
58261066a565b86555061074d565b601f1984166106fb866104d0565b60005b82811015610723578489013582
556001820191506020850194506020810190506106fe565b86831015610740578489013561073c601f8916826
1064c565b8355505b6001600288020188555050505b5050505050505056fea264697066735822122060c20316
e7c477c2ca67fd1e46e616c49b5bad17c117d45957f64ac13c222fc164736f6c63430008150033

Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
-------------------------------------------
Approve? [y/N]:
> y
\#\# Account password

Please enter the password for account 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
> 
-----------------------
Transaction signed:
 {
    "type": "0x0",
    "nonce": "0x11",
    "gasPrice": "0x3b9aca00",
    "maxPriorityFeePerGas": null,
    "maxFeePerGas": null,
    "gas": "0xa1325",
    "value": "0x0",
    "input": "0x60806040526040518060400160405280600d81526020017f48656c6c6f2c20576f726c6421000000000
00000000000000000000000000000815250600090816200004a91906200031a565b5034801562000058576000
80fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fff
fffffffffffffffffffffffffffffffffffff16021790555062000401565b600081519050919050565b7f4e48
7b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7
f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000
fd5b600060028204905060018216806200012257607f821691505b60208210810362000138576200013762000
0da565b5b50919050565b60008190508160005260206000209050919050565b60006020601f83010490509190
50565b600082821b905092915050565b600060088302620001a27ffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffff8262000163565b620001ae868362000163565b9550801984169350808616
8417925050509392505050565b6000819050919050565b6000819050919050565b6000620001fb620001f5620
001ef84620001c6565b620001d0565b620001c6565b9050919050565b6000819050919050565b620002178362
0001da565b6200022f620002268262000202565b84845462000170565b825550505050565b600090565b62000
24662000237565b620002538184846200020c565b505050565b5b818110156200027b576200026f6000826200
023c565b60018101905062000259565b5050565b601f821115620002ca5762000294816200013e565b6200029
f8462000153565b81016020851015620002af578190505b620002c7620002be8562000153565b830182620002
58565b50505b505050565b600082821c905092915050565b6000620002ef60001984600802620002cf565b198
0831691505092915050565b60006200030a8383620002dc565b9150826002028217905092915050565b620003
2582620000a0565b67ffffffffffffffff811115620003415762000340620000ab565b5b6200034d825462000
109565b6200035a8282856200027f565b600060209050601f8311600181146200039257600084156200037d57
8287015190505b620003898582620002fc565b865550620003f9565b601f198416620003a2866200013e565b6
0005b82811015620003cc57848901518255600182019150602085019450602081019050620003a5565b868310
15620003ec5784890151620003e8601f891682620002dc565b8355505b6001600288020188555050505b50505
0505050565b61078c80620004116000396000f3fe608060405234801561001057600080fd5b50600436106100
415760003560e01c80638da5cb5b14610046578063a413686214610064578063cfae321714610080575b60008
0fd5b61004e61009e565b60405161005b9190610241565b60405180910390f35b61007e600480360381019061
007991906102cb565b6100c8565b005b61008861016e565b60405161009591906103a8565b60405180910390f
35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60
0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffff
fffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610158576040517f08
c379a000000000000000000000000000000000000000000000000000000000815260040161014f90610416565
b60405180910390fd5b818160009182610169929190610686565b505050565b60606000805461017d9061049f
565b80601f01602080910402602001604051908101604052809291908181526020018280546101a99061049f5
65b80156101f65780601f106101cb576101008083540402835291602001916101f6565b820191906000526020
600020905b8154815290600101906020018083116101d957829003601f168201915b5050505050905090565b6
00073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061022b82610200565b9050
919050565b61023b81610220565b82525050565b60006020820190506102566000830184610232565b9291505
0565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f84011261028b5761028a61
0266565b5b8235905067ffffffffffffffff8111156102a8576102a761026b565b5b602083019150836001820
2830111156102c4576102c3610270565b5b9250929050565b600080602083850312156102e2576102e161025c
565b5b600083013567ffffffffffffffff811115610300576102ff610261565b5b61030c85828601610275565
b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83
811015610352578082015181840152602081019050610337565b60008484015250505050565b6000601f19601
f8301169050919050565b600061037a82610318565b6103848185610323565b93506103948185602086016103
34565b61039d8161035e565b840191505092915050565b600060208201905081810360008301526103c281846
1036f565b905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65
72600082015250565b6000610400602083610323565b915061040b826103ca565b602082019050919050565b6
000602082019050818103600083015261042f816103f3565b9050919050565b600082905092915050565b7f4e
487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5
b7f4e487b71000000000000000000000000000000000000000000000000000000006000526022600452602460
00fd5b600060028204905060018216806104b757607f821691505b6020821081036104ca576104c9610470565
b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b
600082821b905092915050565b6000600883026105327ffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffff826104f5565b61053c86836104f5565b955080198416935080861684179250505093
92505050565b6000819050919050565b6000819050919050565b600061058361057e61057984610554565b610
55e565b610554565b9050919050565b6000819050919050565b61059d83610568565b6105b16105a98261058a
565b848454610502565b825550505050565b600090565b6105c66105b9565b6105d1818484610594565b50505
0565b5b818110156105f5576105ea6000826105be565b6001810190506105d7565b5050565b601f8211156106
3a5761060b816104d0565b610614846104e5565b81016020851015610623578190505b61063761062f856104e
5565b8301826105d6565b50505b505050565b600082821c905092915050565b600061065d6000198460080261
063f565b1980831691505092915050565b6000610676838361064c565b9150826002028217905092915050565
b6106908383610436565b67ffffffffffffffff8111156106a9576106a8610441565b5b6106b3825461049f56
5b6106be8282856105f9565b6000601f8311600181146106ed57600084156106db578287013590505b6106e58
58261066a565b86555061074d565b601f1984166106fb866104d0565b60005b82811015610723578489013582
556001820191506020850194506020810190506106fe565b86831015610740578489013561073c601f8916826
1064c565b8355505b6001600288020188555050505b5050505050505056fea264697066735822122060c20316
e7c477c2ca67fd1e46e616c49b5bad17c117d45957f64ac13c222fc164736f6c63430008150033",
    "v": "0x648",
    "r": "0x1d8b46e2ca3d112ccc27f26de2b1747f90e3c30b58be72e2e14348bfa6881932",
    "s": "0x1efeafaf810450ccd03fed68f4d1da2caca6a4e9d3b8d06cf678f8c7ffd38c9d",
    "to": null,
    "hash": "0xe15b0e773f71256345ef5089bd6ba5c190386d7162dcebcf4d25dcc3ab37ec63"
  }

-------------------------------------------
Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
Approve? [y/N]:
> y
--------- Transaction request-------------
to:    <contact creation>
from:               0x2db017E44b03B37755A4b15e14Cd799f83DE4c13 [chksum ok]
value:              0 wei
gas:                0xa1325 (660261)
gasprice: 1000000000 wei
nonce:    0x16 (22)
chainid:  0x312
data:     0x60806040526040518060400160405280600d81526020017f48656c6c6f2c20576f726c6421000000000
00000000000000000000000000000815250600090816200004a91906200031a565b5034801562000058576000
80fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fff
fffffffffffffffffffffffffffffffffffff16021790555062000401565b600081519050919050565b7f4e48
7b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7
f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000
fd5b600060028204905060018216806200012257607f821691505b60208210810362000138576200013762000
0da565b5b50919050565b60008190508160005260206000209050919050565b60006020601f83010490509190
50565b600082821b905092915050565b600060088302620001a27ffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffff8262000163565b620001ae868362000163565b9550801984169350808616
8417925050509392505050565b6000819050919050565b6000819050919050565b6000620001fb620001f5620
001ef84620001c6565b620001d0565b620001c6565b9050919050565b6000819050919050565b620002178362
0001da565b6200022f620002268262000202565b84845462000170565b825550505050565b600090565b62000
24662000237565b620002538184846200020c565b505050565b5b818110156200027b576200026f6000826200
023c565b60018101905062000259565b5050565b601f821115620002ca5762000294816200013e565b6200029
f8462000153565b81016020851015620002af578190505b620002c7620002be8562000153565b830182620002
58565b50505b505050565b600082821c905092915050565b6000620002ef60001984600802620002cf565b198
0831691505092915050565b60006200030a8383620002dc565b9150826002028217905092915050565b620003
2582620000a0565b67ffffffffffffffff811115620003415762000340620000ab565b5b6200034d825462000
109565b6200035a8282856200027f565b600060209050601f8311600181146200039257600084156200037d57
8287015190505b620003898582620002fc565b865550620003f9565b601f198416620003a2866200013e565b6
0005b82811015620003cc57848901518255600182019150602085019450602081019050620003a5565b868310
15620003ec5784890151620003e8601f891682620002dc565b8355505b6001600288020188555050505b50505
0505050565b61078c80620004116000396000f3fe608060405234801561001057600080fd5b50600436106100
415760003560e01c80638da5cb5b14610046578063a413686214610064578063cfae321714610080575b60008
0fd5b61004e61009e565b60405161005b9190610241565b60405180910390f35b61007e600480360381019061
007991906102cb565b6100c8565b005b61008861016e565b60405161009591906103a8565b60405180910390f
35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60
0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffff
fffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610158576040517f08
c379a000000000000000000000000000000000000000000000000000000000815260040161014f90610416565
b60405180910390fd5b818160009182610169929190610686565b505050565b60606000805461017d9061049f
565b80601f01602080910402602001604051908101604052809291908181526020018280546101a99061049f5
65b80156101f65780601f106101cb576101008083540402835291602001916101f6565b820191906000526020
600020905b8154815290600101906020018083116101d957829003601f168201915b5050505050905090565b6
00073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061022b82610200565b9050
919050565b61023b81610220565b82525050565b60006020820190506102566000830184610232565b9291505
0565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f84011261028b5761028a61
0266565b5b8235905067ffffffffffffffff8111156102a8576102a761026b565b5b602083019150836001820
2830111156102c4576102c3610270565b5b9250929050565b600080602083850312156102e2576102e161025c
565b5b600083013567ffffffffffffffff811115610300576102ff610261565b5b61030c85828601610275565
b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83
811015610352578082015181840152602081019050610337565b60008484015250505050565b6000601f19601
f8301169050919050565b600061037a82610318565b6103848185610323565b93506103948185602086016103
34565b61039d8161035e565b840191505092915050565b600060208201905081810360008301526103c281846
1036f565b905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65
72600082015250565b6000610400602083610323565b915061040b826103ca565b602082019050919050565b6
000602082019050818103600083015261042f816103f3565b9050919050565b600082905092915050565b7f4e
487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5
b7f4e487b71000000000000000000000000000000000000000000000000000000006000526022600452602460
00fd5b600060028204905060018216806104b757607f821691505b6020821081036104ca576104c9610470565
b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b
600082821b905092915050565b6000600883026105327ffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffff826104f5565b61053c86836104f5565b955080198416935080861684179250505093
92505050565b6000819050919050565b6000819050919050565b600061058361057e61057984610554565b610
55e565b610554565b9050919050565b6000819050919050565b61059d83610568565b6105b16105a98261058a
565b848454610502565b825550505050565b600090565b6105c66105b9565b6105d1818484610594565b50505
0565b5b818110156105f5576105ea6000826105be565b6001810190506105d7565b5050565b601f8211156106
3a5761060b816104d0565b610614846104e5565b81016020851015610623578190505b61063761062f856104e
5565b8301826105d6565b50505b505050565b600082821c905092915050565b600061065d6000198460080261
063f565b1980831691505092915050565b6000610676838361064c565b9150826002028217905092915050565
b6106908383610436565b67ffffffffffffffff8111156106a9576106a8610441565b5b6106b3825461049f56
5b6106be8282856105f9565b6000601f8311600181146106ed57600084156106db578287013590505b6106e58
58261066a565b86555061074d565b601f1984166106fb866104d0565b60005b82811015610723578489013582
556001820191506020850194506020810190506106fe565b86831015610740578489013561073c601f8916826
1064c565b8355505b6001600288020188555050505b5050505050505056fea264697066735822122060c20316
e7c477c2ca67fd1e46e616c49b5bad17c117d45957f64ac13c222fc164736f6c63430008150033

Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
-------------------------------------------
Approve? [y/N]:
> y
\#\# Account password

Please enter the password for account 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
0x60806040526040518060400160405280600d81526020017f48656c6c6f2c20576f726c64210000000000000
> 
-----------------------
Transaction signed:
 {
    "type": "0x0",
    "nonce": "0x16",
    "gasPrice": "0x3b9aca00",
    "maxPriorityFeePerGas": null,
    "maxFeePerGas": null,
    "gas": "0xa1325",
    "value": "0x0",
    "input": "0x60806040526040518060400160405280600d81526020017f48656c6c6f2c20576f726c6421000000000
00000000000000000000000000000815250600090816200004a91906200031a565b5034801562000058576000
80fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fff
fffffffffffffffffffffffffffffffffffff16021790555062000401565b600081519050919050565b7f4e48
7b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7
f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000
fd5b600060028204905060018216806200012257607f821691505b60208210810362000138576200013762000
0da565b5b50919050565b60008190508160005260206000209050919050565b60006020601f83010490509190
50565b600082821b905092915050565b600060088302620001a27ffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffff8262000163565b620001ae868362000163565b9550801984169350808616
8417925050509392505050565b6000819050919050565b6000819050919050565b6000620001fb620001f5620
001ef84620001c6565b620001d0565b620001c6565b9050919050565b6000819050919050565b620002178362
0001da565b6200022f620002268262000202565b84845462000170565b825550505050565b600090565b62000
24662000237565b620002538184846200020c565b505050565b5b818110156200027b576200026f6000826200
023c565b60018101905062000259565b5050565b601f821115620002ca5762000294816200013e565b6200029
f8462000153565b81016020851015620002af578190505b620002c7620002be8562000153565b830182620002
58565b50505b505050565b600082821c905092915050565b6000620002ef60001984600802620002cf565b198
0831691505092915050565b60006200030a8383620002dc565b9150826002028217905092915050565b620003
2582620000a0565b67ffffffffffffffff811115620003415762000340620000ab565b5b6200034d825462000
109565b6200035a8282856200027f565b600060209050601f8311600181146200039257600084156200037d57
8287015190505b620003898582620002fc565b865550620003f9565b601f198416620003a2866200013e565b6
0005b82811015620003cc57848901518255600182019150602085019450602081019050620003a5565b868310
15620003ec5784890151620003e8601f891682620002dc565b8355505b6001600288020188555050505b50505
0505050565b61078c80620004116000396000f3fe608060405234801561001057600080fd5b50600436106100
415760003560e01c80638da5cb5b14610046578063a413686214610064578063cfae321714610080575b60008
0fd5b61004e61009e565b60405161005b9190610241565b60405180910390f35b61007e600480360381019061
007991906102cb565b6100c8565b005b61008861016e565b60405161009591906103a8565b60405180910390f
35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60
0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffff
fffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610158576040517f08
c379a000000000000000000000000000000000000000000000000000000000815260040161014f90610416565
b60405180910390fd5b818160009182610169929190610686565b505050565b60606000805461017d9061049f
565b80601f01602080910402602001604051908101604052809291908181526020018280546101a99061049f5
65b80156101f65780601f106101cb576101008083540402835291602001916101f6565b820191906000526020
600020905b8154815290600101906020018083116101d957829003601f168201915b5050505050905090565b6
00073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061022b82610200565b9050
919050565b61023b81610220565b82525050565b60006020820190506102566000830184610232565b9291505
0565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f84011261028b5761028a61
0266565b5b8235905067ffffffffffffffff8111156102a8576102a761026b565b5b602083019150836001820
2830111156102c4576102c3610270565b5b9250929050565b600080602083850312156102e2576102e161025c
565b5b600083013567ffffffffffffffff811115610300576102ff610261565b5b61030c85828601610275565
b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83
811015610352578082015181840152602081019050610337565b60008484015250505050565b6000601f19601
f8301169050919050565b600061037a82610318565b6103848185610323565b93506103948185602086016103
34565b61039d8161035e565b840191505092915050565b600060208201905081810360008301526103c281846
1036f565b905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65
72600082015250565b6000610400602083610323565b915061040b826103ca565b602082019050919050565b6
000602082019050818103600083015261042f816103f3565b9050919050565b600082905092915050565b7f4e
487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5
b7f4e487b71000000000000000000000000000000000000000000000000000000006000526022600452602460
00fd5b600060028204905060018216806104b757607f821691505b6020821081036104ca576104c9610470565
b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b
600082821b905092915050565b6000600883026105327ffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffff826104f5565b61053c86836104f5565b955080198416935080861684179250505093
92505050565b6000819050919050565b6000819050919050565b600061058361057e61057984610554565b610
55e565b610554565b9050919050565b6000819050919050565b61059d83610568565b6105b16105a98261058a
565b848454610502565b825550505050565b600090565b6105c66105b9565b6105d1818484610594565b50505
0565b5b818110156105f5576105ea6000826105be565b6001810190506105d7565b5050565b601f8211156106
3a5761060b816104d0565b610614846104e5565b81016020851015610623578190505b61063761062f856104e
5565b8301826105d6565b50505b505050565b600082821c905092915050565b600061065d6000198460080261
063f565b1980831691505092915050565b6000610676838361064c565b9150826002028217905092915050565
b6106908383610436565b67ffffffffffffffff8111156106a9576106a8610441565b5b6106b3825461049f56
5b6106be8282856105f9565b6000601f8311600181146106ed57600084156106db578287013590505b6106e58
58261066a565b86555061074d565b601f1984166106fb866104d0565b60005b82811015610723578489013582
556001820191506020850194506020810190506106fe565b86831015610740578489013561073c601f8916826
1064c565b8355505b6001600288020188555050505b5050505050505056fea264697066735822122060c20316
e7c477c2ca67fd1e46e616c49b5bad17c117d45957f64ac13c222fc164736f6c63430008150033",
    "v": "0x648",
    "r": "0x7f09fefc66f7d72a4cdc2c5f761593b02045c31761d6308741fc46995b6c902f",
    "s": "0x3c46612de1d23a03c93026bbd7a0268c647a0ccdcdd82b7682576ab31692a034",
    "to": null,
    "hash": "0xa673d409198d99be0211fae2c485131f95a2cca4c32a1aa5faa2a8d667b4468d"
  }
--------- Transaction request-------------
to:    0x8219Ce50e267332B8E439256A94fa85CFF271d8E
from:               0x2db017E44b03B37755A4b15e14Cd799f83DE4c13 [chksum ok]
value:              0 wei
gas:                0x91bb (37307)
gasprice: 1000000000 wei
nonce:    0x17 (23)
chainid:  0x312
data:     0xa4136862000000000000000000000000000000000000000000000000000000000000002000000000000
00000000000000000000000000000000000000000000000000009486920746865726521000000000000000000
0000000000000000000000000000

Transaction validation:
  * Info : Transaction invokes the following method: "setGreeting(string: Hi there!)"


Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
-------------------------------------------
Approve? [y/N]:
> y
\#\# Account password

Please enter the password for account 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
> 
-----------------------
Transaction signed:
 {
    "type": "0x0",
    "nonce": "0x17",
    "gasPrice": "0x3b9aca00",
    "maxPriorityFeePerGas": null,
    "maxFeePerGas": null,
    "gas": "0x91bb",
    "value": "0x0",
    "input": "0xa413686200000000000000000000000000000000000000000000000000000000000000200000000
    00000000000000000000000000000000000000000000000000000000948692074686572652100000000000
    00000000000000000000000000000000000",
    "v": "0x648",
    "r": "0x6a344313024d4d37eb07c6a12b39947624d09d786e7e8722e34f326e603286c7",
    "s": "0x4c3fe99a3327ba7072104fefc9ce5939c3abf21d3e0de8a18121c4a54c491db6",
    "to": "0x8219ce50e267332b8e439256a94fa85cff271d8e",
    "hash": "0x22bbd2b8ff81b75b30323022c18ac0a6f8ae26cb0343708554c8564a4998e10e"
  }
-------- List Account request--------------
A request has been made to list all accounts. 
You can select which accounts the caller can see
  [x] 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-22-11.261468773Z-- 2db017e44b03b37755a4b15e14cd799f83de4c13
  [x] 0x7A7686aD451d2865A2246E239B674aeFd4c6c27c
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-28-54.934614755Z-- 7a7686ad451d2865a2246e239b674aefd4c6c27c
  [x] 0x1BbA02873cC1C11f369a7B692F5F3dE8Ff7bbe80
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-09-05T20-26-34.695386684Z-- 1bba02873cc1c11f369a7b692f5f3de8ff7bbe80
-------------------------------------------
Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
Approve? [y/N]:
> y
--------- Transaction request-------------
to:    <contact creation>
from:               0x2db017E44b03B37755A4b15e14Cd799f83DE4c13 [chksum ok]
value:              0 wei
gas:                0xa1325 (660261)
gasprice: 1000000000 wei
nonce:    0x18 (24)
chainid:  0x312
data:     0x60806040526040518060400160405280600d81526020017f48656c6c6f2c20576f726c6421000000000
00000000000000000000000000000815250600090816200004a91906200031a565b5034801562000058576000
80fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fff
fffffffffffffffffffffffffffffffffffff16021790555062000401565b600081519050919050565b7f4e48
7b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7
f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000
fd5b600060028204905060018216806200012257607f821691505b60208210810362000138576200013762000
0da565b5b50919050565b60008190508160005260206000209050919050565b60006020601f83010490509190
50565b600082821b905092915050565b600060088302620001a27ffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffff8262000163565b620001ae868362000163565b9550801984169350808616
8417925050509392505050565b6000819050919050565b6000819050919050565b6000620001fb620001f5620
001ef84620001c6565b620001d0565b620001c6565b9050919050565b6000819050919050565b620002178362
0001da565b6200022f620002268262000202565b84845462000170565b825550505050565b600090565b62000
24662000237565b620002538184846200020c565b505050565b5b818110156200027b576200026f6000826200
023c565b60018101905062000259565b5050565b601f821115620002ca5762000294816200013e565b6200029
f8462000153565b81016020851015620002af578190505b620002c7620002be8562000153565b830182620002
58565b50505b505050565b600082821c905092915050565b6000620002ef60001984600802620002cf565b198
0831691505092915050565b60006200030a8383620002dc565b9150826002028217905092915050565b620003
2582620000a0565b67ffffffffffffffff811115620003415762000340620000ab565b5b6200034d825462000
109565b6200035a8282856200027f565b600060209050601f8311600181146200039257600084156200037d57
8287015190505b620003898582620002fc565b865550620003f9565b601f198416620003a2866200013e565b6
0005b82811015620003cc57848901518255600182019150602085019450602081019050620003a5565b868310
15620003ec5784890151620003e8601f891682620002dc565b8355505b6001600288020188555050505b50505
0505050565b61078c80620004116000396000f3fe608060405234801561001057600080fd5b50600436106100
415760003560e01c80638da5cb5b14610046578063a413686214610064578063cfae321714610080575b60008
0fd5b61004e61009e565b60405161005b9190610241565b60405180910390f35b61007e600480360381019061
007991906102cb565b6100c8565b005b61008861016e565b60405161009591906103a8565b60405180910390f
35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60
0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffff
fffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610158576040517f08
c379a000000000000000000000000000000000000000000000000000000000815260040161014f90610416565
b60405180910390fd5b818160009182610169929190610686565b505050565b60606000805461017d9061049f
565b80601f01602080910402602001604051908101604052809291908181526020018280546101a99061049f5
65b80156101f65780601f106101cb576101008083540402835291602001916101f6565b820191906000526020
600020905b8154815290600101906020018083116101d957829003601f168201915b5050505050905090565b6
00073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061022b82610200565b9050
919050565b61023b81610220565b82525050565b60006020820190506102566000830184610232565b9291505
0565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f84011261028b5761028a61
0266565b5b8235905067ffffffffffffffff8111156102a8576102a761026b565b5b602083019150836001820
2830111156102c4576102c3610270565b5b9250929050565b600080602083850312156102e2576102e161025c
565b5b600083013567ffffffffffffffff811115610300576102ff610261565b5b61030c85828601610275565
b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83
811015610352578082015181840152602081019050610337565b60008484015250505050565b6000601f19601
f8301169050919050565b600061037a82610318565b6103848185610323565b93506103948185602086016103
34565b61039d8161035e565b840191505092915050565b600060208201905081810360008301526103c281846
1036f565b905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65
72600082015250565b6000610400602083610323565b915061040b826103ca565b602082019050919050565b6
000602082019050818103600083015261042f816103f3565b9050919050565b600082905092915050565b7f4e
487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5
b7f4e487b71000000000000000000000000000000000000000000000000000000006000526022600452602460
00fd5b600060028204905060018216806104b757607f821691505b6020821081036104ca576104c9610470565
b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b
600082821b905092915050565b6000600883026105327ffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffff826104f5565b61053c86836104f5565b955080198416935080861684179250505093
92505050565b6000819050919050565b6000819050919050565b600061058361057e61057984610554565b610
55e565b610554565b9050919050565b6000819050919050565b61059d83610568565b6105b16105a98261058a
565b848454610502565b825550505050565b600090565b6105c66105b9565b6105d1818484610594565b50505
0565b5b818110156105f5576105ea6000826105be565b6001810190506105d7565b5050565b601f8211156106
3a5761060b816104d0565b610614846104e5565b81016020851015610623578190505b61063761062f856104e
5565b8301826105d6565b50505b505050565b600082821c905092915050565b600061065d6000198460080261
063f565b1980831691505092915050565b6000610676838361064c565b9150826002028217905092915050565
b6106908383610436565b67ffffffffffffffff8111156106a9576106a8610441565b5b6106b3825461049f56
5b6106be8282856105f9565b6000601f8311600181146106ed57600084156106db578287013590505b6106e58
58261066a565b86555061074d565b601f1984166106fb866104d0565b60005b82811015610723578489013582
556001820191506020850194506020810190506106fe565b86831015610740578489013561073c601f8916826
1064c565b8355505b6001600288020188555050505b5050505050505056fea264697066735822122060c20316
e7c477c2ca67fd1e46e616c49b5bad17c117d45957f64ac13c222fc164736f6c63430008150033

Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
-------------------------------------------
Approve? [y/N]:
> y
\#\# Account password

Please enter the password for account 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
> 
-----------------------
Transaction signed:
 {
    "type": "0x0",
    "nonce": "0x18",
    "gasPrice": "0x3b9aca00",
    "maxPriorityFeePerGas": null,
    "maxFeePerGas": null,
    "gas": "0xa1325",
    "value": "0x0",
    "input": "0x60806040526040518060400160405280600d81526020017f48656c6c6f2c20576f726c6421000000000
00000000000000000000000000000815250600090816200004a91906200031a565b5034801562000058576000
80fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fff
fffffffffffffffffffffffffffffffffffff16021790555062000401565b600081519050919050565b7f4e48
7b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7
f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000
fd5b600060028204905060018216806200012257607f821691505b60208210810362000138576200013762000
0da565b5b50919050565b60008190508160005260206000209050919050565b60006020601f83010490509190
50565b600082821b905092915050565b600060088302620001a27ffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffff8262000163565b620001ae868362000163565b9550801984169350808616
8417925050509392505050565b6000819050919050565b6000819050919050565b6000620001fb620001f5620
001ef84620001c6565b620001d0565b620001c6565b9050919050565b6000819050919050565b620002178362
0001da565b6200022f620002268262000202565b84845462000170565b825550505050565b600090565b62000
24662000237565b620002538184846200020c565b505050565b5b818110156200027b576200026f6000826200
023c565b60018101905062000259565b5050565b601f821115620002ca5762000294816200013e565b6200029
f8462000153565b81016020851015620002af578190505b620002c7620002be8562000153565b830182620002
58565b50505b505050565b600082821c905092915050565b6000620002ef60001984600802620002cf565b198
0831691505092915050565b60006200030a8383620002dc565b9150826002028217905092915050565b620003
2582620000a0565b67ffffffffffffffff811115620003415762000340620000ab565b5b6200034d825462000
109565b6200035a8282856200027f565b600060209050601f8311600181146200039257600084156200037d57
8287015190505b620003898582620002fc565b865550620003f9565b601f198416620003a2866200013e565b6
0005b82811015620003cc57848901518255600182019150602085019450602081019050620003a5565b868310
15620003ec5784890151620003e8601f891682620002dc565b8355505b6001600288020188555050505b50505
0505050565b61078c80620004116000396000f3fe608060405234801561001057600080fd5b50600436106100
415760003560e01c80638da5cb5b14610046578063a413686214610064578063cfae321714610080575b60008
0fd5b61004e61009e565b60405161005b9190610241565b60405180910390f35b61007e600480360381019061
007991906102cb565b6100c8565b005b61008861016e565b60405161009591906103a8565b60405180910390f
35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60
0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffff
fffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610158576040517f08
c379a000000000000000000000000000000000000000000000000000000000815260040161014f90610416565
b60405180910390fd5b818160009182610169929190610686565b505050565b60606000805461017d9061049f
565b80601f01602080910402602001604051908101604052809291908181526020018280546101a99061049f5
65b80156101f65780601f106101cb576101008083540402835291602001916101f6565b820191906000526020
600020905b8154815290600101906020018083116101d957829003601f168201915b5050505050905090565b6
00073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061022b82610200565b9050
919050565b61023b81610220565b82525050565b60006020820190506102566000830184610232565b9291505
0565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f84011261028b5761028a61
0266565b5b8235905067ffffffffffffffff8111156102a8576102a761026b565b5b602083019150836001820
2830111156102c4576102c3610270565b5b9250929050565b600080602083850312156102e2576102e161025c
565b5b600083013567ffffffffffffffff811115610300576102ff610261565b5b61030c85828601610275565
b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83
811015610352578082015181840152602081019050610337565b60008484015250505050565b6000601f19601
f8301169050919050565b600061037a82610318565b6103848185610323565b93506103948185602086016103
34565b61039d8161035e565b840191505092915050565b600060208201905081810360008301526103c281846
1036f565b905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65
72600082015250565b6000610400602083610323565b915061040b826103ca565b602082019050919050565b6
000602082019050818103600083015261042f816103f3565b9050919050565b600082905092915050565b7f4e
487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5
b7f4e487b71000000000000000000000000000000000000000000000000000000006000526022600452602460
00fd5b600060028204905060018216806104b757607f821691505b6020821081036104ca576104c9610470565
b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b
600082821b905092915050565b6000600883026105327ffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffff826104f5565b61053c86836104f5565b955080198416935080861684179250505093
92505050565b6000819050919050565b6000819050919050565b600061058361057e61057984610554565b610
55e565b610554565b9050919050565b6000819050919050565b61059d83610568565b6105b16105a98261058a
565b848454610502565b825550505050565b600090565b6105c66105b9565b6105d1818484610594565b50505
0565b5b818110156105f5576105ea6000826105be565b6001810190506105d7565b5050565b601f8211156106
3a5761060b816104d0565b610614846104e5565b81016020851015610623578190505b61063761062f856104e
5565b8301826105d6565b50505b505050565b600082821c905092915050565b600061065d6000198460080261
063f565b1980831691505092915050565b6000610676838361064c565b9150826002028217905092915050565
b6106908383610436565b67ffffffffffffffff8111156106a9576106a8610441565b5b6106b3825461049f56
5b6106be8282856105f9565b6000601f8311600181146106ed57600084156106db578287013590505b6106e58
58261066a565b86555061074d565b601f1984166106fb866104d0565b60005b82811015610723578489013582
556001820191506020850194506020810190506106fe565b86831015610740578489013561073c601f8916826
1064c565b8355505b6001600288020188555050505b5050505050505056fea264697066735822122060c20316
e7c477c2ca67fd1e46e616c49b5bad17c117d45957f64ac13c222fc164736f6c63430008150033",
    "v": "0x648",
    "r": "0x1dabca54ec371c906023e8b5d5e7636fdf5764207896968b35fe50bb343e4b9f",
    "s": "0x6c34bb0fcabbc0d099757d95b4ae66b685a18cc8dd3cd58c009e06a13a98e64d",
    "to": null,
    "hash": "0xfd3b6b5365f917fa2b90f18eb2eb0ca5c8e95ff4a07e54e27d7f03ff0f9769ec"
  }
-------- List Account request--------------
A request has been made to list all accounts. 
You can select which accounts the caller can see
  [x] 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-22-11.261468773Z-- 2db017e44b03b37755a4b15e14cd799f83de4c13
  [x] 0x7A7686aD451d2865A2246E239B674aeFd4c6c27c
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-28-54.934614755Z-- 7a7686ad451d2865a2246e239b674aefd4c6c27c
  [x] 0x1BbA02873cC1C11f369a7B692F5F3dE8Ff7bbe80
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-09-05T20-26-34.695386684Z-- 1bba02873cc1c11f369a7b692f5f3de8ff7bbe80
-------------------------------------------
Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
Approve? [y/N]:
> y
--------- Transaction request-------------
to:    <contact creation>
from:               0x2db017E44b03B37755A4b15e14Cd799f83DE4c13 [chksum ok]
value:              0 wei
gas:                0xa1325 (660261)
gasprice: 1000000000 wei
nonce:    0x19 (25)
chainid:  0x312
data:     0x60806040526040518060400160405280600d81526020017f48656c6c6f2c20576f726c6421000000000
00000000000000000000000000000815250600090816200004a91906200031a565b5034801562000058576000
80fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fff
fffffffffffffffffffffffffffffffffffff16021790555062000401565b600081519050919050565b7f4e48
7b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7
f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000
fd5b600060028204905060018216806200012257607f821691505b60208210810362000138576200013762000
0da565b5b50919050565b60008190508160005260206000209050919050565b60006020601f83010490509190
50565b600082821b905092915050565b600060088302620001a27ffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffff8262000163565b620001ae868362000163565b9550801984169350808616
8417925050509392505050565b6000819050919050565b6000819050919050565b6000620001fb620001f5620
001ef84620001c6565b620001d0565b620001c6565b9050919050565b6000819050919050565b620002178362
0001da565b6200022f620002268262000202565b84845462000170565b825550505050565b600090565b62000
24662000237565b620002538184846200020c565b505050565b5b818110156200027b576200026f6000826200
023c565b60018101905062000259565b5050565b601f821115620002ca5762000294816200013e565b6200029
f8462000153565b81016020851015620002af578190505b620002c7620002be8562000153565b830182620002
58565b50505b505050565b600082821c905092915050565b6000620002ef60001984600802620002cf565b198
0831691505092915050565b60006200030a8383620002dc565b9150826002028217905092915050565b620003
2582620000a0565b67ffffffffffffffff811115620003415762000340620000ab565b5b6200034d825462000
109565b6200035a8282856200027f565b600060209050601f8311600181146200039257600084156200037d57
8287015190505b620003898582620002fc565b865550620003f9565b601f198416620003a2866200013e565b6
0005b82811015620003cc57848901518255600182019150602085019450602081019050620003a5565b868310
15620003ec5784890151620003e8601f891682620002dc565b8355505b6001600288020188555050505b50505
0505050565b61078c80620004116000396000f3fe608060405234801561001057600080fd5b50600436106100
415760003560e01c80638da5cb5b14610046578063a413686214610064578063cfae321714610080575b60008
0fd5b61004e61009e565b60405161005b9190610241565b60405180910390f35b61007e600480360381019061
007991906102cb565b6100c8565b005b61008861016e565b60405161009591906103a8565b60405180910390f
35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60
0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffff
fffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610158576040517f08
c379a000000000000000000000000000000000000000000000000000000000815260040161014f90610416565
b60405180910390fd5b818160009182610169929190610686565b505050565b60606000805461017d9061049f
565b80601f01602080910402602001604051908101604052809291908181526020018280546101a99061049f5
65b80156101f65780601f106101cb576101008083540402835291602001916101f6565b820191906000526020
600020905b8154815290600101906020018083116101d957829003601f168201915b5050505050905090565b6
00073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061022b82610200565b9050
919050565b61023b81610220565b82525050565b60006020820190506102566000830184610232565b9291505
0565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f84011261028b5761028a61
0266565b5b8235905067ffffffffffffffff8111156102a8576102a761026b565b5b602083019150836001820
2830111156102c4576102c3610270565b5b9250929050565b600080602083850312156102e2576102e161025c
565b5b600083013567ffffffffffffffff811115610300576102ff610261565b5b61030c85828601610275565
b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83
811015610352578082015181840152602081019050610337565b60008484015250505050565b6000601f19601
f8301169050919050565b600061037a82610318565b6103848185610323565b93506103948185602086016103
34565b61039d8161035e565b840191505092915050565b600060208201905081810360008301526103c281846
1036f565b905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65
72600082015250565b6000610400602083610323565b915061040b826103ca565b602082019050919050565b6
000602082019050818103600083015261042f816103f3565b9050919050565b600082905092915050565b7f4e
487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5
b7f4e487b71000000000000000000000000000000000000000000000000000000006000526022600452602460
00fd5b600060028204905060018216806104b757607f821691505b6020821081036104ca576104c9610470565
b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b
600082821b905092915050565b6000600883026105327ffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffff826104f5565b61053c86836104f5565b955080198416935080861684179250505093
92505050565b6000819050919050565b6000819050919050565b600061058361057e61057984610554565b610
55e565b610554565b9050919050565b6000819050919050565b61059d83610568565b6105b16105a98261058a
565b848454610502565b825550505050565b600090565b6105c66105b9565b6105d1818484610594565b50505
0565b5b818110156105f5576105ea6000826105be565b6001810190506105d7565b5050565b601f8211156106
3a5761060b816104d0565b610614846104e5565b81016020851015610623578190505b61063761062f856104e
5565b8301826105d6565b50505b505050565b600082821c905092915050565b600061065d6000198460080261
063f565b1980831691505092915050565b6000610676838361064c565b9150826002028217905092915050565
b6106908383610436565b67ffffffffffffffff8111156106a9576106a8610441565b5b6106b3825461049f56
5b6106be8282856105f9565b6000601f8311600181146106ed57600084156106db578287013590505b6106e58
58261066a565b86555061074d565b601f1984166106fb866104d0565b60005b82811015610723578489013582
556001820191506020850194506020810190506106fe565b86831015610740578489013561073c601f8916826
1064c565b8355505b6001600288020188555050505b5050505050505056fea264697066735822122060c20316
e7c477c2ca67fd1e46e616c49b5bad17c117d45957f64ac13c222fc164736f6c63430008150033

Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
-------------------------------------------
Approve? [y/N]:
> y
\#\# Account password

Please enter the password for account 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
> 
-----------------------
Transaction signed:
 {
    "type": "0x0",
    "nonce": "0x19",
    "gasPrice": "0x3b9aca00",
    "maxPriorityFeePerGas": null,
    "maxFeePerGas": null,
    "gas": "0xa1325",
    "value": "0x0",
    "input": "0x60806040526040518060400160405280600d81526020017f48656c6c6f2c20576f726c6421000000000
00000000000000000000000000000815250600090816200004a91906200031a565b5034801562000058576000
80fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fff
fffffffffffffffffffffffffffffffffffff16021790555062000401565b600081519050919050565b7f4e48
7b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7
f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000
fd5b600060028204905060018216806200012257607f821691505b60208210810362000138576200013762000
0da565b5b50919050565b60008190508160005260206000209050919050565b60006020601f83010490509190
50565b600082821b905092915050565b600060088302620001a27ffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffff8262000163565b620001ae868362000163565b9550801984169350808616
8417925050509392505050565b6000819050919050565b6000819050919050565b6000620001fb620001f5620
001ef84620001c6565b620001d0565b620001c6565b9050919050565b6000819050919050565b620002178362
0001da565b6200022f620002268262000202565b84845462000170565b825550505050565b600090565b62000
24662000237565b620002538184846200020c565b505050565b5b818110156200027b576200026f6000826200
023c565b60018101905062000259565b5050565b601f821115620002ca5762000294816200013e565b6200029
f8462000153565b81016020851015620002af578190505b620002c7620002be8562000153565b830182620002
58565b50505b505050565b600082821c905092915050565b6000620002ef60001984600802620002cf565b198
0831691505092915050565b60006200030a8383620002dc565b9150826002028217905092915050565b620003
2582620000a0565b67ffffffffffffffff811115620003415762000340620000ab565b5b6200034d825462000
109565b6200035a8282856200027f565b600060209050601f8311600181146200039257600084156200037d57
8287015190505b620003898582620002fc565b865550620003f9565b601f198416620003a2866200013e565b6
0005b82811015620003cc57848901518255600182019150602085019450602081019050620003a5565b868310
15620003ec5784890151620003e8601f891682620002dc565b8355505b6001600288020188555050505b50505
0505050565b61078c80620004116000396000f3fe608060405234801561001057600080fd5b50600436106100
415760003560e01c80638da5cb5b14610046578063a413686214610064578063cfae321714610080575b60008
0fd5b61004e61009e565b60405161005b9190610241565b60405180910390f35b61007e600480360381019061
007991906102cb565b6100c8565b005b61008861016e565b60405161009591906103a8565b60405180910390f
35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60
0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffff
fffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610158576040517f08
c379a000000000000000000000000000000000000000000000000000000000815260040161014f90610416565
b60405180910390fd5b818160009182610169929190610686565b505050565b60606000805461017d9061049f
565b80601f01602080910402602001604051908101604052809291908181526020018280546101a99061049f5
65b80156101f65780601f106101cb576101008083540402835291602001916101f6565b820191906000526020
600020905b8154815290600101906020018083116101d957829003601f168201915b5050505050905090565b6
00073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061022b82610200565b9050
919050565b61023b81610220565b82525050565b60006020820190506102566000830184610232565b9291505
0565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f84011261028b5761028a61
0266565b5b8235905067ffffffffffffffff8111156102a8576102a761026b565b5b602083019150836001820
2830111156102c4576102c3610270565b5b9250929050565b600080602083850312156102e2576102e161025c
565b5b600083013567ffffffffffffffff811115610300576102ff610261565b5b61030c85828601610275565
b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83
811015610352578082015181840152602081019050610337565b60008484015250505050565b6000601f19601
f8301169050919050565b600061037a82610318565b6103848185610323565b93506103948185602086016103
34565b61039d8161035e565b840191505092915050565b600060208201905081810360008301526103c281846
1036f565b905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65
72600082015250565b6000610400602083610323565b915061040b826103ca565b602082019050919050565b6
000602082019050818103600083015261042f816103f3565b9050919050565b600082905092915050565b7f4e
487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5
b7f4e487b71000000000000000000000000000000000000000000000000000000006000526022600452602460
00fd5b600060028204905060018216806104b757607f821691505b6020821081036104ca576104c9610470565
b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b
600082821b905092915050565b6000600883026105327ffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffff826104f5565b61053c86836104f5565b955080198416935080861684179250505093
92505050565b6000819050919050565b6000819050919050565b600061058361057e61057984610554565b610
55e565b610554565b9050919050565b6000819050919050565b61059d83610568565b6105b16105a98261058a
565b848454610502565b825550505050565b600090565b6105c66105b9565b6105d1818484610594565b50505
0565b5b818110156105f5576105ea6000826105be565b6001810190506105d7565b5050565b601f8211156106
3a5761060b816104d0565b610614846104e5565b81016020851015610623578190505b61063761062f856104e
5565b8301826105d6565b50505b505050565b600082821c905092915050565b600061065d6000198460080261
063f565b1980831691505092915050565b6000610676838361064c565b9150826002028217905092915050565
b6106908383610436565b67ffffffffffffffff8111156106a9576106a8610441565b5b6106b3825461049f56
5b6106be8282856105f9565b6000601f8311600181146106ed57600084156106db578287013590505b6106e58
58261066a565b86555061074d565b601f1984166106fb866104d0565b60005b82811015610723578489013582
556001820191506020850194506020810190506106fe565b86831015610740578489013561073c601f8916826
1064c565b8355505b6001600288020188555050505b5050505050505056fea264697066735822122060c20316
e7c477c2ca67fd1e46e616c49b5bad17c117d45957f64ac13c222fc164736f6c63430008150033",
    "v": "0x647",
    "r": "0xfb11595c1d105855922fac1e7957f6234df2707a492043208f1719ce94814bd6",
    "s": "0x5500e8134875e581c43fb78051cde2b42fff60025f330688a974ca72a7fa7707",
    "to": null,
    "hash": "0x44ed9b152a0e8a2b85ef3131629117672710e4d7f87f53516848bd53bb8414bb"
  }
--------- Transaction request-------------
to:    0x05733407E1078d4E9D50adC48f04A05d3269f7D2
from:               0x2db017E44b03B37755A4b15e14Cd799f83DE4c13 [chksum ok]
value:              0 wei
gas:                0x92e7 (37607)
gasprice: 1000000000 wei
nonce:    0x1a (26)
chainid:  0x312
data:     0xa4136862000000000000000000000000000000000000000000000000000000000000002000000000000
0000000000000000000000000000000000000000000000000001d546865206f776e6572206368616e67656420
746865206d657373616765000000

Transaction validation:
  * Info : Transaction invokes the following method: "setGreeting(string: The owner changed the message)"


Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
-------------------------------------------
Approve? [y/N]:
> y
\#\# Account password

Please enter the password for account 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
> 
-----------------------
Transaction signed:
 {
    "type": "0x0",
    "nonce": "0x1a",
    "gasPrice": "0x3b9aca00",
    "maxPriorityFeePerGas": null,
    "maxFeePerGas": null,
    "gas": "0x92e7",
    "value": "0x0",
    "input": "0xa413686200000000000000000000000000000000000000000000000000000000000000200000000
    00000000000000000000000000000000000000000000000000000001d546865206f776e6572206368616e
    67656420746865206d657373616765000000",
    "v": "0x648",
    "r": "0x76481633317017d22ad780a7e5b75a68eedcdb74dca74c7c5a0bf6ddb6f85799",
    "s": "0x6d9c18462013e322bfd4774c2fd459d23cb2bf29ae1d3b1f17b2841a3c104c7d",
    "to": "0x05733407e1078d4e9d50adc48f04a05d3269f7d2",
    "hash": "0x80fefda3c78497187449c561c54884b0925ae5cd9bb66712e1e8c4453f7fc283"
  }

As notificações de contratos submetidos para criação aparecem no console do geth:

INFO [10-10|10:09:41.718] Submitted contract creation              hash=0xe15b0e773f71256345ef5089bd6ba5c190386d7162dcebcf4d25dcc3ab37ec63 from=0x2db017E44b03B37755A4b15e14Cd799f83DE4c13 nonce=17 contract=0x2Ec04170e7b52d40D494F149Bd5E29e0Bf0c8Dd8 value=0
...
INFO [10-10|10:16:35.223] Submitted contract creation              hash=0x6cff3c9a22e589bf23806e5d828afa8c40ec6e4ca3b6f685c70ef49424e11109 from=0x2db017E44b03B37755A4b15e14Cd799f83DE4c13 nonce=18 contract=0x0D11EFB65b7E3BFE2fb3f8bCADbD34115aE7c805 value=0

INFO [10-10|10:17:09.792] Submitted contract creation              hash=0x851f13f7ab055356b5f22e012a9c7b947fcf941e44857ae3ea041fa05b4f2408 from=0x2db017E44b03B37755A4b15e14Cd799f83DE4c13 nonce=19 contract=0x83fd6403127A6b3F329Afd854cD47C277276fcBc value=0

INFO [10-10|10:17:45.671] Submitted transaction                    hash=0x3b20dda6c2078014368b4043cd431a856eaa1f35a771827edb4580b652a7d1b8 from=0x2db017E44b03B37755A4b15e14Cd799f83DE4c13 nonce=20 recipient=0x83fd6403127A6b3F329Afd854cD47C277276fcBc value=0

10.15 Deploy na Rede Privada Local (cont.)

Fazer a implantação na etherprivate:

[projeto-helloworld-truffle]$ truffle migrate --network etherprivate

Compiling your contracts...
===========================
> Compiling ./contracts/Greeter_orig.sol
> Compilation warnings encountered:

    Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
  -> project:/contracts/Greeter_orig.sol:8:5:
  |
8 |     constructor() public {
  |     ^ (Relevant source part starts here and spans across multiple lines).


> Artifacts written to /run/media/rogerio/BK-RAG-HP1TB/repositorios/Dropbox/dados/rogerio/UTFPR/docencia/ disciplinas/2023/DLT-PPGCC17/2023-2/aulas/md/aula-12-pratica-ethereum-truffle/src/ projeto-helloworld-truffle/build/contracts
> Compiled successfully using:
   - solc: 0.8.21+commit.d9974bed.Emscripten.clang


Starting migrations...
======================
> Network name:    'etherprivate'
> Network id:      786
> Block gas limit: 30000000 (0x1c9c380)


2_deploy_greeter.js
===================

   Deploying 'Greeter'
   -------------------
   > transaction hash:    0xe32f1b83d45971309bb07e38a118561c33e51abbbc0667a51326368a79930e3b
   > Blocks: 0            Seconds: 40
   > contract address:    0x92aB300b4C587Fb07d404f8C4263213b65c5CF45
   > block number:        9518
   > block timestamp:     1696944233
   > account:             0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
   > balance:             19036.0000000000003
   > gas used:            528209 (0x80f51)
   > gas price:           1 gwei
   > value sent:          0 ETH
   > total cost:          0.000528209 ETH

   > Saving artifacts
   -------------------------------------
   > Total cost:         0.000528209 ETH

Summary
=======
> Total deployments:   1
> Final cost:          0.000528209 ETH

No console onde o clef está sendo executado aparecem as solicitações de aprovações e solicitações de senha para a conta principal.

[projeto-helloworld-truffle]$ ~/go-ethereum/build/bin/clef --chainid 786 --keystore ~/.etherprivate/keystore --configdir ~/.etherprivate/clef --http

WARNING!

Clef is an account management tool. It may, like any software, contain bugs.

Please take care to
- backup your keystore files,
- verify that the keystore(s) can be opened with your password.

Clef is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.

Enter 'ok' to proceed:
> ok

INFO [10-10|10:23:19.510] Using CLI as UI-channel 
INFO [10-10|10:23:19.936] Loaded 4byte database                    embeds=268,621 locals=0 local=./4byte-custom.json
WARN [10-10|10:23:19.936] Failed to open master, rules disabled    err="failed stat on /home/rogerio/.etherprivate/clef/masterseed.json: stat /home/rogerio/.etherprivate/clef/masterseed.json: no such file or directory"
INFO [10-10|10:23:19.936] Starting signer                          chainid=786 keystore=/home/rogerio/.etherprivate/keystore light-kdf=false advanced=false
INFO [10-10|10:23:19.938] Smartcard socket file missing, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory"
INFO [10-10|10:23:19.938] Audit logs configured                    file=audit.log
INFO [10-10|10:23:19.939] HTTP endpoint opened                     url=http://127.0.0.1:8550/
INFO [10-10|10:23:19.939] IPC endpoint opened                      url=/home/rogerio/.etherprivate/clef/clef.ipc

------- Signer info -------
* extapi_version : 6.1.0
* extapi_http : http://127.0.0.1:8550/
* extapi_ipc : /home/rogerio/.etherprivate/clef/clef.ipc
* intapi_version : 7.0.1

------- Available accounts -------
0. 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13 at keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-22-11.261468773Z-- 2db017e44b03b37755a4b15e14cd799f83de4c13
1. 0x7A7686aD451d2865A2246E239B674aeFd4c6c27c at keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-28-54.934614755Z-- 7a7686ad451d2865a2246e239b674aefd4c6c27c
2. 0x1BbA02873cC1C11f369a7B692F5F3dE8Ff7bbe80 at keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-09-05T20-26-34.695386684Z-- 1bba02873cc1c11f369a7b692f5f3de8ff7bbe80
-------- List Account request--------------
A request has been made to list all accounts. 
You can select which accounts the caller can see
  [x] 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-22-11.261468773Z-- 2db017e44b03b37755a4b15e14cd799f83de4c13
  [x] 0x7A7686aD451d2865A2246E239B674aeFd4c6c27c
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-28-54.934614755Z-- 7a7686ad451d2865a2246e239b674aefd4c6c27c
  [x] 0x1BbA02873cC1C11f369a7B692F5F3dE8Ff7bbe80
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-09-05T20-26-34.695386684Z-- 1bba02873cc1c11f369a7b692f5f3de8ff7bbe80
-------------------------------------------
Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
Approve? [y/N]:
> y
-------- List Account request--------------
A request has been made to list all accounts. 
You can select which accounts the caller can see
  [x] 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-22-11.261468773Z-- 2db017e44b03b37755a4b15e14cd799f83de4c13
  [x] 0x7A7686aD451d2865A2246E239B674aeFd4c6c27c
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-04-17T12-28-54.934614755Z-- 7a7686ad451d2865a2246e239b674aefd4c6c27c
  [x] 0x1BbA02873cC1C11f369a7B692F5F3dE8Ff7bbe80
    URL: keystore:///home/rogerio/.etherprivate/keystore/UTC--2023-09-05T20-26-34.695386684Z-- 1bba02873cc1c11f369a7b692f5f3de8ff7bbe80
-------------------------------------------
Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
Approve? [y/N]:
> y
--------- Transaction request-------------
to:    <contact creation>
from:               0x2db017E44b03B37755A4b15e14Cd799f83DE4c13 [chksum ok]
value:              0 wei
gas:                0xa1325 (660261)
gasprice: 1000000000 wei
nonce:    0x1b (27)
chainid:  0x312
data:     0x60806040526040518060400160405280600d81526020017f48656c6c6f2c20576f726c6421000000000
00000000000000000000000000000815250600090816200004a91906200031a565b5034801562000058576000
80fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fff
fffffffffffffffffffffffffffffffffffff16021790555062000401565b600081519050919050565b7f4e48
7b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7
f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000
fd5b600060028204905060018216806200012257607f821691505b60208210810362000138576200013762000
0da565b5b50919050565b60008190508160005260206000209050919050565b60006020601f83010490509190
50565b600082821b905092915050565b600060088302620001a27ffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffff8262000163565b620001ae868362000163565b9550801984169350808616
8417925050509392505050565b6000819050919050565b6000819050919050565b6000620001fb620001f5620
001ef84620001c6565b620001d0565b620001c6565b9050919050565b6000819050919050565b620002178362
0001da565b6200022f620002268262000202565b84845462000170565b825550505050565b600090565b62000
24662000237565b620002538184846200020c565b505050565b5b818110156200027b576200026f6000826200
023c565b60018101905062000259565b5050565b601f821115620002ca5762000294816200013e565b6200029
f8462000153565b81016020851015620002af578190505b620002c7620002be8562000153565b830182620002
58565b50505b505050565b600082821c905092915050565b6000620002ef60001984600802620002cf565b198
0831691505092915050565b60006200030a8383620002dc565b9150826002028217905092915050565b620003
2582620000a0565b67ffffffffffffffff811115620003415762000340620000ab565b5b6200034d825462000
109565b6200035a8282856200027f565b600060209050601f8311600181146200039257600084156200037d57
8287015190505b620003898582620002fc565b865550620003f9565b601f198416620003a2866200013e565b6
0005b82811015620003cc57848901518255600182019150602085019450602081019050620003a5565b868310
15620003ec5784890151620003e8601f891682620002dc565b8355505b6001600288020188555050505b50505
0505050565b61078c80620004116000396000f3fe608060405234801561001057600080fd5b50600436106100
415760003560e01c80638da5cb5b14610046578063a413686214610064578063cfae321714610080575b60008
0fd5b61004e61009e565b60405161005b9190610241565b60405180910390f35b61007e600480360381019061
007991906102cb565b6100c8565b005b61008861016e565b60405161009591906103a8565b60405180910390f
35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60
0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffff
fffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610158576040517f08
c379a000000000000000000000000000000000000000000000000000000000815260040161014f90610416565
b60405180910390fd5b818160009182610169929190610686565b505050565b60606000805461017d9061049f
565b80601f01602080910402602001604051908101604052809291908181526020018280546101a99061049f5
65b80156101f65780601f106101cb576101008083540402835291602001916101f6565b820191906000526020
600020905b8154815290600101906020018083116101d957829003601f168201915b5050505050905090565b6
00073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061022b82610200565b9050
919050565b61023b81610220565b82525050565b60006020820190506102566000830184610232565b9291505
0565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f84011261028b5761028a61
0266565b5b8235905067ffffffffffffffff8111156102a8576102a761026b565b5b602083019150836001820
2830111156102c4576102c3610270565b5b9250929050565b600080602083850312156102e2576102e161025c
565b5b600083013567ffffffffffffffff811115610300576102ff610261565b5b61030c85828601610275565
b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83
811015610352578082015181840152602081019050610337565b60008484015250505050565b6000601f19601
f8301169050919050565b600061037a82610318565b6103848185610323565b93506103948185602086016103
34565b61039d8161035e565b840191505092915050565b600060208201905081810360008301526103c281846
1036f565b905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65
72600082015250565b6000610400602083610323565b915061040b826103ca565b602082019050919050565b6
000602082019050818103600083015261042f816103f3565b9050919050565b600082905092915050565b7f4e
487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5
b7f4e487b71000000000000000000000000000000000000000000000000000000006000526022600452602460
00fd5b600060028204905060018216806104b757607f821691505b6020821081036104ca576104c9610470565
b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b
600082821b905092915050565b6000600883026105327ffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffff826104f5565b61053c86836104f5565b955080198416935080861684179250505093
92505050565b6000819050919050565b6000819050919050565b600061058361057e61057984610554565b610
55e565b610554565b9050919050565b6000819050919050565b61059d83610568565b6105b16105a98261058a
565b848454610502565b825550505050565b600090565b6105c66105b9565b6105d1818484610594565b50505
0565b5b818110156105f5576105ea6000826105be565b6001810190506105d7565b5050565b601f8211156106
3a5761060b816104d0565b610614846104e5565b81016020851015610623578190505b61063761062f856104e
5565b8301826105d6565b50505b505050565b600082821c905092915050565b600061065d6000198460080261
063f565b1980831691505092915050565b6000610676838361064c565b9150826002028217905092915050565
b6106908383610436565b67ffffffffffffffff8111156106a9576106a8610441565b5b6106b3825461049f56
5b6106be8282856105f9565b6000601f8311600181146106ed57600084156106db578287013590505b6106e58
58261066a565b86555061074d565b601f1984166106fb866104d0565b60005b82811015610723578489013582
556001820191506020850194506020810190506106fe565b86831015610740578489013561073c601f8916826
1064c565b8355505b6001600288020188555050505b5050505050505056fea264697066735822122060c20316
e7c477c2ca67fd1e46e616c49b5bad17c117d45957f64ac13c222fc164736f6c63430008150033

Request context:
        NA -> ipc -> NA

Additional HTTP header data, provided by the external caller:
        User-Agent: ""
        Origin: ""
-------------------------------------------
Approve? [y/N]:
> y
\#\# Account password

Please enter the password for account 0x2db017E44b03B37755A4b15e14Cd799f83DE4c13
> 
-----------------------
Transaction signed:
 {
    "type": "0x0",
    "nonce": "0x1b",
    "gasPrice": "0x3b9aca00",
    "maxPriorityFeePerGas": null,
    "maxFeePerGas": null,
    "gas": "0xa1325",
    "value": "0x0",
    "input": "0x60806040526040518060400160405280600d81526020017f48656c6c6f2c20576f726c6421000000000
00000000000000000000000000000815250600090816200004a91906200031a565b5034801562000058576000
80fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fff
fffffffffffffffffffffffffffffffffffff16021790555062000401565b600081519050919050565b7f4e48
7b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7
f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000
fd5b600060028204905060018216806200012257607f821691505b60208210810362000138576200013762000
0da565b5b50919050565b60008190508160005260206000209050919050565b60006020601f83010490509190
50565b600082821b905092915050565b600060088302620001a27ffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffff8262000163565b620001ae868362000163565b9550801984169350808616
8417925050509392505050565b6000819050919050565b6000819050919050565b6000620001fb620001f5620
001ef84620001c6565b620001d0565b620001c6565b9050919050565b6000819050919050565b620002178362
0001da565b6200022f620002268262000202565b84845462000170565b825550505050565b600090565b62000
24662000237565b620002538184846200020c565b505050565b5b818110156200027b576200026f6000826200
023c565b60018101905062000259565b5050565b601f821115620002ca5762000294816200013e565b6200029
f8462000153565b81016020851015620002af578190505b620002c7620002be8562000153565b830182620002
58565b50505b505050565b600082821c905092915050565b6000620002ef60001984600802620002cf565b198
0831691505092915050565b60006200030a8383620002dc565b9150826002028217905092915050565b620003
2582620000a0565b67ffffffffffffffff811115620003415762000340620000ab565b5b6200034d825462000
109565b6200035a8282856200027f565b600060209050601f8311600181146200039257600084156200037d57
8287015190505b620003898582620002fc565b865550620003f9565b601f198416620003a2866200013e565b6
0005b82811015620003cc57848901518255600182019150602085019450602081019050620003a5565b868310
15620003ec5784890151620003e8601f891682620002dc565b8355505b6001600288020188555050505b50505
0505050565b61078c80620004116000396000f3fe608060405234801561001057600080fd5b50600436106100
415760003560e01c80638da5cb5b14610046578063a413686214610064578063cfae321714610080575b60008
0fd5b61004e61009e565b60405161005b9190610241565b60405180910390f35b61007e600480360381019061
007991906102cb565b6100c8565b005b61008861016e565b60405161009591906103a8565b60405180910390f
35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60
0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffff
fffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610158576040517f08
c379a000000000000000000000000000000000000000000000000000000000815260040161014f90610416565
b60405180910390fd5b818160009182610169929190610686565b505050565b60606000805461017d9061049f
565b80601f01602080910402602001604051908101604052809291908181526020018280546101a99061049f5
65b80156101f65780601f106101cb576101008083540402835291602001916101f6565b820191906000526020
600020905b8154815290600101906020018083116101d957829003601f168201915b5050505050905090565b6
00073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061022b82610200565b9050
919050565b61023b81610220565b82525050565b60006020820190506102566000830184610232565b9291505
0565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f84011261028b5761028a61
0266565b5b8235905067ffffffffffffffff8111156102a8576102a761026b565b5b602083019150836001820
2830111156102c4576102c3610270565b5b9250929050565b600080602083850312156102e2576102e161025c
565b5b600083013567ffffffffffffffff811115610300576102ff610261565b5b61030c85828601610275565
b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83
811015610352578082015181840152602081019050610337565b60008484015250505050565b6000601f19601
f8301169050919050565b600061037a82610318565b6103848185610323565b93506103948185602086016103
34565b61039d8161035e565b840191505092915050565b600060208201905081810360008301526103c281846
1036f565b905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65
72600082015250565b6000610400602083610323565b915061040b826103ca565b602082019050919050565b6
000602082019050818103600083015261042f816103f3565b9050919050565b600082905092915050565b7f4e
487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5
b7f4e487b71000000000000000000000000000000000000000000000000000000006000526022600452602460
00fd5b600060028204905060018216806104b757607f821691505b6020821081036104ca576104c9610470565
b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b
600082821b905092915050565b6000600883026105327ffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffff826104f5565b61053c86836104f5565b955080198416935080861684179250505093
92505050565b6000819050919050565b6000819050919050565b600061058361057e61057984610554565b610
55e565b610554565b9050919050565b6000819050919050565b61059d83610568565b6105b16105a98261058a
565b848454610502565b825550505050565b600090565b6105c66105b9565b6105d1818484610594565b50505
0565b5b818110156105f5576105ea6000826105be565b6001810190506105d7565b5050565b601f8211156106
3a5761060b816104d0565b610614846104e5565b81016020851015610623578190505b61063761062f856104e
5565b8301826105d6565b50505b505050565b600082821c905092915050565b600061065d6000198460080261
063f565b1980831691505092915050565b6000610676838361064c565b9150826002028217905092915050565
b6106908383610436565b67ffffffffffffffff8111156106a9576106a8610441565b5b6106b3825461049f56
5b6106be8282856105f9565b6000601f8311600181146106ed57600084156106db578287013590505b6106e58
58261066a565b86555061074d565b601f1984166106fb866104d0565b60005b82811015610723578489013582
556001820191506020850194506020810190506106fe565b86831015610740578489013561073c601f8916826
1064c565b8355505b6001600288020188555050505b5050505050505056fea264697066735822122060c20316
e7c477c2ca67fd1e46e616c49b5bad17c117d45957f64ac13c222fc164736f6c63430008150033",
    "v": "0x648",
    "r": "0x6c6cdf00ca292492586372ad29ad5c2aae0194892efad2efb10ef75bf1dda9fb",
    "s": "0x11953128d72e6bc7163eea524c0c9f7749e8ec9c5cfc97154524451d0b29f04",
    "to": null,
    "hash": "0xe32f1b83d45971309bb07e38a118561c33e51abbbc0667a51326368a79930e3b"
  }

O console de execução do geth no caso do deploy aparece uma única submissão de criação do contrato.

[.etherprivate]$ ~/go-ethereum/build/bin/geth --networkid 786 --datadir ~/.etherprivate/ --syncmode full --allow-insecure-unlock  --identity "RAGEtherPrivate" --http --http.addr 127.0.0.1 --http.port 8559 --http.api "eth,net,web3,personal,engine,admin,debug" --keystore ~/.etherprivate/keystore --authrpc.addr localhost --authrpc.port 8551 --authrpc.vhosts localhost --authrpc.jwtsecret ~/.etherprivate/geth/jwtsecret --nodiscover --maxpeers 15 --miner.etherbase=0x2db017e44b03b37755a4b15e14cd799f83de4c13 --signer=/home/rogerio/.etherprivate/clef/clef.ipc
...
INFO [10-10|10:23:47.211] Submitted contract creation              hash=0xe32f1b83d45971309bb07e38a118561c33e51abbbc0667a51326368a79930e3b from=0x2db017E44b03B37755A4b15e14Cd799f83DE4c13 nonce=27 contract=0x92aB300b4C587Fb07d404f8C4263213b65c5CF45 value=0
...

No console do truffle é possível interagir com o contrato criado.

[projeto-helloworld-truffle]$ truffle console --network etherprivate
truffle(etherprivate)> Greeter
Greeter

truffle(etherprivate)> let newInstance = await Greeter.new()
undefined
truffle(etherprivate)> newInstance.address
'0xC81A295b1266ba3b9988d9B052e4df7646CCC6bc'
truffle(etherprivate)> newInstance.greet.call()
'Hello, World!'
truffle(etherprivate)> 

11 Atividade: Projeto MetaCoin

  • Utilizando o Truffle baixar o exemplo de projeto MetaCoin e fazer o deploy no Ganache.
  • Utilize o Truffle quickstart onde descrevem o uso do comando truffle unbox metacoin.

11.1 Leitura Recomendada

12 Word Cloud

12.1 Referências