{"action":"closed","issue":{"url":"https://api.github.com/repos/gxchain/gxb-core/issues/89","repository_url":"https://api.github.com/repos/gxchain/gxb-core","labels_url":"https://api.github.com/repos/gxchain/gxb-core/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/gxchain/gxb-core/issues/89/comments","events_url":"https://api.github.com/repos/gxchain/gxb-core/issues/89/events","html_url":"https://github.com/gxchain/gxb-core/issues/89","id":391542211,"node_id":"MDU6SXNzdWUzOTE1NDIyMTE=","number":89,"title":"get_required_fees failed with UIA to pay for calling contract","user":{"login":"zhuliting","id":29453659,"node_id":"MDQ6VXNlcjI5NDUzNjU5","avatar_url":"https://avatars0.githubusercontent.com/u/29453659?v=4","gravatar_id":"","url":"https://api.github.com/users/zhuliting","html_url":"https://github.com/zhuliting","followers_url":"https://api.github.com/users/zhuliting/followers","following_url":"https://api.github.com/users/zhuliting/following{/other_user}","gists_url":"https://api.github.com/users/zhuliting/gists{/gist_id}","starred_url":"https://api.github.com/users/zhuliting/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhuliting/subscriptions","organizations_url":"https://api.github.com/users/zhuliting/orgs","repos_url":"https://api.github.com/users/zhuliting/repos","events_url":"https://api.github.com/users/zhuliting/events{/privacy}","received_events_url":"https://api.github.com/users/zhuliting/received_events","type":"User","site_admin":false},"labels":[{"id":665792112,"node_id":"MDU6TGFiZWw2NjU3OTIxMTI=","url":"https://api.github.com/repos/gxchain/gxb-core/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":{"login":"liukunyu","id":10687675,"node_id":"MDQ6VXNlcjEwNjg3Njc1","avatar_url":"https://avatars3.githubusercontent.com/u/10687675?v=4","gravatar_id":"","url":"https://api.github.com/users/liukunyu","html_url":"https://github.com/liukunyu","followers_url":"https://api.github.com/users/liukunyu/followers","following_url":"https://api.github.com/users/liukunyu/following{/other_user}","gists_url":"https://api.github.com/users/liukunyu/gists{/gist_id}","starred_url":"https://api.github.com/users/liukunyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liukunyu/subscriptions","organizations_url":"https://api.github.com/users/liukunyu/orgs","repos_url":"https://api.github.com/users/liukunyu/repos","events_url":"https://api.github.com/users/liukunyu/events{/privacy}","received_events_url":"https://api.github.com/users/liukunyu/received_events","type":"User","site_admin":false},"assignees":[{"login":"liukunyu","id":10687675,"node_id":"MDQ6VXNlcjEwNjg3Njc1","avatar_url":"https://avatars3.githubusercontent.com/u/10687675?v=4","gravatar_id":"","url":"https://api.github.com/users/liukunyu","html_url":"https://github.com/liukunyu","followers_url":"https://api.github.com/users/liukunyu/followers","following_url":"https://api.github.com/users/liukunyu/following{/other_user}","gists_url":"https://api.github.com/users/liukunyu/gists{/gist_id}","starred_url":"https://api.github.com/users/liukunyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liukunyu/subscriptions","organizations_url":"https://api.github.com/users/liukunyu/orgs","repos_url":"https://api.github.com/users/liukunyu/repos","events_url":"https://api.github.com/users/liukunyu/events{/privacy}","received_events_url":"https://api.github.com/users/liukunyu/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-12-17T03:09:49Z","updated_at":"2018-12-17T07:32:50Z","closed_at":"2018-12-17T07:32:50Z","author_association":"MEMBER","body":"**Describe the bug**\r\nget_required_fees failed with UIA to pay for calling contract\r\n\r\n**To Reproduce**\r\nwhen UIA exchange_rate < 1\r\n```\r\ncurl --data '{\"method\":\"call\",\"params\":[0,\"get_required_fees\",[[[75,{\"fee\":{\"amount\":\"0\",\"asset_id\":\"1.3.10\"},\"account\":\"1.2.268\",\"contract_id\":\"1.2.881\",\"amount\":{\"amount\":\"100000000\",\"asset_id\":\"1.3.17\"},\"method_name\":\"invest\",\"data\":\"\",\"extensions\":[]}]],\"1.3.1\"]],\"id\":156}'  https://testnet.gxchain.org\r\n```\r\nerror msg:\r\n```\r\n{\r\n\t\"id\": 156,\r\n\t\"jsonrpc\": \"2.0\",\r\n\t\"error\": {\r\n\t\t\"code\": 1,\r\n\t\t\"message\": \"Integer Divide By Zero:\",\r\n\t\t\"data\": {\r\n\t\t\t\"code\": 21,\r\n\t\t\t\"name\": \"divide_by_zero_exception\",\r\n\t\t\t\"message\": \"Integer Divide By Zero\",\r\n\t\t\t\"stack\": [{\r\n\t\t\t\t\"context\": {\r\n\t\t\t\t\t\"level\": \"error\",\r\n\t\t\t\t\t\"file\": \"safe.hpp\",\r\n\t\t\t\t\t\"line\": 82,\r\n\t\t\t\t\t\"method\": \"operator/\",\r\n\t\t\t\t\t\"hostname\": \"\",\r\n\t\t\t\t\t\"thread_name\": \"th_a\",\r\n\t\t\t\t\t\"timestamp\": \"2018-12-17T03:08:22\"\r\n\t\t\t\t},\r\n\t\t\t\t\"format\": \"\",\r\n\t\t\t\t\"data\": {\r\n\t\t\t\t\t\"a\": 100,\r\n\t\t\t\t\t\"b\": 0\r\n\t\t\t\t}\r\n\t\t\t}, {\r\n\t\t\t\t\"context\": {\r\n\t\t\t\t\t\"level\": \"warn\",\r\n\t\t\t\t\t\"file\": \"contract_evaluator.cpp\",\r\n\t\t\t\t\t\"line\": 101,\r\n\t\t\t\t\t\"method\": \"contract_exec\",\r\n\t\t\t\t\t\"hostname\": \"\",\r\n\t\t\t\t\t\"thread_name\": \"th_a\",\r\n\t\t\t\t\t\"timestamp\": \"2018-12-17T03:08:22\"\r\n\t\t\t\t},\r\n\t\t\t\t\"format\": \"\",\r\n\t\t\t\t\"data\": {\r\n\t\t\t\t\t\"op\": {\r\n\t\t\t\t\t\t\"fee\": {\r\n\t\t\t\t\t\t\t\"amount\": 0,\r\n\t\t\t\t\t\t\t\"asset_id\": \"1.3.10\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"account\": \"1.2.268\",\r\n\t\t\t\t\t\t\"contract_id\": \"1.2.881\",\r\n\t\t\t\t\t\t\"amount\": {\r\n\t\t\t\t\t\t\t\"amount\": 100000000,\r\n\t\t\t\t\t\t\t\"asset_id\": \"1.3.17\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"method_name\": \"invest\",\r\n\t\t\t\t\t\t\"data\": \"\",\r\n\t\t\t\t\t\t\"extensions\": []\r\n\t\t\t\t\t},\r\n\t\t\t\t\t\"billed_cpu_time_us\": 0\r\n\t\t\t\t}\r\n\t\t\t}, {\r\n\t\t\t\t\"context\": {\r\n\t\t\t\t\t\"level\": \"warn\",\r\n\t\t\t\t\t\"file\": \"contract_evaluator.cpp\",\r\n\t\t\t\t\t\"line\": 240,\r\n\t\t\t\t\t\"method\": \"do_apply\",\r\n\t\t\t\t\t\"hostname\": \"\",\r\n\t\t\t\t\t\"thread_name\": \"th_a\",\r\n\t\t\t\t\t\"timestamp\": \"2018-12-17T03:08:22\"\r\n\t\t\t\t},\r\n\t\t\t\t\"format\": \"\",\r\n\t\t\t\t\"data\": {\r\n\t\t\t\t\t\"op\": {\r\n\t\t\t\t\t\t\"fee\": {\r\n\t\t\t\t\t\t\t\"amount\": 0,\r\n\t\t\t\t\t\t\t\"asset_id\": \"1.3.10\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"account\": \"1.2.268\",\r\n\t\t\t\t\t\t\"contract_id\": \"1.2.881\",\r\n\t\t\t\t\t\t\"amount\": {\r\n\t\t\t\t\t\t\t\"amount\": 100000000,\r\n\t\t\t\t\t\t\t\"asset_id\": \"1.3.17\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"method_name\": \"invest\",\r\n\t\t\t\t\t\t\"data\": \"\",\r\n\t\t\t\t\t\t\"extensions\": []\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}, {\r\n\t\t\t\t\"context\": {\r\n\t\t\t\t\t\"level\": \"warn\",\r\n\t\t\t\t\t\"file\": \"evaluator.cpp\",\r\n\t\t\t\t\t\"line\": 51,\r\n\t\t\t\t\t\"method\": \"start_evaluate\",\r\n\t\t\t\t\t\"hostname\": \"\",\r\n\t\t\t\t\t\"thread_name\": \"th_a\",\r\n\t\t\t\t\t\"timestamp\": \"2018-12-17T03:08:22\"\r\n\t\t\t\t},\r\n\t\t\t\t\"format\": \"\",\r\n\t\t\t\t\"data\": {}\r\n\t\t\t}, {\r\n\t\t\t\t\"context\": {\r\n\t\t\t\t\t\"level\": \"warn\",\r\n\t\t\t\t\t\"file\": \"db_block.cpp\",\r\n\t\t\t\t\t\"line\": 678,\r\n\t\t\t\t\t\"method\": \"apply_operation\",\r\n\t\t\t\t\t\"hostname\": \"\",\r\n\t\t\t\t\t\"thread_name\": \"th_a\",\r\n\t\t\t\t\t\"timestamp\": \"2018-12-17T03:08:22\"\r\n\t\t\t\t},\r\n\t\t\t\t\"format\": \"\",\r\n\t\t\t\t\"data\": {\r\n\t\t\t\t\t\"op\": [75, {\r\n\t\t\t\t\t\t\"fee\": {\r\n\t\t\t\t\t\t\t\"amount\": 0,\r\n\t\t\t\t\t\t\t\"asset_id\": \"1.3.10\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"account\": \"1.2.268\",\r\n\t\t\t\t\t\t\"contract_id\": \"1.2.881\",\r\n\t\t\t\t\t\t\"amount\": {\r\n\t\t\t\t\t\t\t\"amount\": 100000000,\r\n\t\t\t\t\t\t\t\"asset_id\": \"1.3.17\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"method_name\": \"invest\",\r\n\t\t\t\t\t\t\"data\": \"\",\r\n\t\t\t\t\t\t\"extensions\": []\r\n\t\t\t\t\t}]\r\n\t\t\t\t}\r\n\t\t\t}, {\r\n\t\t\t\t\"context\": {\r\n\t\t\t\t\t\"level\": \"warn\",\r\n\t\t\t\t\t\"file\": \"db_block.cpp\",\r\n\t\t\t\t\t\"line\": 664,\r\n\t\t\t\t\t\"method\": \"_apply_transaction\",\r\n\t\t\t\t\t\"hostname\": \"\",\r\n\t\t\t\t\t\"thread_name\": \"th_a\",\r\n\t\t\t\t\t\"timestamp\": \"2018-12-17T03:08:22\"\r\n\t\t\t\t},\r\n\t\t\t\t\"format\": \"\",\r\n\t\t\t\t\"data\": {\r\n\t\t\t\t\t\"trx\": {\r\n\t\t\t\t\t\t\"ref_block_num\": 0,\r\n\t\t\t\t\t\t\"ref_block_prefix\": 0,\r\n\t\t\t\t\t\t\"expiration\": \"2018-12-17T03:08:51\",\r\n\t\t\t\t\t\t\"operations\": [\r\n\t\t\t\t\t\t\t[75, {\r\n\t\t\t\t\t\t\t\t\"fee\": {\r\n\t\t\t\t\t\t\t\t\t\"amount\": 0,\r\n\t\t\t\t\t\t\t\t\t\"asset_id\": \"1.3.10\"\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\"account\": \"1.2.268\",\r\n\t\t\t\t\t\t\t\t\"contract_id\": \"1.2.881\",\r\n\t\t\t\t\t\t\t\t\"amount\": {\r\n\t\t\t\t\t\t\t\t\t\"amount\": 100000000,\r\n\t\t\t\t\t\t\t\t\t\"asset_id\": \"1.3.17\"\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\"method_name\": \"invest\",\r\n\t\t\t\t\t\t\t\t\"data\": \"\",\r\n\t\t\t\t\t\t\t\t\"extensions\": []\r\n\t\t\t\t\t\t\t}]\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\"extensions\": [],\r\n\t\t\t\t\t\t\"signatures\": []\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}, {\r\n\t\t\t\t\"context\": {\r\n\t\t\t\t\t\"level\": \"warn\",\r\n\t\t\t\t\t\"file\": \"db_block.cpp\",\r\n\t\t\t\t\t\"line\": 231,\r\n\t\t\t\t\t\"method\": \"push_transaction\",\r\n\t\t\t\t\t\"hostname\": \"\",\r\n\t\t\t\t\t\"thread_name\": \"th_a\",\r\n\t\t\t\t\t\"timestamp\": \"2018-12-17T03:08:22\"\r\n\t\t\t\t},\r\n\t\t\t\t\"format\": \"\",\r\n\t\t\t\t\"data\": {\r\n\t\t\t\t\t\"trx\": {\r\n\t\t\t\t\t\t\"ref_block_num\": 0,\r\n\t\t\t\t\t\t\"ref_block_prefix\": 0,\r\n\t\t\t\t\t\t\"expiration\": \"2018-12-17T03:08:51\",\r\n\t\t\t\t\t\t\"operations\": [\r\n\t\t\t\t\t\t\t[75, {\r\n\t\t\t\t\t\t\t\t\"fee\": {\r\n\t\t\t\t\t\t\t\t\t\"amount\": 0,\r\n\t\t\t\t\t\t\t\t\t\"asset_id\": \"1.3.10\"\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\"account\": \"1.2.268\",\r\n\t\t\t\t\t\t\t\t\"contract_id\": \"1.2.881\",\r\n\t\t\t\t\t\t\t\t\"amount\": {\r\n\t\t\t\t\t\t\t\t\t\"amount\": 100000000,\r\n\t\t\t\t\t\t\t\t\t\"asset_id\": \"1.3.17\"\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\"method_name\": \"invest\",\r\n\t\t\t\t\t\t\t\t\"data\": \"\",\r\n\t\t\t\t\t\t\t\t\"extensions\": []\r\n\t\t\t\t\t\t\t}]\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\"extensions\": [],\r\n\t\t\t\t\t\t\"signatures\": []\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}, {\r\n\t\t\t\t\"context\": {\r\n\t\t\t\t\t\"level\": \"warn\",\r\n\t\t\t\t\t\"file\": \"websocket_api.cpp\",\r\n\t\t\t\t\t\"line\": 125,\r\n\t\t\t\t\t\"method\": \"on_message\",\r\n\t\t\t\t\t\"hostname\": \"\",\r\n\t\t\t\t\t\"thread_name\": \"th_a\",\r\n\t\t\t\t\t\"timestamp\": \"2018-12-17T03:08:22\"\r\n\t\t\t\t},\r\n\t\t\t\t\"format\": \"\",\r\n\t\t\t\t\"data\": {\r\n\t\t\t\t\t\"call.method\": \"call\",\r\n\t\t\t\t\t\"call.params\": [0, \"get_required_fees\", [\r\n\t\t\t\t\t\t[\r\n\t\t\t\t\t\t\t[75, {\r\n\t\t\t\t\t\t\t\t\"fee\": {\r\n\t\t\t\t\t\t\t\t\t\"amount\": \"0\",\r\n\t\t\t\t\t\t\t\t\t\"asset_id\": \"1.3.10\"\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\"account\": \"1.2.268\",\r\n\t\t\t\t\t\t\t\t\"contract_id\": \"1.2.881\",\r\n\t\t\t\t\t\t\t\t\"amount\": {\r\n\t\t\t\t\t\t\t\t\t\"amount\": \"100000000\",\r\n\t\t\t\t\t\t\t\t\t\"asset_id\": \"1.3.17\"\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\"method_name\": \"invest\",\r\n\t\t\t\t\t\t\t\t\"data\": \"\",\r\n\t\t\t\t\t\t\t\t\"extensions\": []\r\n\t\t\t\t\t\t\t}]\r\n\t\t\t\t\t\t], \"1.3.1\"\r\n\t\t\t\t\t]]\r\n\t\t\t\t}\r\n\t\t\t}]\r\n\t\t}\r\n\t}\r\n}\r\n```"}}
{"actor":{"display_login":"zhuliting"}}