diff --git a/demo/app/contracts/simple_storage.sol b/demo/app/contracts/simple_storage.sol index 53494ce5..6e027a0f 100644 --- a/demo/app/contracts/simple_storage.sol +++ b/demo/app/contracts/simple_storage.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.2; +pragma solidity ^0.4.6; contract SimpleStorage { uint public storedData; diff --git a/package.json b/package.json index ce8f1309..bfe9aa7d 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "merge": "^1.2.0", "meteor-build-client": "^0.1.6", "mkdirp": "^0.5.1", - "solc": "^0.4.0", + "solc": "^0.4.6", "read-yaml": "^1.0.0", "request": "^2.75.0", "serve-static": "^1.11.1", diff --git a/test/compiler.js b/test/compiler.js index c86e1916..ec0db9a6 100644 --- a/test/compiler.js +++ b/test/compiler.js @@ -17,9 +17,10 @@ describe('embark.Compiler', function() { ]); var expectedObject = {}; - expectedObject["SimpleStorage"] = {"code":"6060604052604051602080608983395060806040525160008190555060628060276000396000f3606060405260e060020a60003504632a1afcd98114603057806360fe47b114603c5780636d4ce63c146048575b6002565b34600257605060005481565b34600257600435600055005b346002576000545b60408051918252519081900360200190f3","runtimeBytecode":"606060405260e060020a60003504632a1afcd98114603057806360fe47b114603c5780636d4ce63c146048575b6002565b34600257605060005481565b34600257600435600055005b346002576000545b60408051918252519081900360200190f3","gasEstimates":{"creation":[20100,19600],"external":{"get()":236,"set(uint256)":20124,"storedData()":206},"internal":{}},"functionHashes":{"get()":"6d4ce63c","set(uint256)":"60fe47b1","storedData()":"2a1afcd9"},"abiDefinition":[{"constant":true,"inputs":[],"name":"storedData","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"x","type":"uint256"}],"name":"set","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"get","outputs":[{"name":"retVal","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"initialValue","type":"uint256"}],"type":"constructor"}]}; - expectedObject["Token"] = {"code":"60606040526040516020806103a1833950608060405251600160a060020a033316600090815260208190526040902081905560028190555061035c806100456000396000f3606060405236156100565760e060020a6000350463095ea7b3811461005b57806318160ddd146100d457806323b872dd146100ef57806370a0823114610126578063a9059cbb1461014b578063dd62ed3e1461017f575b610002565b34610002576101b8600435602435600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b34610002576002545b60408051918252519081900360200190f35b34610002576101b8600435602435604435600160a060020a038316600090815260208190526040812054829010156101cc57610002565b3461000257600160a060020a03600435166000908152602081905260409020546100dd565b34610002576101b8600435602435600160a060020a033316600090815260208190526040812054829010156102c157610002565b34610002576100dd600435602435600160a060020a038083166000908152600160209081526040808320938516835292905220546100ce565b604080519115158252519081900360200190f35b600160a060020a03808516600090815260016020908152604080832033909416835292905220548290101561020057610002565b600160a060020a03831660009081526020819052604090205461022b90835b808201829010156100ce565b151561023657610002565b600160a060020a038085166000818152600160209081526040808320338616845282528083208054889003905583835282825280832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b600160a060020a0383166000908152602081905260409020546102e4908361021f565b15156102ef57610002565b600160a060020a0333811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060016100ce56","runtimeBytecode":"606060405236156100565760e060020a6000350463095ea7b3811461005b57806318160ddd146100d457806323b872dd146100ef57806370a0823114610126578063a9059cbb1461014b578063dd62ed3e1461017f575b610002565b34610002576101b8600435602435600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b34610002576002545b60408051918252519081900360200190f35b34610002576101b8600435602435604435600160a060020a038316600090815260208190526040812054829010156101cc57610002565b3461000257600160a060020a03600435166000908152602081905260409020546100dd565b34610002576101b8600435602435600160a060020a033316600090815260208190526040812054829010156102c157610002565b34610002576100dd600435602435600160a060020a038083166000908152600160209081526040808320938516835292905220546100ce565b604080519115158252519081900360200190f35b600160a060020a03808516600090815260016020908152604080832033909416835292905220548290101561020057610002565b600160a060020a03831660009081526020819052604090205461022b90835b808201829010156100ce565b151561023657610002565b600160a060020a038085166000818152600160209081526040808320338616845282528083208054889003905583835282825280832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b600160a060020a0383166000908152602081905260409020546102e4908361021f565b15156102ef57610002565b600160a060020a0333811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060016100ce56","gasEstimates":{"creation":[40354,172000],"external":{"allowance(address,address)":547,"approve(address,uint256)":22220,"balanceOf(address)":397,"totalSupply()":232,"transfer(address,uint256)":null,"transferFrom(address,address,uint256)":63271},"internal":{"safeToAdd(uint256,uint256)":52}},"functionHashes":{"allowance(address,address)":"dd62ed3e","approve(address,uint256)":"095ea7b3","balanceOf(address)":"70a08231","totalSupply()":"18160ddd","transfer(address,uint256)":"a9059cbb","transferFrom(address,address,uint256)":"23b872dd"},"abiDefinition":[{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"value","type":"uint256"}],"name":"approve","outputs":[{"name":"ok","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"supply","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"ok","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"who","type":"address"}],"name":"balanceOf","outputs":[{"name":"value","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transfer","outputs":[{"name":"ok","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"spender","type":"address"}],"name":"allowance","outputs":[{"name":"_allowance","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"initial_balance","type":"uint256"}],"type":"constructor"},{"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"}]}; + expectedObject["SimpleStorage"] = {"code":"606060405234610000576040516020806100bd83398101604052515b60008190555b505b608d806100306000396000f3606060405260e060020a60003504632a1afcd98114603057806360fe47b114604c5780636d4ce63c14605b575b6000565b34600057603a6077565b60408051918252519081900360200190f35b346000576059600435607d565b005b34600057603a6086565b60408051918252519081900360200190f35b60005481565b60008190555b50565b6000545b9056","runtimeBytecode":"606060405260e060020a60003504632a1afcd98114603057806360fe47b114604c5780636d4ce63c14605b575b6000565b34600057603a6077565b60408051918252519081900360200190f35b346000576059600435607d565b005b34600057603a6086565b60408051918252519081900360200190f35b60005481565b60008190555b50565b6000545b9056","gasEstimates":{"creation":[20125,28200],"external":{"get()":263,"set(uint256)":20157,"storedData()":218},"internal":{}},"functionHashes":{"get()":"6d4ce63c","set(uint256)":"60fe47b1","storedData()":"2a1afcd9"},"abiDefinition":[{"constant":true,"inputs":[],"name":"storedData","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"x","type":"uint256"}],"name":"set","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"get","outputs":[{"name":"retVal","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"initialValue","type":"uint256"}],"payable":false,"type":"constructor"}]}; + + expectedObject["Token"] = {"code":"6060604052346100005760405160208061042883398101604052515b600160a060020a033316600090815260208190526040902081905560028190555b505b6103dc8061004c6000396000f3606060405236156100565760e060020a6000350463095ea7b3811461005b57806318160ddd1461008257806323b872dd146100a157806370a08231146100cb578063a9059cbb146100ed578063dd62ed3e14610114575b610000565b346100005761006e600435602435610139565b604080519115158252519081900360200190f35b346100005761008f6101a4565b60408051918252519081900360200190f35b346100005761006e6004356024356044356101ab565b604080519115158252519081900360200190f35b346100005761008f6004356102bf565b60408051918252519081900360200190f35b346100005761006e6004356024356102de565b604080519115158252519081900360200190f35b346100005761008f6004356024356103a1565b60408051918252519081900360200190f35b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b6002545b90565b600160a060020a038316600090815260208190526040812054829010156101d157610000565b600160a060020a03808516600090815260016020908152604080832033909416835292905220548290101561020557610000565b600160a060020a03831660009081526020819052604090205461022890836103ce565b151561023357610000565b600160a060020a038085166000818152600160209081526040808320338616845282528083208054889003905583835282825280832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b600160a060020a0381166000908152602081905260409020545b919050565b600160a060020a0333166000908152602081905260408120548290101561030457610000565b600160a060020a03831660009081526020819052604090205461032790836103ce565b151561033257610000565b600160a060020a0333811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b92915050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b92915050565b808201829010155b9291505056","runtimeBytecode":"606060405236156100565760e060020a6000350463095ea7b3811461005b57806318160ddd1461008257806323b872dd146100a157806370a08231146100cb578063a9059cbb146100ed578063dd62ed3e14610114575b610000565b346100005761006e600435602435610139565b604080519115158252519081900360200190f35b346100005761008f6101a4565b60408051918252519081900360200190f35b346100005761006e6004356024356044356101ab565b604080519115158252519081900360200190f35b346100005761008f6004356102bf565b60408051918252519081900360200190f35b346100005761006e6004356024356102de565b604080519115158252519081900360200190f35b346100005761008f6004356024356103a1565b60408051918252519081900360200190f35b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b6002545b90565b600160a060020a038316600090815260208190526040812054829010156101d157610000565b600160a060020a03808516600090815260016020908152604080832033909416835292905220548290101561020557610000565b600160a060020a03831660009081526020819052604090205461022890836103ce565b151561023357610000565b600160a060020a038085166000818152600160209081526040808320338616845282528083208054889003905583835282825280832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b600160a060020a0381166000908152602081905260409020545b919050565b600160a060020a0333166000908152602081905260408120548290101561030457610000565b600160a060020a03831660009081526020819052604090205461032790836103ce565b151561033257610000565b600160a060020a0333811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b92915050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b92915050565b808201829010155b9291505056","gasEstimates":{"creation":[40397,197600],"external":{"allowance(address,address)":548,"approve(address,uint256)":22232,"balanceOf(address)":421,"totalSupply()":259,"transfer(address,uint256)":42853,"transferFrom(address,address,uint256)":63284},"internal":{"safeToAdd(uint256,uint256)":41}},"functionHashes":{"allowance(address,address)":"dd62ed3e","approve(address,uint256)":"095ea7b3","balanceOf(address)":"70a08231","totalSupply()":"18160ddd","transfer(address,uint256)":"a9059cbb","transferFrom(address,address,uint256)":"23b872dd"},"abiDefinition":[{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"value","type":"uint256"}],"name":"approve","outputs":[{"name":"ok","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"supply","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"ok","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"who","type":"address"}],"name":"balanceOf","outputs":[{"name":"value","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transfer","outputs":[{"name":"ok","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"spender","type":"address"}],"name":"allowance","outputs":[{"name":"_allowance","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"initial_balance","type":"uint256"}],"payable":false,"type":"constructor"},{"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"}]} it('should generate compiled code and abi', function() { assert.deepEqual(compiledContracts, expectedObject); diff --git a/test/contracts/simple_storage.sol b/test/contracts/simple_storage.sol index 46e047eb..5ff67f7a 100644 --- a/test/contracts/simple_storage.sol +++ b/test/contracts/simple_storage.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.2; +pragma solidity ^0.4.6; contract SimpleStorage { uint public storedData; diff --git a/test/contracts/token.sol b/test/contracts/token.sol index 58d182ad..3ce811df 100644 --- a/test/contracts/token.sol +++ b/test/contracts/token.sol @@ -1,6 +1,6 @@ // https://github.com/nexusdev/erc20/blob/master/contracts/base.sol -pragma solidity ^0.4.2; +pragma solidity ^0.4.6; contract Token { event Transfer(address indexed from, address indexed to, uint value);