{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/serpent/issues/57","labels_url":"https://api.github.com/repos/ethereum/serpent/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/serpent/issues/57/comments","events_url":"https://api.github.com/repos/ethereum/serpent/issues/57/events","html_url":"https://github.com/ethereum/serpent/issues/57","id":57885221,"number":57,"title":"Compiled serpent code with insets doesn't work in js abi","user":{"login":"joeykrug","id":5925937,"avatar_url":"https://avatars.githubusercontent.com/u/5925937?v=3","gravatar_id":"","url":"https://api.github.com/users/joeykrug","html_url":"https://github.com/joeykrug","followers_url":"https://api.github.com/users/joeykrug/followers","following_url":"https://api.github.com/users/joeykrug/following{/other_user}","gists_url":"https://api.github.com/users/joeykrug/gists{/gist_id}","starred_url":"https://api.github.com/users/joeykrug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeykrug/subscriptions","organizations_url":"https://api.github.com/users/joeykrug/orgs","repos_url":"https://api.github.com/users/joeykrug/repos","events_url":"https://api.github.com/users/joeykrug/events{/privacy}","received_events_url":"https://api.github.com/users/joeykrug/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-17T05:32:11Z","updated_at":"2015-02-17T22:22:53Z","closed_at":null,"body":"When I use the JS API to connect to alethzero I can publish a compiled hex serpent contract without insets and a simple function call like double(2) will return 4. If I have an inset, even if the inset doesn't do anything, it returns 0"},"comment":{"url":"https://api.github.com/repos/ethereum/serpent/issues/comments/74767911","html_url":"https://github.com/ethereum/serpent/issues/57#issuecomment-74767911","issue_url":"https://api.github.com/repos/ethereum/serpent/issues/57","id":74767911,"user":{"login":"joeykrug","id":5925937,"avatar_url":"https://avatars.githubusercontent.com/u/5925937?v=3","gravatar_id":"","url":"https://api.github.com/users/joeykrug","html_url":"https://github.com/joeykrug","followers_url":"https://api.github.com/users/joeykrug/followers","following_url":"https://api.github.com/users/joeykrug/following{/other_user}","gists_url":"https://api.github.com/users/joeykrug/gists{/gist_id}","starred_url":"https://api.github.com/users/joeykrug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeykrug/subscriptions","organizations_url":"https://api.github.com/users/joeykrug/orgs","repos_url":"https://api.github.com/users/joeykrug/repos","events_url":"https://api.github.com/users/joeykrug/events{/privacy}","received_events_url":"https://api.github.com/users/joeykrug/received_events","type":"User","site_admin":false},"created_at":"2015-02-17T22:22:53Z","updated_at":"2015-02-17T22:22:53Z","body":"Sure --- here's a simple test case that fails.  I think I've narrowed the issue down to macros with with.  If I remove the macro (even though it does nothing in this since I don't call it, I can call faucet and it returns something other than 0).\r\n\r\n#   var evm = '0x...';\r\n#   var address = web3.eth.transact({code: evm});\r\n#   serpent mk_full_signature and set desc to output\r\n#   var contract = web3.eth.contract(address, desc);\r\n\r\ndata cashcoinBalances[]\r\n\r\ndef init():\r\n    # test initial funds\r\n    self.cashcoinBalances[tx.origin] = 1000000*2^64\r\n\r\ndef faucet():\r\n    sender = tx.origin\r\n    self.cashcoinBalances[sender] = 10000*2^64\r\n    return(10000*2^64)\r\n\r\n# Proportional distance from zero, inputs are fixed point\r\nmacro get_weight($a, $asz):\r\n    with total = 0:\r\n        with i = 0:\r\n            while i < $asz:\r\n                $a[i] = abs($a[i])\r\n                total += $a[i]\r\n                i += 1\r\n        with wt = array($asz):\r\n            with i = 0:\r\n                while i < $asz:\r\n                    wt[i] = $a[i] * 2^64 / total\r\n                    i += 1\r\n            wt"}}