├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── composer.json ├── composer.lock └── src ├── Foundation ├── Contracts │ └── EventLogBuilderInterface.php ├── ERC20.php ├── Eth.php ├── EthBase.php ├── EventLogBuilder.php ├── StandardERC20Token.php └── Transaction │ ├── SignedTransaction.php │ ├── Transaction.php │ └── TransactionBuilder.php ├── Token.php ├── Utils ├── Address.php ├── KeyPair.php └── Number.php └── resources └── erc20.abi.json /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | 7 | # These files are text and should be normalized (Convert crlf => lf) 8 | *.php text 9 | *.css text 10 | *.js text 11 | *.json text 12 | *.htm text 13 | *.html text 14 | *.xml text 15 | *.txt text 16 | *.ini text 17 | *.inc text 18 | *.pl text 19 | *.rb text 20 | *.py text 21 | *.scm text 22 | *.sql text 23 | .htaccess text 24 | *.sh text 25 | 26 | # These files are binary and should be left untouched 27 | # (binary is a macro for -text -diff) 28 | *.png binary 29 | *.jpg binary 30 | *.jpeg binary 31 | *.gif binary 32 | *.ico binary 33 | *.mov binary 34 | *.mp4 binary 35 | *.mp3 binary 36 | *.flv binary 37 | *.fla binary 38 | *.swf binary 39 | *.gz binary 40 | *.zip binary 41 | *.7z binary 42 | *.ttf binary 43 | *.pyc binary 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | ignore 3 | vendor 4 | 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Mojtaba Bahrami 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Simple Ethereum ERC20 token php library 2 | 3 | This library provides simple way to interact with Ethereum ERC20 token. 4 | By default, supports all ERC20 Standard functions (like balanceOf, transfer, transferFrom, approve, allowance, decimal, name, ...) also can be extends to support other contracts as well. 5 | 6 | ## Installation 7 | `composer require lessmore92/php-erc20` 8 | 9 | ## Usage 10 | There are two ways to use: 11 | #### 1- Make a new class for your token and specified their functions 12 | #### 2- Use general class with all standard functions 13 | 14 | See below to find out more 15 | 16 | 17 | ### 1-Make a new class for your token 18 | Simply create a new class inherits from `\Lessmore92\Ethereum\Foundation\StandardERC20Token` 19 | 20 | in below sample we create a new class for Tether (USDT) 21 | ``` 22 | class USDT extends \Lessmore92\Ethereum\Foundation\StandardERC20Token 23 | { 24 | protected $contractAddress = "0xdac17f958d2ee523a2206206994597c13d831ec7"; 25 | } 26 | ``` 27 | Then for use create new instantiate from your class and 28 | 29 | ``` 30 | $tether = new USDT("https://mainnet.infura.io/v3/API_KEY"); 31 | var_dump($tether->name()); 32 | var_dump($tether->decimals()); 33 | ``` 34 | 35 | ### 2- Use general class 36 | 37 | ``` 38 | $token = new \Lessmore92\Ethereum\Token("0xdac17f958d2ee523a2206206994597c13d831ec7", "https://mainnet.infura.io/v3/API_KEY"); 39 | var_dump($token->name()); 40 | ``` 41 | 42 | 43 | ### Connection Timeout 44 | 45 | Connection timeout can be set by last parameter of token class 46 | 47 | ``` 48 | $timeout = 3; //secs 49 | $tether = new USDT("https://mainnet.infura.io/v3/API_KEY",$timeout); 50 | ``` 51 | OR 52 | ``` 53 | $timeout = 3; //secs 54 | $tether = new \Lessmore92\Ethereum\Token("0xdac17f958d2ee523a2206206994597c13d831ec7", "https://mainnet.infura.io/v3/API_KEY", $timeout); 55 | ``` 56 | 57 | ## Ethereum RPC Client 58 | For connect to Ethereum blockchain you need an Ethereum node; [Infura](https://infura.io/) is a simple and fast solution, however you can launch you [Geth](https://geth.ethereum.org/) node 59 | 60 | 61 | ## ERC20 Token `transferFrom` 62 | ERC20 transaction fee needs to be paid in `ETH`. In some situation your app needs to pay this fee behalf of user. 63 | Suppose, user A have a key pair (private, public) and all their transaction is limited to usdt. User A needs to send 10 usdt, but he/she haven't ETH to pay transaction fee. 64 | In these cases your app should pay fee behalf of users. 65 | `transferFrom` is a good solution in these cases. 66 | 67 | 68 | ## `transferFrom` Flow: 69 | 1.First, Using `approve` method to grant permission to a delegator. 70 | 2.Then, Using `transferFrom` method to make transaction behalf of user. 71 | 72 | *In Action* 73 | ``` 74 | $owner_private = '0xcf29c83a88e23d0b9e676beca426490bf79aca71e9d24f79a99d30c48292e1e3'; 75 | $owner_address = '0xA7e5F270c27E9d33911EE7D50D8E814f793d2760'; 76 | 77 | $myapp_private = '0xa6b6be193bfeac6160178ee6e1435609ae566a9054715e0802e4c3b39bb94e83'; 78 | $myapp_address = '0x8dC9b3c20795815aa063FEdBE8E564566CEc1893'; 79 | 80 | $to_address = '0x245013F05DdA116142Ca8db205ec4F8C780E3DcB'; 81 | 82 | //by this method we allow $myapp_address to send upto 99999 token behalf of $owner_address 83 | $approve_tx = $token->approve($owner_address, $myapp_address, 99999); 84 | $approve_tx_id = $approve_tx->sign($owner_private) 85 | ->send() 86 | ; 87 | 88 | 89 | //the magic is here, $myapp_address send 10 tokens behalf of user and $myapp_address pay transaction fee 90 | $transfer_tx = $token->transferFrom($myapp_address, $owner_address, $to_address, 10); 91 | $transfer_tx_id = $transfer_tx->sign($myapp_private) 92 | ->send() 93 | ; 94 | 95 | ``` 96 | 97 | ### `allowance` to check how much transferFrom remain 98 | 99 | `$remain = $token->allowance($owner_address, $myapp_address);` 100 | 101 | *Notices:* 102 | `approve` method not need to be used on every transaction. 103 | To revoke `transferFrom` permission call `$token->approve($owner_address, $myapp_address, 0)` by amount `0`. 104 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lessmore92/php-erc20", 3 | "description": "This library provides simple way to interact with Ethereum ERC20 token.", 4 | "type": "library", 5 | "authors": [ 6 | { 7 | "name": "Lessmore92", 8 | "email": "bahramisoft@gmail.com" 9 | } 10 | ], 11 | "autoload": { 12 | "psr-4": { 13 | "Lessmore92\\Ethereum\\": "src" 14 | } 15 | }, 16 | "minimum-stability": "dev", 17 | "require": { 18 | "php": ">=7.1", 19 | "sc0vu/web3.php": "0.1.4", 20 | "web3p/ethereum-util": "0.1.2", 21 | "kornrunner/ethereum-offline-raw-tx": "0.2.4" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "9cd7a269bcc6f41bbb02eb92c1c8d8b3", 8 | "packages": [ 9 | { 10 | "name": "fgrosse/phpasn1", 11 | "version": "v2.2.0", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/fgrosse/PHPASN1.git", 15 | "reference": "d1978f7abd580f3fc33561e7f71d4c12c7531fad" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/fgrosse/PHPASN1/zipball/d1978f7abd580f3fc33561e7f71d4c12c7531fad", 20 | "reference": "d1978f7abd580f3fc33561e7f71d4c12c7531fad", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "php": ">=7.0.0" 25 | }, 26 | "require-dev": { 27 | "phpunit/phpunit": "~6.3", 28 | "satooshi/php-coveralls": "~2.0" 29 | }, 30 | "suggest": { 31 | "ext-bcmath": "BCmath is the fallback extension for big integer calculations", 32 | "ext-curl": "For loading OID information from the web if they have not bee defined statically", 33 | "ext-gmp": "GMP is the preferred extension for big integer calculations", 34 | "phpseclib/bcmath_compat": "BCmath polyfill for servers where neither GMP nor BCmath is available" 35 | }, 36 | "type": "library", 37 | "extra": { 38 | "branch-alias": { 39 | "dev-master": "2.0.x-dev" 40 | } 41 | }, 42 | "autoload": { 43 | "psr-4": { 44 | "FG\\": "lib/" 45 | } 46 | }, 47 | "notification-url": "https://packagist.org/downloads/", 48 | "license": [ 49 | "MIT" 50 | ], 51 | "authors": [ 52 | { 53 | "name": "Friedrich Große", 54 | "email": "friedrich.grosse@gmail.com", 55 | "homepage": "https://github.com/FGrosse", 56 | "role": "Author" 57 | }, 58 | { 59 | "name": "All contributors", 60 | "homepage": "https://github.com/FGrosse/PHPASN1/contributors" 61 | } 62 | ], 63 | "description": "A PHP Framework that allows you to encode and decode arbitrary ASN.1 structures using the ITU-T X.690 Encoding Rules.", 64 | "homepage": "https://github.com/FGrosse/PHPASN1", 65 | "keywords": [ 66 | "DER", 67 | "asn.1", 68 | "asn1", 69 | "ber", 70 | "binary", 71 | "decoding", 72 | "encoding", 73 | "x.509", 74 | "x.690", 75 | "x509", 76 | "x690" 77 | ], 78 | "support": { 79 | "issues": "https://github.com/fgrosse/PHPASN1/issues", 80 | "source": "https://github.com/fgrosse/PHPASN1/tree/v2.2.0" 81 | }, 82 | "time": "2020-10-11T16:28:18+00:00" 83 | }, 84 | { 85 | "name": "guzzlehttp/guzzle", 86 | "version": "6.5.x-dev", 87 | "source": { 88 | "type": "git", 89 | "url": "https://github.com/guzzle/guzzle.git", 90 | "reference": "e8ed4dbf49b260ff129ff0e0400718c3269971bf" 91 | }, 92 | "dist": { 93 | "type": "zip", 94 | "url": "https://api.github.com/repos/guzzle/guzzle/zipball/e8ed4dbf49b260ff129ff0e0400718c3269971bf", 95 | "reference": "e8ed4dbf49b260ff129ff0e0400718c3269971bf", 96 | "shasum": "" 97 | }, 98 | "require": { 99 | "ext-json": "*", 100 | "guzzlehttp/promises": "^1.0", 101 | "guzzlehttp/psr7": "^1.6.1", 102 | "php": ">=5.5", 103 | "symfony/polyfill-intl-idn": "^1.17.0" 104 | }, 105 | "require-dev": { 106 | "ext-curl": "*", 107 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", 108 | "psr/log": "^1.1" 109 | }, 110 | "suggest": { 111 | "psr/log": "Required for using the Log middleware" 112 | }, 113 | "type": "library", 114 | "extra": { 115 | "branch-alias": { 116 | "dev-master": "6.5-dev" 117 | } 118 | }, 119 | "autoload": { 120 | "psr-4": { 121 | "GuzzleHttp\\": "src/" 122 | }, 123 | "files": [ 124 | "src/functions_include.php" 125 | ] 126 | }, 127 | "notification-url": "https://packagist.org/downloads/", 128 | "license": [ 129 | "MIT" 130 | ], 131 | "authors": [ 132 | { 133 | "name": "Michael Dowling", 134 | "email": "mtdowling@gmail.com", 135 | "homepage": "https://github.com/mtdowling" 136 | } 137 | ], 138 | "description": "Guzzle is a PHP HTTP client library", 139 | "homepage": "http://guzzlephp.org/", 140 | "keywords": [ 141 | "client", 142 | "curl", 143 | "framework", 144 | "http", 145 | "http client", 146 | "rest", 147 | "web service" 148 | ], 149 | "support": { 150 | "issues": "https://github.com/guzzle/guzzle/issues", 151 | "source": "https://github.com/guzzle/guzzle/tree/6.5" 152 | }, 153 | "funding": [ 154 | { 155 | "url": "https://github.com/GrahamCampbell", 156 | "type": "github" 157 | }, 158 | { 159 | "url": "https://github.com/Nyholm", 160 | "type": "github" 161 | }, 162 | { 163 | "url": "https://github.com/alexeyshockov", 164 | "type": "github" 165 | }, 166 | { 167 | "url": "https://github.com/gmponos", 168 | "type": "github" 169 | }, 170 | { 171 | "url": "https://github.com/sagikazarmark", 172 | "type": "github" 173 | } 174 | ], 175 | "time": "2020-07-02T06:52:04+00:00" 176 | }, 177 | { 178 | "name": "guzzlehttp/promises", 179 | "version": "dev-master", 180 | "source": { 181 | "type": "git", 182 | "url": "https://github.com/guzzle/promises.git", 183 | "reference": "ddfeedfff2a52661429437da0702979f708e6ac6" 184 | }, 185 | "dist": { 186 | "type": "zip", 187 | "url": "https://api.github.com/repos/guzzle/promises/zipball/ddfeedfff2a52661429437da0702979f708e6ac6", 188 | "reference": "ddfeedfff2a52661429437da0702979f708e6ac6", 189 | "shasum": "" 190 | }, 191 | "require": { 192 | "php": ">=5.5" 193 | }, 194 | "require-dev": { 195 | "symfony/phpunit-bridge": "^4.4 || ^5.1" 196 | }, 197 | "default-branch": true, 198 | "type": "library", 199 | "extra": { 200 | "branch-alias": { 201 | "dev-master": "1.4-dev" 202 | } 203 | }, 204 | "autoload": { 205 | "psr-4": { 206 | "GuzzleHttp\\Promise\\": "src/" 207 | }, 208 | "files": [ 209 | "src/functions_include.php" 210 | ] 211 | }, 212 | "notification-url": "https://packagist.org/downloads/", 213 | "license": [ 214 | "MIT" 215 | ], 216 | "authors": [ 217 | { 218 | "name": "Michael Dowling", 219 | "email": "mtdowling@gmail.com", 220 | "homepage": "https://github.com/mtdowling" 221 | } 222 | ], 223 | "description": "Guzzle promises library", 224 | "keywords": [ 225 | "promise" 226 | ], 227 | "support": { 228 | "issues": "https://github.com/guzzle/promises/issues", 229 | "source": "https://github.com/guzzle/promises/tree/master" 230 | }, 231 | "time": "2020-10-19T16:50:15+00:00" 232 | }, 233 | { 234 | "name": "guzzlehttp/psr7", 235 | "version": "1.x-dev", 236 | "source": { 237 | "type": "git", 238 | "url": "https://github.com/guzzle/psr7.git", 239 | "reference": "25f7f893f0b52b7b14e244a16679d72b1f0088de" 240 | }, 241 | "dist": { 242 | "type": "zip", 243 | "url": "https://api.github.com/repos/guzzle/psr7/zipball/25f7f893f0b52b7b14e244a16679d72b1f0088de", 244 | "reference": "25f7f893f0b52b7b14e244a16679d72b1f0088de", 245 | "shasum": "" 246 | }, 247 | "require": { 248 | "php": ">=5.4.0", 249 | "psr/http-message": "~1.0", 250 | "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" 251 | }, 252 | "provide": { 253 | "psr/http-message-implementation": "1.0" 254 | }, 255 | "require-dev": { 256 | "ext-zlib": "*", 257 | "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" 258 | }, 259 | "suggest": { 260 | "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" 261 | }, 262 | "type": "library", 263 | "extra": { 264 | "branch-alias": { 265 | "dev-master": "1.7-dev" 266 | } 267 | }, 268 | "autoload": { 269 | "psr-4": { 270 | "GuzzleHttp\\Psr7\\": "src/" 271 | }, 272 | "files": [ 273 | "src/functions_include.php" 274 | ] 275 | }, 276 | "notification-url": "https://packagist.org/downloads/", 277 | "license": [ 278 | "MIT" 279 | ], 280 | "authors": [ 281 | { 282 | "name": "Michael Dowling", 283 | "email": "mtdowling@gmail.com", 284 | "homepage": "https://github.com/mtdowling" 285 | }, 286 | { 287 | "name": "Tobias Schultze", 288 | "homepage": "https://github.com/Tobion" 289 | } 290 | ], 291 | "description": "PSR-7 message implementation that also provides common utility methods", 292 | "keywords": [ 293 | "http", 294 | "message", 295 | "psr-7", 296 | "request", 297 | "response", 298 | "stream", 299 | "uri", 300 | "url" 301 | ], 302 | "support": { 303 | "issues": "https://github.com/guzzle/psr7/issues", 304 | "source": "https://github.com/guzzle/psr7/tree/1.x" 305 | }, 306 | "time": "2020-10-22T07:42:05+00:00" 307 | }, 308 | { 309 | "name": "kornrunner/ethereum-offline-raw-tx", 310 | "version": "0.2.4", 311 | "source": { 312 | "type": "git", 313 | "url": "https://github.com/kornrunner/php-ethereum-offline-raw-tx.git", 314 | "reference": "24fd98537c53955715b5ca9387f3aa4c7322e690" 315 | }, 316 | "dist": { 317 | "type": "zip", 318 | "url": "https://api.github.com/repos/kornrunner/php-ethereum-offline-raw-tx/zipball/24fd98537c53955715b5ca9387f3aa4c7322e690", 319 | "reference": "24fd98537c53955715b5ca9387f3aa4c7322e690", 320 | "shasum": "" 321 | }, 322 | "require": { 323 | "kornrunner/keccak": "^1.0", 324 | "kornrunner/secp256k1": "^0.1", 325 | "php": ">=7.2", 326 | "web3p/rlp": "^0.3" 327 | }, 328 | "require-dev": { 329 | "phpunit/phpunit": "^8.2" 330 | }, 331 | "type": "library", 332 | "autoload": { 333 | "psr-4": { 334 | "kornrunner\\": "src" 335 | } 336 | }, 337 | "notification-url": "https://packagist.org/downloads/", 338 | "license": [ 339 | "MIT" 340 | ], 341 | "authors": [ 342 | { 343 | "name": "Boris Momcilovic", 344 | "homepage": "https://github.com/kornrunner/php-ethereum-offline-tx" 345 | } 346 | ], 347 | "description": "Pure PHP Ethereum Offline Raw Transaction Signer", 348 | "keywords": [ 349 | "eth", 350 | "ethereum", 351 | "offline", 352 | "transaction", 353 | "tx" 354 | ], 355 | "support": { 356 | "issues": "https://github.com/kornrunner/php-ethereum-offline-raw-tx/issues", 357 | "source": "https://github.com/kornrunner/php-ethereum-offline-raw-tx/tree/0.2.4" 358 | }, 359 | "time": "2020-01-10T11:03:56+00:00" 360 | }, 361 | { 362 | "name": "kornrunner/keccak", 363 | "version": "1.0.3", 364 | "source": { 365 | "type": "git", 366 | "url": "https://github.com/kornrunner/php-keccak.git", 367 | "reference": "ad761f528f4d1e3ce378b8a0841e5f82c9973535" 368 | }, 369 | "dist": { 370 | "type": "zip", 371 | "url": "https://api.github.com/repos/kornrunner/php-keccak/zipball/ad761f528f4d1e3ce378b8a0841e5f82c9973535", 372 | "reference": "ad761f528f4d1e3ce378b8a0841e5f82c9973535", 373 | "shasum": "" 374 | }, 375 | "require": { 376 | "php": ">=7.1.0", 377 | "symfony/polyfill-mbstring": "^1.8" 378 | }, 379 | "require-dev": { 380 | "php-coveralls/php-coveralls": "^2.1", 381 | "phpunit/phpunit": "~7" 382 | }, 383 | "type": "library", 384 | "autoload": { 385 | "psr-4": { 386 | "kornrunner\\": "src" 387 | } 388 | }, 389 | "notification-url": "https://packagist.org/downloads/", 390 | "license": [ 391 | "MIT" 392 | ], 393 | "authors": [ 394 | { 395 | "name": "Boris Momcilovic", 396 | "homepage": "https://github.com/kornrunner/php-keccak" 397 | } 398 | ], 399 | "description": "Pure PHP implementation of Keccak", 400 | "keywords": [ 401 | "keccak", 402 | "sha-3", 403 | "sha3-256" 404 | ], 405 | "support": { 406 | "issues": "https://github.com/kornrunner/php-keccak/issues", 407 | "source": "https://github.com/kornrunner/php-keccak/tree/master" 408 | }, 409 | "time": "2018-07-30T22:16:23+00:00" 410 | }, 411 | { 412 | "name": "kornrunner/secp256k1", 413 | "version": "0.1.2", 414 | "source": { 415 | "type": "git", 416 | "url": "https://github.com/kornrunner/php-secp256k1.git", 417 | "reference": "915f0ef1ec748606a1117b171093266de349b058" 418 | }, 419 | "dist": { 420 | "type": "zip", 421 | "url": "https://api.github.com/repos/kornrunner/php-secp256k1/zipball/915f0ef1ec748606a1117b171093266de349b058", 422 | "reference": "915f0ef1ec748606a1117b171093266de349b058", 423 | "shasum": "" 424 | }, 425 | "require": { 426 | "mdanter/ecc": "^0.5", 427 | "php": ">=7.1" 428 | }, 429 | "require-dev": { 430 | "php-coveralls/php-coveralls": "^2.1", 431 | "phpunit/phpunit": "^7" 432 | }, 433 | "type": "library", 434 | "autoload": { 435 | "psr-4": { 436 | "kornrunner\\": "src/" 437 | } 438 | }, 439 | "notification-url": "https://packagist.org/downloads/", 440 | "license": [ 441 | "MIT" 442 | ], 443 | "authors": [ 444 | { 445 | "name": "Boris Momčilović", 446 | "email": "boris.momcilovic@gmail.com" 447 | } 448 | ], 449 | "description": "Pure PHP secp256k1", 450 | "keywords": [ 451 | "curve", 452 | "ecc", 453 | "elliptic", 454 | "secp256k1" 455 | ], 456 | "support": { 457 | "issues": "https://github.com/kornrunner/php-secp256k1/issues", 458 | "source": "https://github.com/kornrunner/php-secp256k1/tree/master" 459 | }, 460 | "time": "2019-01-16T17:01:51+00:00" 461 | }, 462 | { 463 | "name": "mdanter/ecc", 464 | "version": "v0.5.2", 465 | "source": { 466 | "type": "git", 467 | "url": "https://github.com/phpecc/phpecc.git", 468 | "reference": "b95f25cc1bacc83a9f0ccd375900b7cfd343029e" 469 | }, 470 | "dist": { 471 | "type": "zip", 472 | "url": "https://api.github.com/repos/phpecc/phpecc/zipball/b95f25cc1bacc83a9f0ccd375900b7cfd343029e", 473 | "reference": "b95f25cc1bacc83a9f0ccd375900b7cfd343029e", 474 | "shasum": "" 475 | }, 476 | "require": { 477 | "ext-gmp": "*", 478 | "fgrosse/phpasn1": "^2.0", 479 | "php": "^7.0" 480 | }, 481 | "require-dev": { 482 | "phpunit/phpunit": "^6.0", 483 | "squizlabs/php_codesniffer": "^2.0", 484 | "symfony/yaml": "^2.6|^3.0" 485 | }, 486 | "type": "library", 487 | "autoload": { 488 | "psr-4": { 489 | "Mdanter\\Ecc\\": "src/" 490 | } 491 | }, 492 | "notification-url": "https://packagist.org/downloads/", 493 | "license": [ 494 | "MIT" 495 | ], 496 | "authors": [ 497 | { 498 | "name": "Matyas Danter", 499 | "homepage": "http://matejdanter.com/", 500 | "role": "Author" 501 | }, 502 | { 503 | "name": "Thibaud Fabre", 504 | "email": "thibaud@aztech.io", 505 | "homepage": "http://aztech.io", 506 | "role": "Maintainer" 507 | }, 508 | { 509 | "name": "Thomas Kerin", 510 | "email": "afk11@users.noreply.github.com", 511 | "role": "Maintainer" 512 | } 513 | ], 514 | "description": "PHP Elliptic Curve Cryptography library", 515 | "homepage": "https://github.com/phpecc/phpecc", 516 | "keywords": [ 517 | "Diffie", 518 | "ECDSA", 519 | "Hellman", 520 | "curve", 521 | "ecdh", 522 | "elliptic", 523 | "nistp192", 524 | "nistp224", 525 | "nistp256", 526 | "nistp384", 527 | "nistp521", 528 | "phpecc", 529 | "secp256k1", 530 | "secp256r1" 531 | ], 532 | "support": { 533 | "issues": "https://github.com/phpecc/phpecc/issues", 534 | "source": "https://github.com/phpecc/phpecc/tree/master" 535 | }, 536 | "time": "2018-12-03T18:17:01+00:00" 537 | }, 538 | { 539 | "name": "phpseclib/phpseclib", 540 | "version": "2.0.x-dev", 541 | "source": { 542 | "type": "git", 543 | "url": "https://github.com/phpseclib/phpseclib.git", 544 | "reference": "f6d441e9ac4741a481160a57108443c045d0ef8c" 545 | }, 546 | "dist": { 547 | "type": "zip", 548 | "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/f6d441e9ac4741a481160a57108443c045d0ef8c", 549 | "reference": "f6d441e9ac4741a481160a57108443c045d0ef8c", 550 | "shasum": "" 551 | }, 552 | "require": { 553 | "php": ">=5.3.3" 554 | }, 555 | "require-dev": { 556 | "phing/phing": "~2.7", 557 | "phpunit/phpunit": "^4.8.35|^5.7|^6.0", 558 | "squizlabs/php_codesniffer": "~2.0" 559 | }, 560 | "suggest": { 561 | "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", 562 | "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", 563 | "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", 564 | "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." 565 | }, 566 | "type": "library", 567 | "autoload": { 568 | "files": [ 569 | "phpseclib/bootstrap.php" 570 | ], 571 | "psr-4": { 572 | "phpseclib\\": "phpseclib/" 573 | } 574 | }, 575 | "notification-url": "https://packagist.org/downloads/", 576 | "license": [ 577 | "MIT" 578 | ], 579 | "authors": [ 580 | { 581 | "name": "Jim Wigginton", 582 | "email": "terrafrost@php.net", 583 | "role": "Lead Developer" 584 | }, 585 | { 586 | "name": "Patrick Monnerat", 587 | "email": "pm@datasphere.ch", 588 | "role": "Developer" 589 | }, 590 | { 591 | "name": "Andreas Fischer", 592 | "email": "bantu@phpbb.com", 593 | "role": "Developer" 594 | }, 595 | { 596 | "name": "Hans-Jürgen Petrich", 597 | "email": "petrich@tronic-media.com", 598 | "role": "Developer" 599 | }, 600 | { 601 | "name": "Graham Campbell", 602 | "email": "graham@alt-three.com", 603 | "role": "Developer" 604 | } 605 | ], 606 | "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", 607 | "homepage": "http://phpseclib.sourceforge.net", 608 | "keywords": [ 609 | "BigInteger", 610 | "aes", 611 | "asn.1", 612 | "asn1", 613 | "blowfish", 614 | "crypto", 615 | "cryptography", 616 | "encryption", 617 | "rsa", 618 | "security", 619 | "sftp", 620 | "signature", 621 | "signing", 622 | "ssh", 623 | "twofish", 624 | "x.509", 625 | "x509" 626 | ], 627 | "support": { 628 | "issues": "https://github.com/phpseclib/phpseclib/issues", 629 | "source": "https://github.com/phpseclib/phpseclib/tree/2.0" 630 | }, 631 | "funding": [ 632 | { 633 | "url": "https://github.com/terrafrost", 634 | "type": "github" 635 | }, 636 | { 637 | "url": "https://www.patreon.com/phpseclib", 638 | "type": "patreon" 639 | }, 640 | { 641 | "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", 642 | "type": "tidelift" 643 | } 644 | ], 645 | "time": "2020-11-21T17:59:51+00:00" 646 | }, 647 | { 648 | "name": "psr/http-message", 649 | "version": "dev-master", 650 | "source": { 651 | "type": "git", 652 | "url": "https://github.com/php-fig/http-message.git", 653 | "reference": "efd67d1dc14a7ef4fc4e518e7dee91c271d524e4" 654 | }, 655 | "dist": { 656 | "type": "zip", 657 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/efd67d1dc14a7ef4fc4e518e7dee91c271d524e4", 658 | "reference": "efd67d1dc14a7ef4fc4e518e7dee91c271d524e4", 659 | "shasum": "" 660 | }, 661 | "require": { 662 | "php": ">=5.3.0" 663 | }, 664 | "default-branch": true, 665 | "type": "library", 666 | "extra": { 667 | "branch-alias": { 668 | "dev-master": "1.0.x-dev" 669 | } 670 | }, 671 | "autoload": { 672 | "psr-4": { 673 | "Psr\\Http\\Message\\": "src/" 674 | } 675 | }, 676 | "notification-url": "https://packagist.org/downloads/", 677 | "license": [ 678 | "MIT" 679 | ], 680 | "authors": [ 681 | { 682 | "name": "PHP-FIG", 683 | "homepage": "http://www.php-fig.org/" 684 | } 685 | ], 686 | "description": "Common interface for HTTP messages", 687 | "homepage": "https://github.com/php-fig/http-message", 688 | "keywords": [ 689 | "http", 690 | "http-message", 691 | "psr", 692 | "psr-7", 693 | "request", 694 | "response" 695 | ], 696 | "support": { 697 | "source": "https://github.com/php-fig/http-message/tree/master" 698 | }, 699 | "time": "2019-08-29T13:16:46+00:00" 700 | }, 701 | { 702 | "name": "ralouphie/getallheaders", 703 | "version": "3.0.3", 704 | "source": { 705 | "type": "git", 706 | "url": "https://github.com/ralouphie/getallheaders.git", 707 | "reference": "120b605dfeb996808c31b6477290a714d356e822" 708 | }, 709 | "dist": { 710 | "type": "zip", 711 | "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", 712 | "reference": "120b605dfeb996808c31b6477290a714d356e822", 713 | "shasum": "" 714 | }, 715 | "require": { 716 | "php": ">=5.6" 717 | }, 718 | "require-dev": { 719 | "php-coveralls/php-coveralls": "^2.1", 720 | "phpunit/phpunit": "^5 || ^6.5" 721 | }, 722 | "type": "library", 723 | "autoload": { 724 | "files": [ 725 | "src/getallheaders.php" 726 | ] 727 | }, 728 | "notification-url": "https://packagist.org/downloads/", 729 | "license": [ 730 | "MIT" 731 | ], 732 | "authors": [ 733 | { 734 | "name": "Ralph Khattar", 735 | "email": "ralph.khattar@gmail.com" 736 | } 737 | ], 738 | "description": "A polyfill for getallheaders.", 739 | "support": { 740 | "issues": "https://github.com/ralouphie/getallheaders/issues", 741 | "source": "https://github.com/ralouphie/getallheaders/tree/develop" 742 | }, 743 | "time": "2019-03-08T08:55:37+00:00" 744 | }, 745 | { 746 | "name": "sc0vu/web3.php", 747 | "version": "0.1.4", 748 | "source": { 749 | "type": "git", 750 | "url": "https://github.com/sc0Vu/web3.php.git", 751 | "reference": "1fb7762eb7763b0ccdbac1483819606e9edc6a49" 752 | }, 753 | "dist": { 754 | "type": "zip", 755 | "url": "https://api.github.com/repos/sc0Vu/web3.php/zipball/1fb7762eb7763b0ccdbac1483819606e9edc6a49", 756 | "reference": "1fb7762eb7763b0ccdbac1483819606e9edc6a49", 757 | "shasum": "" 758 | }, 759 | "require": { 760 | "guzzlehttp/guzzle": "~6.0", 761 | "kornrunner/keccak": "~1.0", 762 | "php": "^7.1", 763 | "phpseclib/phpseclib": "~2.0.11" 764 | }, 765 | "require-dev": { 766 | "phpunit/phpunit": "~6.0" 767 | }, 768 | "type": "library", 769 | "autoload": { 770 | "psr-4": { 771 | "Web3\\": "src/" 772 | } 773 | }, 774 | "notification-url": "https://packagist.org/downloads/", 775 | "license": [ 776 | "MIT" 777 | ], 778 | "authors": [ 779 | { 780 | "name": "sc0Vu", 781 | "email": "alk03073135@gmail.com" 782 | } 783 | ], 784 | "description": "Ethereum web3 interface.", 785 | "support": { 786 | "issues": "https://github.com/sc0Vu/web3.php/issues", 787 | "source": "https://github.com/sc0Vu/web3.php/tree/master" 788 | }, 789 | "time": "2018-06-24T14:45:20+00:00" 790 | }, 791 | { 792 | "name": "simplito/bigint-wrapper-php", 793 | "version": "1.0.0", 794 | "source": { 795 | "type": "git", 796 | "url": "https://github.com/simplito/bigint-wrapper-php.git", 797 | "reference": "cf21ec76d33f103add487b3eadbd9f5033a25930" 798 | }, 799 | "dist": { 800 | "type": "zip", 801 | "url": "https://api.github.com/repos/simplito/bigint-wrapper-php/zipball/cf21ec76d33f103add487b3eadbd9f5033a25930", 802 | "reference": "cf21ec76d33f103add487b3eadbd9f5033a25930", 803 | "shasum": "" 804 | }, 805 | "type": "library", 806 | "autoload": { 807 | "psr-4": { 808 | "BI\\": "lib/" 809 | } 810 | }, 811 | "notification-url": "https://packagist.org/downloads/", 812 | "license": [ 813 | "MIT" 814 | ], 815 | "authors": [ 816 | { 817 | "name": "Simplito Team", 818 | "email": "s.smyczynski@simplito.com", 819 | "homepage": "https://simplito.com" 820 | } 821 | ], 822 | "description": "Common interface for php_gmp and php_bcmath modules", 823 | "support": { 824 | "issues": "https://github.com/simplito/bigint-wrapper-php/issues", 825 | "source": "https://github.com/simplito/bigint-wrapper-php/tree/1.0.0" 826 | }, 827 | "time": "2018-02-27T12:38:08+00:00" 828 | }, 829 | { 830 | "name": "simplito/bn-php", 831 | "version": "1.1.2", 832 | "source": { 833 | "type": "git", 834 | "url": "https://github.com/simplito/bn-php.git", 835 | "reference": "e852fcd27e4acbc32459606d7606e45a85e42465" 836 | }, 837 | "dist": { 838 | "type": "zip", 839 | "url": "https://api.github.com/repos/simplito/bn-php/zipball/e852fcd27e4acbc32459606d7606e45a85e42465", 840 | "reference": "e852fcd27e4acbc32459606d7606e45a85e42465", 841 | "shasum": "" 842 | }, 843 | "require": { 844 | "simplito/bigint-wrapper-php": "~1.0.0" 845 | }, 846 | "require-dev": { 847 | "phpunit/phpunit": "*" 848 | }, 849 | "type": "library", 850 | "autoload": { 851 | "psr-4": { 852 | "BN\\": "lib/" 853 | } 854 | }, 855 | "notification-url": "https://packagist.org/downloads/", 856 | "license": [ 857 | "MIT" 858 | ], 859 | "authors": [ 860 | { 861 | "name": "Simplito Team", 862 | "email": "s.smyczynski@simplito.com", 863 | "homepage": "https://simplito.com" 864 | } 865 | ], 866 | "description": "Big number implementation compatible with bn.js", 867 | "support": { 868 | "issues": "https://github.com/simplito/bn-php/issues", 869 | "source": "https://github.com/simplito/bn-php/tree/1.1.2" 870 | }, 871 | "time": "2018-04-12T11:07:43+00:00" 872 | }, 873 | { 874 | "name": "simplito/elliptic-php", 875 | "version": "1.0.6", 876 | "source": { 877 | "type": "git", 878 | "url": "https://github.com/simplito/elliptic-php.git", 879 | "reference": "15652609aa55968d56685c2a9120535ccdc00fd9" 880 | }, 881 | "dist": { 882 | "type": "zip", 883 | "url": "https://api.github.com/repos/simplito/elliptic-php/zipball/15652609aa55968d56685c2a9120535ccdc00fd9", 884 | "reference": "15652609aa55968d56685c2a9120535ccdc00fd9", 885 | "shasum": "" 886 | }, 887 | "require": { 888 | "ext-gmp": "*", 889 | "simplito/bn-php": "~1.1.0" 890 | }, 891 | "require-dev": { 892 | "phpbench/phpbench": "@dev", 893 | "phpunit/phpunit": "*" 894 | }, 895 | "type": "library", 896 | "autoload": { 897 | "psr-4": { 898 | "Elliptic\\": "lib/" 899 | } 900 | }, 901 | "notification-url": "https://packagist.org/downloads/", 902 | "license": [ 903 | "MIT" 904 | ], 905 | "authors": [ 906 | { 907 | "name": "Simplito Team", 908 | "email": "s.smyczynski@simplito.com", 909 | "homepage": "https://simplito.com" 910 | } 911 | ], 912 | "description": "Fast elliptic curve cryptography", 913 | "homepage": "https://github.com/simplito/elliptic-php", 914 | "keywords": [ 915 | "Curve25519", 916 | "ECDSA", 917 | "Ed25519", 918 | "EdDSA", 919 | "cryptography", 920 | "curve", 921 | "ecc", 922 | "ecdh", 923 | "elliptic", 924 | "nistp192", 925 | "nistp224", 926 | "nistp256", 927 | "nistp384", 928 | "nistp521", 929 | "secp256k1" 930 | ], 931 | "support": { 932 | "issues": "https://github.com/simplito/elliptic-php/issues", 933 | "source": "https://github.com/simplito/elliptic-php/tree/1.0.6" 934 | }, 935 | "time": "2019-11-14T13:43:07+00:00" 936 | }, 937 | { 938 | "name": "symfony/polyfill-intl-idn", 939 | "version": "dev-main", 940 | "source": { 941 | "type": "git", 942 | "url": "https://github.com/symfony/polyfill-intl-idn.git", 943 | "reference": "4c489fd2bc812f64494645354e0fb68d355ce3c7" 944 | }, 945 | "dist": { 946 | "type": "zip", 947 | "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/4c489fd2bc812f64494645354e0fb68d355ce3c7", 948 | "reference": "4c489fd2bc812f64494645354e0fb68d355ce3c7", 949 | "shasum": "" 950 | }, 951 | "require": { 952 | "php": ">=7.1", 953 | "symfony/polyfill-intl-normalizer": "^1.10", 954 | "symfony/polyfill-php72": "^1.10" 955 | }, 956 | "suggest": { 957 | "ext-intl": "For best performance" 958 | }, 959 | "default-branch": true, 960 | "type": "library", 961 | "extra": { 962 | "branch-alias": { 963 | "dev-main": "1.21-dev" 964 | }, 965 | "thanks": { 966 | "name": "symfony/polyfill", 967 | "url": "https://github.com/symfony/polyfill" 968 | } 969 | }, 970 | "autoload": { 971 | "psr-4": { 972 | "Symfony\\Polyfill\\Intl\\Idn\\": "" 973 | }, 974 | "files": [ 975 | "bootstrap.php" 976 | ] 977 | }, 978 | "notification-url": "https://packagist.org/downloads/", 979 | "license": [ 980 | "MIT" 981 | ], 982 | "authors": [ 983 | { 984 | "name": "Laurent Bassin", 985 | "email": "laurent@bassin.info" 986 | }, 987 | { 988 | "name": "Trevor Rowbotham", 989 | "email": "trevor.rowbotham@pm.me" 990 | }, 991 | { 992 | "name": "Symfony Community", 993 | "homepage": "https://symfony.com/contributors" 994 | } 995 | ], 996 | "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", 997 | "homepage": "https://symfony.com", 998 | "keywords": [ 999 | "compatibility", 1000 | "idn", 1001 | "intl", 1002 | "polyfill", 1003 | "portable", 1004 | "shim" 1005 | ], 1006 | "support": { 1007 | "source": "https://github.com/symfony/polyfill-intl-idn/tree/main" 1008 | }, 1009 | "funding": [ 1010 | { 1011 | "url": "https://symfony.com/sponsor", 1012 | "type": "custom" 1013 | }, 1014 | { 1015 | "url": "https://github.com/fabpot", 1016 | "type": "github" 1017 | }, 1018 | { 1019 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1020 | "type": "tidelift" 1021 | } 1022 | ], 1023 | "time": "2020-10-26T13:35:45+00:00" 1024 | }, 1025 | { 1026 | "name": "symfony/polyfill-intl-normalizer", 1027 | "version": "dev-main", 1028 | "source": { 1029 | "type": "git", 1030 | "url": "https://github.com/symfony/polyfill-intl-normalizer.git", 1031 | "reference": "69609f9f06790591b4b13a45ee117e7bab6395aa" 1032 | }, 1033 | "dist": { 1034 | "type": "zip", 1035 | "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/69609f9f06790591b4b13a45ee117e7bab6395aa", 1036 | "reference": "69609f9f06790591b4b13a45ee117e7bab6395aa", 1037 | "shasum": "" 1038 | }, 1039 | "require": { 1040 | "php": ">=7.1" 1041 | }, 1042 | "suggest": { 1043 | "ext-intl": "For best performance" 1044 | }, 1045 | "default-branch": true, 1046 | "type": "library", 1047 | "extra": { 1048 | "branch-alias": { 1049 | "dev-main": "1.21-dev" 1050 | }, 1051 | "thanks": { 1052 | "name": "symfony/polyfill", 1053 | "url": "https://github.com/symfony/polyfill" 1054 | } 1055 | }, 1056 | "autoload": { 1057 | "psr-4": { 1058 | "Symfony\\Polyfill\\Intl\\Normalizer\\": "" 1059 | }, 1060 | "files": [ 1061 | "bootstrap.php" 1062 | ], 1063 | "classmap": [ 1064 | "Resources/stubs" 1065 | ] 1066 | }, 1067 | "notification-url": "https://packagist.org/downloads/", 1068 | "license": [ 1069 | "MIT" 1070 | ], 1071 | "authors": [ 1072 | { 1073 | "name": "Nicolas Grekas", 1074 | "email": "p@tchwork.com" 1075 | }, 1076 | { 1077 | "name": "Symfony Community", 1078 | "homepage": "https://symfony.com/contributors" 1079 | } 1080 | ], 1081 | "description": "Symfony polyfill for intl's Normalizer class and related functions", 1082 | "homepage": "https://symfony.com", 1083 | "keywords": [ 1084 | "compatibility", 1085 | "intl", 1086 | "normalizer", 1087 | "polyfill", 1088 | "portable", 1089 | "shim" 1090 | ], 1091 | "support": { 1092 | "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/main" 1093 | }, 1094 | "funding": [ 1095 | { 1096 | "url": "https://symfony.com/sponsor", 1097 | "type": "custom" 1098 | }, 1099 | { 1100 | "url": "https://github.com/fabpot", 1101 | "type": "github" 1102 | }, 1103 | { 1104 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1105 | "type": "tidelift" 1106 | } 1107 | ], 1108 | "time": "2020-10-26T13:35:45+00:00" 1109 | }, 1110 | { 1111 | "name": "symfony/polyfill-mbstring", 1112 | "version": "dev-main", 1113 | "source": { 1114 | "type": "git", 1115 | "url": "https://github.com/symfony/polyfill-mbstring.git", 1116 | "reference": "401c9d9d3400c53a8f1a39425f0543406c137a43" 1117 | }, 1118 | "dist": { 1119 | "type": "zip", 1120 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/401c9d9d3400c53a8f1a39425f0543406c137a43", 1121 | "reference": "401c9d9d3400c53a8f1a39425f0543406c137a43", 1122 | "shasum": "" 1123 | }, 1124 | "require": { 1125 | "php": ">=7.1" 1126 | }, 1127 | "suggest": { 1128 | "ext-mbstring": "For best performance" 1129 | }, 1130 | "default-branch": true, 1131 | "type": "library", 1132 | "extra": { 1133 | "branch-alias": { 1134 | "dev-main": "1.21-dev" 1135 | }, 1136 | "thanks": { 1137 | "name": "symfony/polyfill", 1138 | "url": "https://github.com/symfony/polyfill" 1139 | } 1140 | }, 1141 | "autoload": { 1142 | "psr-4": { 1143 | "Symfony\\Polyfill\\Mbstring\\": "" 1144 | }, 1145 | "files": [ 1146 | "bootstrap.php" 1147 | ] 1148 | }, 1149 | "notification-url": "https://packagist.org/downloads/", 1150 | "license": [ 1151 | "MIT" 1152 | ], 1153 | "authors": [ 1154 | { 1155 | "name": "Nicolas Grekas", 1156 | "email": "p@tchwork.com" 1157 | }, 1158 | { 1159 | "name": "Symfony Community", 1160 | "homepage": "https://symfony.com/contributors" 1161 | } 1162 | ], 1163 | "description": "Symfony polyfill for the Mbstring extension", 1164 | "homepage": "https://symfony.com", 1165 | "keywords": [ 1166 | "compatibility", 1167 | "mbstring", 1168 | "polyfill", 1169 | "portable", 1170 | "shim" 1171 | ], 1172 | "support": { 1173 | "source": "https://github.com/symfony/polyfill-mbstring/tree/main" 1174 | }, 1175 | "funding": [ 1176 | { 1177 | "url": "https://symfony.com/sponsor", 1178 | "type": "custom" 1179 | }, 1180 | { 1181 | "url": "https://github.com/fabpot", 1182 | "type": "github" 1183 | }, 1184 | { 1185 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1186 | "type": "tidelift" 1187 | } 1188 | ], 1189 | "time": "2020-10-26T13:35:45+00:00" 1190 | }, 1191 | { 1192 | "name": "symfony/polyfill-php72", 1193 | "version": "dev-main", 1194 | "source": { 1195 | "type": "git", 1196 | "url": "https://github.com/symfony/polyfill-php72.git", 1197 | "reference": "4a4465f57b476085b62e74087f74ae2e753ff633" 1198 | }, 1199 | "dist": { 1200 | "type": "zip", 1201 | "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/4a4465f57b476085b62e74087f74ae2e753ff633", 1202 | "reference": "4a4465f57b476085b62e74087f74ae2e753ff633", 1203 | "shasum": "" 1204 | }, 1205 | "require": { 1206 | "php": ">=7.1" 1207 | }, 1208 | "default-branch": true, 1209 | "type": "library", 1210 | "extra": { 1211 | "branch-alias": { 1212 | "dev-main": "1.21-dev" 1213 | }, 1214 | "thanks": { 1215 | "name": "symfony/polyfill", 1216 | "url": "https://github.com/symfony/polyfill" 1217 | } 1218 | }, 1219 | "autoload": { 1220 | "psr-4": { 1221 | "Symfony\\Polyfill\\Php72\\": "" 1222 | }, 1223 | "files": [ 1224 | "bootstrap.php" 1225 | ] 1226 | }, 1227 | "notification-url": "https://packagist.org/downloads/", 1228 | "license": [ 1229 | "MIT" 1230 | ], 1231 | "authors": [ 1232 | { 1233 | "name": "Nicolas Grekas", 1234 | "email": "p@tchwork.com" 1235 | }, 1236 | { 1237 | "name": "Symfony Community", 1238 | "homepage": "https://symfony.com/contributors" 1239 | } 1240 | ], 1241 | "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", 1242 | "homepage": "https://symfony.com", 1243 | "keywords": [ 1244 | "compatibility", 1245 | "polyfill", 1246 | "portable", 1247 | "shim" 1248 | ], 1249 | "support": { 1250 | "source": "https://github.com/symfony/polyfill-php72/tree/main" 1251 | }, 1252 | "funding": [ 1253 | { 1254 | "url": "https://symfony.com/sponsor", 1255 | "type": "custom" 1256 | }, 1257 | { 1258 | "url": "https://github.com/fabpot", 1259 | "type": "github" 1260 | }, 1261 | { 1262 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1263 | "type": "tidelift" 1264 | } 1265 | ], 1266 | "time": "2020-10-26T13:35:45+00:00" 1267 | }, 1268 | { 1269 | "name": "web3p/ethereum-util", 1270 | "version": "0.1.2", 1271 | "source": { 1272 | "type": "git", 1273 | "url": "https://github.com/web3p/ethereum-util.git", 1274 | "reference": "c7b5edd1a3ca20d0dae93f6fb9d253c61dfb73c6" 1275 | }, 1276 | "dist": { 1277 | "type": "zip", 1278 | "url": "https://api.github.com/repos/web3p/ethereum-util/zipball/c7b5edd1a3ca20d0dae93f6fb9d253c61dfb73c6", 1279 | "reference": "c7b5edd1a3ca20d0dae93f6fb9d253c61dfb73c6", 1280 | "shasum": "" 1281 | }, 1282 | "require": { 1283 | "kornrunner/keccak": "~1", 1284 | "php": "^7.1", 1285 | "simplito/elliptic-php": "~1.0.6" 1286 | }, 1287 | "require-dev": { 1288 | "phpunit/phpunit": "^6.1" 1289 | }, 1290 | "type": "library", 1291 | "autoload": { 1292 | "psr-4": { 1293 | "Web3p\\EthereumUtil\\": "src/" 1294 | } 1295 | }, 1296 | "notification-url": "https://packagist.org/downloads/", 1297 | "license": [ 1298 | "MIT" 1299 | ], 1300 | "authors": [ 1301 | { 1302 | "name": "sc0Vu", 1303 | "email": "alk03073135@gmail.com" 1304 | } 1305 | ], 1306 | "description": "A collection of utility functions for Ethereum written in PHP.", 1307 | "support": { 1308 | "issues": "https://github.com/web3p/ethereum-util/issues", 1309 | "source": "https://github.com/web3p/ethereum-util/tree/master" 1310 | }, 1311 | "time": "2019-11-23T08:43:24+00:00" 1312 | }, 1313 | { 1314 | "name": "web3p/rlp", 1315 | "version": "0.3.2", 1316 | "source": { 1317 | "type": "git", 1318 | "url": "https://github.com/web3p/rlp.git", 1319 | "reference": "bc9e29f7a1f658408f25322ea21ff5687a851470" 1320 | }, 1321 | "dist": { 1322 | "type": "zip", 1323 | "url": "https://api.github.com/repos/web3p/rlp/zipball/bc9e29f7a1f658408f25322ea21ff5687a851470", 1324 | "reference": "bc9e29f7a1f658408f25322ea21ff5687a851470", 1325 | "shasum": "" 1326 | }, 1327 | "require-dev": { 1328 | "phpunit/phpunit": "~7" 1329 | }, 1330 | "type": "library", 1331 | "autoload": { 1332 | "psr-4": { 1333 | "Web3p\\RLP\\": "src/" 1334 | } 1335 | }, 1336 | "notification-url": "https://packagist.org/downloads/", 1337 | "license": [ 1338 | "MIT" 1339 | ], 1340 | "authors": [ 1341 | { 1342 | "name": "sc0Vu", 1343 | "email": "alk03073135@gmail.com" 1344 | } 1345 | ], 1346 | "description": "Recursive Length Prefix Encoding in PHP.", 1347 | "support": { 1348 | "issues": "https://github.com/web3p/rlp/issues", 1349 | "source": "https://github.com/web3p/rlp/tree/master" 1350 | }, 1351 | "time": "2019-11-23T08:20:30+00:00" 1352 | } 1353 | ], 1354 | "packages-dev": [], 1355 | "aliases": [], 1356 | "minimum-stability": "dev", 1357 | "stability-flags": [], 1358 | "prefer-stable": false, 1359 | "prefer-lowest": false, 1360 | "platform": [], 1361 | "platform-dev": [], 1362 | "plugin-api-version": "2.0.0" 1363 | } 1364 | -------------------------------------------------------------------------------- /src/Foundation/Contracts/EventLogBuilderInterface.php: -------------------------------------------------------------------------------- 1 | web3 = $web3; 54 | $this->abi = $abi; 55 | $this->contractAddress = $contractAddress; 56 | $this->contract = new Contract($web3->getProvider(), $abi); 57 | $this->eth = new Eth($web3); 58 | $this->generateTopics(); 59 | } 60 | 61 | /** 62 | * @param string $method 63 | * @param array $arguments 64 | * @return array|null 65 | */ 66 | public function call(string $method, array $arguments = []): array 67 | { 68 | $params = [$method]; 69 | foreach ($arguments as $argument) 70 | { 71 | $params[] = $argument; 72 | } 73 | $result = null; 74 | $params[] = function ($err, $response) use (&$result) { 75 | if ($err) 76 | { 77 | throw $err; 78 | } 79 | $result = $response; 80 | }; 81 | call_user_func_array([$this->contract->at($this->contractAddress), 'call'], $params); 82 | 83 | return $result; 84 | } 85 | 86 | /** 87 | * @return array 88 | */ 89 | public function getTopics() 90 | { 91 | return $this->topics; 92 | } 93 | 94 | /** 95 | * @return Contract 96 | */ 97 | public function getContract() 98 | { 99 | return $this->contract; 100 | } 101 | 102 | /** 103 | * @return Eth 104 | */ 105 | public function getEth() 106 | { 107 | return $this->eth; 108 | } 109 | 110 | /** 111 | * @return Web3 112 | */ 113 | public function getWeb3() 114 | { 115 | return $this->web3; 116 | } 117 | 118 | private function generateTopics() 119 | { 120 | $events = $this->contract->getEvents(); 121 | foreach ($events as $key => $event) 122 | { 123 | $topic = sprintf("%s(%s)", $key, implode(',', array_column($event['inputs'], 'type'))); 124 | $this->topics[$key] = Keccak::hash($topic, 256); 125 | } 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /src/Foundation/Eth.php: -------------------------------------------------------------------------------- 1 | call('getTransactionCount', [$address, $blockParameter]) 16 | ->toString() 17 | ; 18 | } 19 | 20 | public function gasPrice() 21 | { 22 | return $this->call('gasPrice') 23 | ->toString() 24 | ; 25 | } 26 | 27 | public function sendRawTransaction(string $hash) 28 | { 29 | return (string)$this->call('sendRawTransaction', [$hash]); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Foundation/EthBase.php: -------------------------------------------------------------------------------- 1 | web3 = $web3; 33 | $this->eth = new BaseEth($this->web3->getProvider()); 34 | } 35 | 36 | /** 37 | * @param string $method 38 | * @param array $arguments 39 | * @return array|null 40 | */ 41 | public function call(string $method, array $arguments = []) 42 | { 43 | foreach ($arguments as $argument) 44 | { 45 | $params[] = $argument; 46 | } 47 | $result = null; 48 | $params[] = function ($err, $response) use (&$result) { 49 | if ($err) 50 | { 51 | throw $err; 52 | } 53 | $result = $response; 54 | }; 55 | call_user_func_array([$this->eth, $method], $params); 56 | 57 | return $result; 58 | } 59 | 60 | public function addCall(string $id, string $method, array $arguments = []) 61 | { 62 | $this->batchCalls[$id] = ['method' => $method, 'params' => $arguments]; 63 | return $this; 64 | } 65 | 66 | 67 | public function batchCall() 68 | { 69 | $this->eth->batch(true); 70 | $callResultMap = []; 71 | $counter = 0; 72 | foreach ($this->batchCalls as $key => $call) 73 | { 74 | $callResultMap[$counter] = $key; 75 | call_user_func_array([$this->eth, $call['method']], $call['params']); 76 | $counter++; 77 | } 78 | 79 | $result = null; 80 | $this->eth->getProvider() 81 | ->execute(function ($err, $responses) use (&$result, $callResultMap) { 82 | if ($err) 83 | { 84 | throw $err; 85 | } 86 | 87 | foreach ($responses as $key => $response) 88 | { 89 | $result[$callResultMap[$key]] = $response; 90 | } 91 | }) 92 | ; 93 | 94 | return $result; 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /src/Foundation/EventLogBuilder.php: -------------------------------------------------------------------------------- 1 | blockHash; 23 | $tx['blockNumber'] = hexdec($log->blockNumber); 24 | $tx['data'] = sprintf('%u', hexdec($log->data)); 25 | $tx['contract'] = $log->address; 26 | $tx['from'] = $log->topics[1]; 27 | $tx['to'] = $log->topics[2]; 28 | $tx['transactionHash'] = $log->transactionHash; 29 | $tx['transactionIndex'] = hexdec($log->transactionIndex); 30 | $tx['type'] = $this->checkTopicFunction($log->topics[0]); 31 | 32 | return $tx; 33 | } 34 | 35 | public function setContract(ERC20 $contract) 36 | { 37 | $this->contract = $contract; 38 | } 39 | 40 | private function checkTopicFunction($hash) 41 | { 42 | return array_search(str_ireplace('0x', '', $hash), $this->contract->getTopics()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Foundation/StandardERC20Token.php: -------------------------------------------------------------------------------- 1 | 50000, 22 | 'transfer' => 50000, 23 | 'transferFrom' => 50000, 24 | 'default' => 50000, 25 | ]; 26 | 27 | public function __construct($ethClient, $timeout = 3) 28 | { 29 | $abi = file_get_contents(__DIR__ . '/../resources/erc20.abi.json'); 30 | parent::__construct($this->contractAddress, $abi, $ethClient, $timeout); 31 | } 32 | 33 | protected $gasPriceModifier = 0; 34 | 35 | public function name(): string 36 | { 37 | return $this->call('name')[0]; 38 | } 39 | 40 | public function symbol(): string 41 | { 42 | return $this->call('symbol')[0]; 43 | } 44 | 45 | public function decimals(): int 46 | { 47 | if ($this->decimals) 48 | { 49 | return $this->decimals; 50 | } 51 | return $this->decimals = intval($this->call('decimals')[0]->toString()); 52 | } 53 | 54 | /** 55 | * @param string $address 56 | * @return string 57 | */ 58 | public function balanceOf(string $address) 59 | { 60 | return Number::scaleDown($this->call('balanceOf', [$address])['balance']->toString(), $this->decimals()); 61 | } 62 | 63 | /** 64 | * @param string $from 65 | * @param string $to 66 | * @param float $amount 67 | * @return Transaction\Transaction 68 | */ 69 | public function transfer(string $from, string $to, float $amount, string $gasLimit = 'default', string $gasPrice = 'default') 70 | { 71 | $amount = Number::scaleUp($amount, $this->decimals()); 72 | $data = $this->buildTransferData($to, $amount); 73 | $nonce = Number::toHex($this->getEth() 74 | ->getTransactionCount($from, 'pending')); 75 | if (strtolower($gasLimit) === 'default') 76 | { 77 | $gasLimit = $this->getGasLimit('transfer'); 78 | } 79 | if (strtolower($gasPrice) === 'default') 80 | { 81 | $gasPrice = $this->getSafeGasPrice(); 82 | } 83 | 84 | return (new TransactionBuilder()) 85 | ->setEth($this->getEth()) 86 | ->to($this->contractAddress) 87 | ->nonce($nonce) 88 | ->gasPrice($gasPrice) 89 | ->gasLimit($gasLimit) 90 | ->data($data) 91 | ->amount(0) 92 | ->build() 93 | ; 94 | 95 | } 96 | 97 | public function buildTransferData(string $to, $amount) 98 | { 99 | return $this->getContract() 100 | ->at($this->contractAddress) 101 | ->getData('transfer', $to, $amount) 102 | ; 103 | } 104 | 105 | public function approve(string $ownerAddress, string $spenderAddress, string $amount, string $gasLimit = 'default', string $gasPrice = 'default') 106 | { 107 | $amount = Number::scaleUp($amount, $this->decimals()); 108 | $data = $this->buildApproveData($spenderAddress, $amount); 109 | $nonce = Number::toHex($this->getEth() 110 | ->getTransactionCount($ownerAddress, 'pending')); 111 | if (strtolower($gasLimit) === 'default') 112 | { 113 | $gasLimit = $this->getGasLimit('approve'); 114 | } 115 | if (strtolower($gasPrice) === 'default') 116 | { 117 | $gasPrice = $this->getSafeGasPrice(); 118 | } 119 | 120 | return (new TransactionBuilder()) 121 | ->setEth($this->getEth()) 122 | ->to($this->contractAddress) 123 | ->nonce($nonce) 124 | ->gasPrice($gasPrice) 125 | ->gasLimit($gasLimit) 126 | ->data($data) 127 | ->amount(0) 128 | ->build() 129 | ; 130 | } 131 | 132 | public function buildApproveData(string $to, $amount) 133 | { 134 | return $this->getContract() 135 | ->at($this->contractAddress) 136 | ->getData('approve', $to, $amount) 137 | ; 138 | } 139 | 140 | public function allowance(string $ownerAddress, string $spenderAddress) 141 | { 142 | return Number::scaleDown($this->call('allowance', [$ownerAddress, $spenderAddress])[0]->toString(), $this->decimals()); 143 | } 144 | 145 | /** 146 | * @param string $spender 147 | * @param string $from 148 | * @param string $to 149 | * @param float $amount 150 | * @return Transaction\Transaction 151 | */ 152 | public function transferFrom(string $spender, string $from, string $to, float $amount, string $gasLimit = 'default', string $gasPrice = 'default') 153 | { 154 | $amount = Number::scaleUp($amount, $this->decimals()); 155 | $data = $this->buildTransferFromData($from, $to, $amount); 156 | $nonce = Number::toHex($this->getEth() 157 | ->getTransactionCount($spender, 'pending')); 158 | if (strtolower($gasLimit) === 'default') 159 | { 160 | $gasLimit = $this->getGasLimit('transferFrom'); 161 | } 162 | if (strtolower($gasPrice) === 'default') 163 | { 164 | $gasPrice = $this->getSafeGasPrice(); 165 | } 166 | 167 | return (new TransactionBuilder()) 168 | ->setEth($this->getEth()) 169 | ->to($this->contractAddress) 170 | ->nonce($nonce) 171 | ->gasPrice($gasPrice) 172 | ->gasLimit($gasLimit) 173 | ->data($data) 174 | ->amount(0) 175 | ->build() 176 | ; 177 | 178 | } 179 | 180 | public function buildTransferFromData(string $from, string $to, $amount) 181 | { 182 | return $this->getContract() 183 | ->at($this->contractAddress) 184 | ->getData('transferFrom', $from, $to, $amount) 185 | ; 186 | } 187 | 188 | public function getEventLogFormatter(): EventLogBuilderInterface 189 | { 190 | $builder = new EventLogBuilder(); 191 | $builder->setContract($this); 192 | return $builder; 193 | } 194 | 195 | public function logs(string $address, $fromBlock = '0x0', $toBlock = 'latest') 196 | { 197 | $topic_address = Address::toTopic($address); 198 | 199 | $logs = $this->getEth() 200 | ->addCall('sent', 'getLogs', [['address' => $this->contractAddress, 'topics' => [null, $topic_address], 'fromBlock' => $fromBlock, 'toBlock' => $toBlock]]) 201 | ->addCall('receive', 'getLogs', [['address' => $this->contractAddress, 'topics' => [null, null, $topic_address], 'fromBlock' => $fromBlock, 'toBlock' => $toBlock]]) 202 | ->batchCall() 203 | ; 204 | $txs = []; 205 | foreach (call_user_func_array('array_merge', $logs) as $log) 206 | { 207 | $txs[] = $this->getEventLogFormatter() 208 | ->build($log) 209 | ; 210 | } 211 | 212 | return $txs; 213 | } 214 | 215 | public function transactions(string $address, $fromBlock = '0x0', $toBlock = 'latest') 216 | { 217 | return $this->logs($address, $fromBlock, $toBlock); 218 | } 219 | 220 | public function getGasLimit($action = '') 221 | { 222 | return isset($this->gasLimits[$action]) ? $this->gasLimits[$action] : $this->gasLimits['default']; 223 | } 224 | 225 | public function getSafeGasPrice() 226 | { 227 | $gasPrice = $this->getEth() 228 | ->gasPrice() 229 | ; 230 | 231 | $modified = floatval(Number::fromWei($gasPrice, 'gwei')) + $this->gasPriceModifier; 232 | return Number::toWei($modified, 'gwei') 233 | ->toString() 234 | ; 235 | } 236 | } 237 | -------------------------------------------------------------------------------- /src/Foundation/Transaction/SignedTransaction.php: -------------------------------------------------------------------------------- 1 | hash = $hash; 22 | $this->eth = $eth; 23 | } 24 | 25 | public function getSignedHash() 26 | { 27 | return $this->hash; 28 | } 29 | 30 | /** 31 | * @return string 32 | * @throws Exception 33 | */ 34 | public function send() 35 | { 36 | if (!isset($this->eth)) 37 | { 38 | throw new Exception('Eth client not provided. Signed transaction have not be broadcasted'); 39 | } 40 | 41 | return $this->eth->sendRawTransaction($this->hash); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Foundation/Transaction/Transaction.php: -------------------------------------------------------------------------------- 1 | transaction = $transaction; 21 | $this->eth = $eth; 22 | } 23 | 24 | public function sign($privateKey) 25 | { 26 | $privateKey = str_replace('0x', '', $privateKey); 27 | return new SignedTransaction('0x' . $this->transaction->getRaw($privateKey), $this->eth); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Foundation/Transaction/TransactionBuilder.php: -------------------------------------------------------------------------------- 1 | eth = $eth; 30 | return $this; 31 | } 32 | 33 | 34 | public function nonce(string $nonce) 35 | { 36 | $this->nonce = $nonce; 37 | return $this; 38 | } 39 | 40 | public function to(string $to) 41 | { 42 | $this->to = $to; 43 | return $this; 44 | } 45 | 46 | public function amount(string $amount) 47 | { 48 | $this->amount = $amount; 49 | return $this; 50 | } 51 | 52 | public function gasPrice(string $gasPrice) 53 | { 54 | $this->gasPrice = $gasPrice; 55 | return $this; 56 | } 57 | 58 | public function gasLimit(string $gasLimit) 59 | { 60 | $this->gasLimit = $gasLimit; 61 | return $this; 62 | } 63 | 64 | public function data(string $data) 65 | { 66 | $this->data = $data; 67 | return $this; 68 | } 69 | 70 | public function build() 71 | { 72 | return new Transaction(new BaseTransaction($this->nonce, $this->gasPrice, $this->gasLimit, $this->to, $this->amount, $this->data), $this->eth); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/Token.php: -------------------------------------------------------------------------------- 1 | contractAddress = $contractAddress; 21 | parent::__construct($ethClient, $timeout); 22 | } 23 | 24 | public function name(): string 25 | { 26 | return $this->call('name')[0]; 27 | } 28 | 29 | public function symbol(): string 30 | { 31 | return $this->call('symbol')[0]; 32 | } 33 | 34 | public function decimals(): int 35 | { 36 | return intval($this->call('decimals')[0]->toString()); 37 | } 38 | 39 | /** 40 | * @param string $address 41 | * @return string 42 | */ 43 | public function balanceOf(string $address) 44 | { 45 | return Number::scaleDown($this->call('balanceOf', [$address])['balance']->toString(), $this->decimals()); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Utils/Address.php: -------------------------------------------------------------------------------- 1 | privateKeyToPublicKey($privateKey); 19 | return $util->publicKeyToAddress($publicKey); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Utils/Number.php: -------------------------------------------------------------------------------- 1 | multiply(new BigInteger($base)); 32 | } 33 | return $number; 34 | } 35 | 36 | public static function fromWei($number, $unit) 37 | { 38 | list($decimal, $precious) = Utils::fromWei($number, $unit); 39 | return $decimal->toString() . '.' . $precious->toString(); 40 | } 41 | 42 | public static function toWei($number, $unit) 43 | { 44 | return Utils::toWei($number, $unit); 45 | } 46 | 47 | public static function toHex($number) 48 | { 49 | return Utils::toHex($number); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/resources/erc20.abi.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "constant": true, 4 | "inputs": [], 5 | "name": "name", 6 | "outputs": [ 7 | { 8 | "name": "", 9 | "type": "string" 10 | } 11 | ], 12 | "payable": false, 13 | "stateMutability": "view", 14 | "type": "function" 15 | }, 16 | { 17 | "constant": false, 18 | "inputs": [ 19 | { 20 | "name": "_spender", 21 | "type": "address" 22 | }, 23 | { 24 | "name": "_value", 25 | "type": "uint256" 26 | } 27 | ], 28 | "name": "approve", 29 | "outputs": [ 30 | { 31 | "name": "", 32 | "type": "bool" 33 | } 34 | ], 35 | "payable": false, 36 | "stateMutability": "nonpayable", 37 | "type": "function" 38 | }, 39 | { 40 | "constant": true, 41 | "inputs": [], 42 | "name": "totalSupply", 43 | "outputs": [ 44 | { 45 | "name": "", 46 | "type": "uint256" 47 | } 48 | ], 49 | "payable": false, 50 | "stateMutability": "view", 51 | "type": "function" 52 | }, 53 | { 54 | "constant": false, 55 | "inputs": [ 56 | { 57 | "name": "_from", 58 | "type": "address" 59 | }, 60 | { 61 | "name": "_to", 62 | "type": "address" 63 | }, 64 | { 65 | "name": "_value", 66 | "type": "uint256" 67 | } 68 | ], 69 | "name": "transferFrom", 70 | "outputs": [ 71 | { 72 | "name": "", 73 | "type": "bool" 74 | } 75 | ], 76 | "payable": false, 77 | "stateMutability": "nonpayable", 78 | "type": "function" 79 | }, 80 | { 81 | "constant": true, 82 | "inputs": [], 83 | "name": "decimals", 84 | "outputs": [ 85 | { 86 | "name": "", 87 | "type": "uint8" 88 | } 89 | ], 90 | "payable": false, 91 | "stateMutability": "view", 92 | "type": "function" 93 | }, 94 | { 95 | "constant": true, 96 | "inputs": [ 97 | { 98 | "name": "_owner", 99 | "type": "address" 100 | } 101 | ], 102 | "name": "balanceOf", 103 | "outputs": [ 104 | { 105 | "name": "balance", 106 | "type": "uint256" 107 | } 108 | ], 109 | "payable": false, 110 | "stateMutability": "view", 111 | "type": "function" 112 | }, 113 | { 114 | "constant": true, 115 | "inputs": [], 116 | "name": "symbol", 117 | "outputs": [ 118 | { 119 | "name": "", 120 | "type": "string" 121 | } 122 | ], 123 | "payable": false, 124 | "stateMutability": "view", 125 | "type": "function" 126 | }, 127 | { 128 | "constant": false, 129 | "inputs": [ 130 | { 131 | "name": "_to", 132 | "type": "address" 133 | }, 134 | { 135 | "name": "_value", 136 | "type": "uint256" 137 | } 138 | ], 139 | "name": "transfer", 140 | "outputs": [ 141 | { 142 | "name": "", 143 | "type": "bool" 144 | } 145 | ], 146 | "payable": false, 147 | "stateMutability": "nonpayable", 148 | "type": "function" 149 | }, 150 | { 151 | "constant": true, 152 | "inputs": [ 153 | { 154 | "name": "_owner", 155 | "type": "address" 156 | }, 157 | { 158 | "name": "_spender", 159 | "type": "address" 160 | } 161 | ], 162 | "name": "allowance", 163 | "outputs": [ 164 | { 165 | "name": "", 166 | "type": "uint256" 167 | } 168 | ], 169 | "payable": false, 170 | "stateMutability": "view", 171 | "type": "function" 172 | }, 173 | { 174 | "payable": true, 175 | "stateMutability": "payable", 176 | "type": "fallback" 177 | }, 178 | { 179 | "anonymous": false, 180 | "inputs": [ 181 | { 182 | "indexed": true, 183 | "name": "owner", 184 | "type": "address" 185 | }, 186 | { 187 | "indexed": true, 188 | "name": "spender", 189 | "type": "address" 190 | }, 191 | { 192 | "indexed": false, 193 | "name": "value", 194 | "type": "uint256" 195 | } 196 | ], 197 | "name": "Approval", 198 | "type": "event" 199 | }, 200 | { 201 | "anonymous": false, 202 | "inputs": [ 203 | { 204 | "indexed": true, 205 | "name": "from", 206 | "type": "address" 207 | }, 208 | { 209 | "indexed": true, 210 | "name": "to", 211 | "type": "address" 212 | }, 213 | { 214 | "indexed": false, 215 | "name": "value", 216 | "type": "uint256" 217 | } 218 | ], 219 | "name": "Transfer", 220 | "type": "event" 221 | } 222 | ] 223 | --------------------------------------------------------------------------------