{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/solidity/issues/242","labels_url":"https://api.github.com/repos/ethereum/solidity/issues/242/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/solidity/issues/242/comments","events_url":"https://api.github.com/repos/ethereum/solidity/issues/242/events","html_url":"https://github.com/ethereum/solidity/issues/242","id":118489710,"number":242,"title":"[solc feature]  library-like linking for normal addresses","user":{"login":"nmushegian","id":924397,"avatar_url":"https://avatars.githubusercontent.com/u/924397?v=3","gravatar_id":"","url":"https://api.github.com/users/nmushegian","html_url":"https://github.com/nmushegian","followers_url":"https://api.github.com/users/nmushegian/followers","following_url":"https://api.github.com/users/nmushegian/following{/other_user}","gists_url":"https://api.github.com/users/nmushegian/gists{/gist_id}","starred_url":"https://api.github.com/users/nmushegian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmushegian/subscriptions","organizations_url":"https://api.github.com/users/nmushegian/orgs","repos_url":"https://api.github.com/users/nmushegian/repos","events_url":"https://api.github.com/users/nmushegian/events{/privacy}","received_events_url":"https://api.github.com/users/nmushegian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-23T22:40:17Z","updated_at":"2015-11-24T01:58:57Z","closed_at":null,"body":"We're in the process of designing a build/deploy cycle for working with ever-growing contract systems. The concept of a `library` plus contract constructor arguments in solidity together are *almost* enough to enable future-proof \"packages\" or \"modules\", but not quite.\r\n\r\nWe've been able to reduce source-level hacks to make our package system work like we want to a single macro that looks like this:\r\n\r\n`var namereg = NameReg( LINK(\"my-environments-namereg\"))`\r\n\r\nAny contract definition in which this statement appears get what are essentially deploy-time-only constructor arguments which come from your environment definition.\r\n\r\nSeems there is something in between a `contract` and a `library` which would let us achieve the same goal natively."},"comment":{"url":"https://api.github.com/repos/ethereum/solidity/issues/comments/159129532","html_url":"https://github.com/ethereum/solidity/issues/242#issuecomment-159129532","issue_url":"https://api.github.com/repos/ethereum/solidity/issues/242","id":159129532,"user":{"login":"nmushegian","id":924397,"avatar_url":"https://avatars.githubusercontent.com/u/924397?v=3","gravatar_id":"","url":"https://api.github.com/users/nmushegian","html_url":"https://github.com/nmushegian","followers_url":"https://api.github.com/users/nmushegian/followers","following_url":"https://api.github.com/users/nmushegian/following{/other_user}","gists_url":"https://api.github.com/users/nmushegian/gists{/gist_id}","starred_url":"https://api.github.com/users/nmushegian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmushegian/subscriptions","organizations_url":"https://api.github.com/users/nmushegian/orgs","repos_url":"https://api.github.com/users/nmushegian/repos","events_url":"https://api.github.com/users/nmushegian/events{/privacy}","received_events_url":"https://api.github.com/users/nmushegian/received_events","type":"User","site_admin":false},"created_at":"2015-11-24T01:58:56Z","updated_at":"2015-11-24T01:58:56Z","body":"Here's a rough idea of how to make it more elegant using a new native concept instead of a link macro:\r\n\r\n```\r\n\r\ntemplate MyDapp(NameReg namereg, Maker M, Alarm A) {\r\n    function MyDapp( uint bytes32 ny_name ) }\r\n        namereg.register(ny_name, address(this));\r\n    }\r\n    function doStuff() {\r\n        A.schedule(address(M), 0x0);\r\n    }\r\n}\r\n```\r\nThis would \"precompile\" into:\r\n\r\n```\r\n\r\ncontract MyDapp {\r\n    function MyDapp( uint bytes32 ny_name ) }\r\n        NameReg(<LINKED ADDRESS>).register(ny_name, address(this));\r\n    }\r\n    function doStuff() {\r\n        Alarm(<LINKED ADDRESS>).schedule(address(Maker(<LINKED ADDRESS>)), 0x0);\r\n    }\r\n}\r\n```"}}