Git Product home page Git Product logo

web3.php_send_tokens_example's Introduction

Files

Path Description
public/sendTokens.php Example PHP code to show how to sign a transaction
resources/Erc777TokenAbiArray.json The ABI (Application Binary Interface) needed to interact with a smart contract
contracts/Erc777Token.sol An example of the solidity contract that was used to generate the ABI resources/Erc777TokenAbiArray.json

Waiting vs Not Waiting

The $transactionCount obtained by calling getTransactionCount() is only accurate if ALL the previously submitted transactions have been mined. There's some code that waits for the transaction to be mined. If the wait is removed or bypassed then it will be necessary to manually count how many transactions were submitted and manually increment $transactionCount.

Search for information on the ethereum nonce to better understand the importance of the transaction count.

Requirements

  1. Manually install PHP 7.x (one of the packages doesn't support 8.x yet).
  2. Uncomment extension=gmp in your php.ini file.
  3. Manually install php composer from https://getcomposer.org/.

Inital Setup

If this is the first time you've cloned this repository then run

  1. Run command composer install
  2. Create .env file from .env.example file

Running

php public/sendTokens.php 0xB3F0c9d503104163537Dd741D502117BBf6aF8f1 2 500000000000000000

Debugging

  1. Follow instructions at https://xdebug.org/wizard
    • On Windows, if not specified make sure to rename the DLL to exactly php_xdebug.dll.
  2. Add zend_extension = xdebug
  3. Start your debugger
  4. Run command php -dxdebug.mode=debug -dxdebug.start_with_request=yes public/sendTokens.php 0xB3F0c9d503104163537Dd741D502117BBf6aF8f1 2 500000000000000000

web3.php_send_tokens_example's People

Contributors

benrobot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.