{"action":"created","issue":{"url":"https://api.github.com/repos/sc0Vu/web3.php/issues/134","repository_url":"https://api.github.com/repos/sc0Vu/web3.php","labels_url":"https://api.github.com/repos/sc0Vu/web3.php/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/sc0Vu/web3.php/issues/134/comments","events_url":"https://api.github.com/repos/sc0Vu/web3.php/issues/134/events","html_url":"https://github.com/sc0Vu/web3.php/issues/134","id":394709925,"node_id":"MDU6SXNzdWUzOTQ3MDk5MjU=","number":134,"title":"Raiden (RDN) : The value to inputFormat must be hex bytes.","user":{"login":"drsaluml","id":13068514,"node_id":"MDQ6VXNlcjEzMDY4NTE0","avatar_url":"https://avatars3.githubusercontent.com/u/13068514?v=4","gravatar_id":"","url":"https://api.github.com/users/drsaluml","html_url":"https://github.com/drsaluml","followers_url":"https://api.github.com/users/drsaluml/followers","following_url":"https://api.github.com/users/drsaluml/following{/other_user}","gists_url":"https://api.github.com/users/drsaluml/gists{/gist_id}","starred_url":"https://api.github.com/users/drsaluml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drsaluml/subscriptions","organizations_url":"https://api.github.com/users/drsaluml/orgs","repos_url":"https://api.github.com/users/drsaluml/repos","events_url":"https://api.github.com/users/drsaluml/events{/privacy}","received_events_url":"https://api.github.com/users/drsaluml/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-12-28T20:05:42Z","updated_at":"2019-01-03T17:53:43Z","closed_at":null,"author_association":"NONE","body":" InvalidArgumentException  : The value to inputFormat must be hex bytes.\r\n\r\n  at ...\\web3\\src\\Contracts\\Types\\DynamicBytes.php:62\r\n    58|      */\r\n    59|     public function inputFormat($value, $name)\r\n    60|     {\r\n    61|         if (!Utils::isHex($value)) {\r\n  > 62|             throw new InvalidArgumentException('The value to inputFormat must be hex bytes.');\r\n    63|         }\r\n    64|         $value = Utils::stripZero($value);\r\n    65|\r\n    66|         // if (mb_strlen($value) % 2 !== 0) {\r\n\r\n  Exception trace:\r\n\r\n  1   ...\\web3\\src\\Contracts\\Types\\DynamicBytes::inputFormat([\"0x4f43..........\"], \"bytes\")\r\n      ...\\web3\\src\\Contracts\\SolidityType.php:221\r\n\r\n  2   ...\\web3\\src\\Contracts\\SolidityType::encode([\"0x4f43..........\"], \"bytes\")\r\n      ...\\web3\\src\\Contracts\\Ethabi.php:161\r\n\r\n  Please use the argument -v to see more details."},"comment":{"url":"https://api.github.com/repos/sc0Vu/web3.php/issues/comments/451223619","html_url":"https://github.com/sc0Vu/web3.php/issues/134#issuecomment-451223619","issue_url":"https://api.github.com/repos/sc0Vu/web3.php/issues/134","id":451223619,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTIyMzYxOQ==","user":{"login":"drsaluml","id":13068514,"node_id":"MDQ6VXNlcjEzMDY4NTE0","avatar_url":"https://avatars3.githubusercontent.com/u/13068514?v=4","gravatar_id":"","url":"https://api.github.com/users/drsaluml","html_url":"https://github.com/drsaluml","followers_url":"https://api.github.com/users/drsaluml/followers","following_url":"https://api.github.com/users/drsaluml/following{/other_user}","gists_url":"https://api.github.com/users/drsaluml/gists{/gist_id}","starred_url":"https://api.github.com/users/drsaluml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drsaluml/subscriptions","organizations_url":"https://api.github.com/users/drsaluml/orgs","repos_url":"https://api.github.com/users/drsaluml/repos","events_url":"https://api.github.com/users/drsaluml/events{/privacy}","received_events_url":"https://api.github.com/users/drsaluml/received_events","type":"User","site_admin":false},"created_at":"2019-01-03T17:53:43Z","updated_at":"2019-01-03T17:53:43Z","author_association":"NONE","body":"we try to transfer Raiden(RDN) Token using command as the above example and it shown error \"InvalidArgumentException...\" as post before\r\n\r\n\r\n// https://etherscan.io/address/0x255aa6df07540cb5d3d297f0d0d4d84cb52bc8e6\r\n// Raiden (RDN) Token\r\n\r\n$testHost = '127.0.0.1';\r\n\r\n$testAbi = '[{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"num\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"},{\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"auction_address\",\"type\":\"address\"},{\"name\":\"wallet_address\",\"type\":\"address\"},{\"name\":\"initial_supply\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_total_supply\",\"type\":\"uint256\"}],\"name\":\"Deployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_receiver\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_num\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"_total_supply\",\"type\":\"uint256\"}],\"name\":\"Burnt\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}]';\r\n\r\n$contract = new Contract($testHost, $testAbi);\r\n\r\n$contractAddress = '0x255aa6df07540cb5d3d297f0d0d4d84cb52bc8e6';\r\n$fromAccount = '0x1671a3e4a2519a653e66e827ef6eae690ee86729';\r\n$toAccount = '0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be';\r\n\r\n$contract->at($this->contractAddress)->send('transfer', $toAccount, 16, [\r\n    'from' => $fromAccount,\r\n    'gas' => '0x200b20'\r\n\t], function ($err, $result) use ($contract, $fromAccount, $toAccount) {\r\n\t    if ($err !== null) {\r\n\t        return $this->fail($err->getMessage());\r\n\t    }\r\n\t    if ($result) {\r\n\t        echo \"\\nTransaction has made:) id: \" . $result . \"\\n\";\r\n\t    }\r\n});\r\n\r\n> **Error Message**\r\n\r\n\r\nInvalidArgumentException : The value to inputFormat must be hex bytes.\r\n\r\nat ...\\web3\\src\\Contracts\\Types\\DynamicBytes.php:62\r\n58| */\r\n59| public function inputFormat($value, $name)\r\n60| {\r\n61| if (!Utils::isHex($value)) {\r\n\r\n62| throw new InvalidArgumentException('The value to inputFormat must be hex bytes.');\r\n63| }\r\n64| $value = Utils::stripZero($value);\r\n65|\r\n66| // if (mb_strlen($value) % 2 !== 0) {\r\n\r\nException trace:\r\n\r\n1 ...\\web3\\src\\Contracts\\Types\\DynamicBytes::inputFormat([\"0x4f43..........\"], \"bytes\")\r\n...\\web3\\src\\Contracts\\SolidityType.php:221\r\n\r\n2 ...\\web3\\src\\Contracts\\SolidityType::encode([\"0x4f43..........\"], \"bytes\")\r\n...\\web3\\src\\Contracts\\Ethabi.php:161\r\n\r\nPlease use the argument -v to see more details."}}
{"actor":{"display_login":"drsaluml"}}