Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Solidity compiler #180

Merged
merged 5 commits into from
Oct 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"merkle-patricia-tree": "^2.3.1",
"mocha": "^5.2.0",
"preact-cli": "^2.1.1",
"solc": "^0.4.21"
"solc": "^0.4.25"
},
"dependencies": {
"@fortawesome/fontawesome": "^1.1.3",
Expand Down
2 changes: 1 addition & 1 deletion src/components/projecteditor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default class Editor extends Component {
body.status=0;
body.state=1;
if(this.language=="sol") {
this.body.contents=`pragma solidity ^0.4.17;
this.body.contents=`pragma solidity ^0.4.25;

contract `+this.props.contract.name+` {
}
Expand Down
11 changes: 0 additions & 11 deletions src/components/solc/dist/index-v0.4.21-1.html

This file was deleted.

11 changes: 11 additions & 0 deletions src/components/solc/dist/index-v0.4.25.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<html>
<head>
<script type="text/javascript" src="soljson-v0.4.25+commit.59dbf8f1.js"></script>
<script type="text/javascript" src="solc-iframe-v0.4.25.js"></script>
</head>
<body>
<script type="text/javascript">
console.log("[compiler] Loaded solc version soljson-v0.4.25+commit.59dbf8f1.js.");
</script>
</body>
</html>
23 changes: 0 additions & 23 deletions src/components/solc/dist/soljson-v0.4.21+commit.dfe3193c.js

This file was deleted.

24 changes: 24 additions & 0 deletions src/components/solc/dist/soljson-v0.4.25+commit.59dbf8f1.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/components/solc/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class Solc {
this.ref=null;
this._counter=0;
this._cbMap={};
this._version = "0.4.21";
this._version = "0.4.25";

var setRef = (ref)=>{
this.ref=ref;
Expand All @@ -42,7 +42,7 @@ export default class Solc {

render((
<div style="display:none;" id={this.id}>
<iframe ref={setRef} src="/solc/index-v0.4.21-1.html" frameborder="0"></iframe>
<iframe ref={setRef} src="/solc/index-v0.4.25.html" frameborder="0"></iframe>
</div>
), document.body);

Expand Down
2 changes: 1 addition & 1 deletion src/components/templates/empty.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"children": {
"MyContract.sol": {
"type": "f",
"contents": "pragma solidity ^0.4.21;\n\ncontract MyContract {\n function MyContract() public {\n }\n}"
"contents": "pragma solidity ^0.4.25;\n\ncontract MyContract {\n constructor() public {\n }\n}"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/templates/hello.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"children": {
"HelloWorld.sol": {
"type": "f",
"contents": "pragma solidity ^0.4.21;\n\ncontract HelloWorld {\n string public message;\n \n function HelloWorld(string initMessage) public {\n message = initMessage;\n }\n\n function update(string newMessage) public {\n message = newMessage;\n }\n}"
"contents": "pragma solidity ^0.4.25;\n\ncontract HelloWorld {\n string public message;\n \n constructor(string initMessage) public {\n message = initMessage;\n }\n\n function update(string newMessage) public {\n message = newMessage;\n }\n}"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/templates/newsfeed.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"children": {
"NewsFeed.sol": {
"type": "f",
"contents": "pragma solidity ^0.4.21;\n\ncontract NewsFeed {\n address public owner;\n address public author;\n uint256 public numArticles;\n\n struct Article {\n string title;\n string hash;\n }\n\n Article[] articles;\n\n function NewsFeed(address givenAuthor)\n public\n {\n require(givenAuthor != 0x0);\n owner = msg.sender;\n author = givenAuthor;\n }\n\n function publish(string title, string hash)\n public\n {\n require(msg.sender == author);\n\n Article memory article = Article(\n title,\n hash\n );\n articles.push(article);\n numArticles += 1;\n }\n\n function getArticle(uint256 index)\n public\n constant returns (string, string)\n {\n return (articles[index].title, articles[index].hash);\n }\n}"
"contents": "pragma solidity ^0.4.25;\n\ncontract NewsFeed {\n address public owner;\n address public author;\n uint256 public numArticles;\n\n struct Article {\n string title;\n string hash;\n }\n\n Article[] articles;\n\n constructor(address givenAuthor)\n public\n {\n require(givenAuthor != 0x0);\n owner = msg.sender;\n author = givenAuthor;\n }\n\n function publish(string title, string hash)\n public\n {\n require(msg.sender == author);\n\n Article memory article = Article(\n title,\n hash\n );\n articles.push(article);\n numArticles += 1;\n }\n\n function getArticle(uint256 index)\n public\n constant returns (string, string)\n {\n return (articles[index].title, articles[index].hash);\n }\n}"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/templates/raisetosummon.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"children": {
"RaiseToSummon.sol": {
"type": "f",
"contents": "/*\n Created by Superblocks and The Decentralized Camp to successfully summon Nick Johnson to Stockholm for a hackathon.\n*/\npragma solidity ^0.4.21;\n\ncontract RaiseToSummon {\n\n // Base definitions\n address public owner;\n address public receiver;\n string public cause;\n uint256 public expirationInSeconds;\n bool public hasBeenClaimed;\n uint256 public timeStarted;\n\n // Dynamic data\n uint256 public minimumAmountRequired;\n uint256 public numPayments;\n uint256 public totalAmountRaised;\n mapping(address => uint256) donationData;\n\n function RaiseToSummon(address beneficiary, string message, uint256 secondsUntilExpiration)\n public\n {\n require(beneficiary != 0x0);\n require(secondsUntilExpiration > 0);\n\n owner = msg.sender;\n receiver = beneficiary;\n cause = message;\n expirationInSeconds = secondsUntilExpiration;\n hasBeenClaimed = false;\n\n minimumAmountRequired = 0;\n numPayments = 0;\n totalAmountRaised = 0;\n timeStarted = block.timestamp;\n }\n\n function ()\n public\n {\n revert();\n }\n\n function donate()\n public\n payable\n {\n require(msg.sender != receiver);\n require(block.timestamp < (timeStarted + expirationInSeconds));\n require(msg.value > 0);\n require(minimumAmountRequired != 0);\n require(hasBeenClaimed == false);\n\n assert(donationData[msg.sender] + msg.value >= donationData[msg.sender]);\n assert(totalAmountRaised + msg.value >= totalAmountRaised);\n assert(numPayments + 1 >= numPayments);\n\n donationData[msg.sender] += msg.value;\n totalAmountRaised += msg.value;\n numPayments += 1;\n }\n\n // Note: can only be set once\n function receiverSetAmountRequired(uint256 minimum)\n public\n {\n require(msg.sender == receiver);\n require(minimumAmountRequired == 0);\n require(minimum > 0);\n\n minimumAmountRequired = minimum;\n }\n\n function receiverWithdraw()\n public\n {\n require(msg.sender == receiver);\n require(totalAmountRaised >= minimumAmountRequired);\n require(this.balance > 0);\n require(block.timestamp < (timeStarted + expirationInSeconds));\n require(hasBeenClaimed == false);\n\n hasBeenClaimed = true;\n receiver.transfer(this.balance);\n // Expecting transfer to throw on error\n // assert(this.balance == 0);\n }\n\n function withdraw()\n public\n {\n require(donationData[msg.sender] > 0);\n require(block.timestamp > (timeStarted + expirationInSeconds));\n require(hasBeenClaimed == false);\n\n var value = donationData[msg.sender];\n donationData[msg.sender] = 0;\n msg.sender.transfer(value);\n // Expecting transfer to throw on error\n // assert(donationData[donor] == 0);\n }\n\n function currentTotalExcess()\n public\n constant returns (uint256)\n {\n if (totalAmountRaised > minimumAmountRequired) {\n return totalAmountRaised - minimumAmountRequired;\n }\n else {\n return 0;\n }\n }\n\n function expirationTimestamp()\n public\n constant returns (uint256)\n {\n assert((timeStarted + expirationInSeconds) >= timeStarted);\n return (timeStarted + expirationInSeconds);\n }\n}"
"contents": "/*\n Created by Superblocks and The Decentralized Camp to successfully summon Nick Johnson to Stockholm for a hackathon.\n*/\npragma solidity ^0.4.25;\n\ncontract RaiseToSummon {\n\n // Base definitions\n address public owner;\n address public receiver;\n string public cause;\n uint256 public expirationInSeconds;\n bool public hasBeenClaimed;\n uint256 public timeStarted;\n\n // Dynamic data\n uint256 public minimumAmountRequired;\n uint256 public numPayments;\n uint256 public totalAmountRaised;\n mapping(address => uint256) donationData;\n\n constructor(address beneficiary, string message, uint256 secondsUntilExpiration)\n public\n {\n require(beneficiary != 0x0);\n require(secondsUntilExpiration > 0);\n\n owner = msg.sender;\n receiver = beneficiary;\n cause = message;\n expirationInSeconds = secondsUntilExpiration;\n hasBeenClaimed = false;\n\n minimumAmountRequired = 0;\n numPayments = 0;\n totalAmountRaised = 0;\n timeStarted = block.timestamp;\n }\n\n function ()\n public\n {\n revert();\n }\n\n function donate()\n public\n payable\n {\n require(msg.sender != receiver);\n require(block.timestamp < (timeStarted + expirationInSeconds));\n require(msg.value > 0);\n require(minimumAmountRequired != 0);\n require(hasBeenClaimed == false);\n\n assert(donationData[msg.sender] + msg.value >= donationData[msg.sender]);\n assert(totalAmountRaised + msg.value >= totalAmountRaised);\n assert(numPayments + 1 >= numPayments);\n\n donationData[msg.sender] += msg.value;\n totalAmountRaised += msg.value;\n numPayments += 1;\n }\n\n // Note: can only be set once\n function receiverSetAmountRequired(uint256 minimum)\n public\n {\n require(msg.sender == receiver);\n require(minimumAmountRequired == 0);\n require(minimum > 0);\n\n minimumAmountRequired = minimum;\n }\n\n function receiverWithdraw()\n public\n {\n require(msg.sender == receiver);\n require(totalAmountRaised >= minimumAmountRequired);\n require(this.balance > 0);\n require(block.timestamp < (timeStarted + expirationInSeconds));\n require(hasBeenClaimed == false);\n\n hasBeenClaimed = true;\n receiver.transfer(this.balance);\n // Expecting transfer to throw on error\n // assert(this.balance == 0);\n }\n\n function withdraw()\n public\n {\n require(donationData[msg.sender] > 0);\n require(block.timestamp > (timeStarted + expirationInSeconds));\n require(hasBeenClaimed == false);\n\n var value = donationData[msg.sender];\n donationData[msg.sender] = 0;\n msg.sender.transfer(value);\n // Expecting transfer to throw on error\n // assert(donationData[donor] == 0);\n }\n\n function currentTotalExcess()\n public\n constant returns (uint256)\n {\n if (totalAmountRaised > minimumAmountRequired) {\n return totalAmountRaised - minimumAmountRequired;\n }\n else {\n return 0;\n }\n }\n\n function expirationTimestamp()\n public\n constant returns (uint256)\n {\n assert((timeStarted + expirationInSeconds) >= timeStarted);\n return (timeStarted + expirationInSeconds);\n }\n}"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion test/reference/dummy/Dummy.bin
Original file line number Diff line number Diff line change
@@ -1 +1 @@
60606040523415600e57600080fd5b603580601b6000396000f3006060604052600080fd00a165627a7a723058206d68ee9789e6ddde9fabacff860abaa2a0bb9706461a5ebb716dad263b7a3c880029
6080604052348015600f57600080fd5b50603580601d6000396000f3006080604052600080fd00a165627a7a72305820ce8f92706f53e131af12e32c9e5eef25058ee4bedff10c2ffbc183b13938a8d40029
2 changes: 1 addition & 1 deletion test/reference/empty/MyContract.bin
Original file line number Diff line number Diff line change
@@ -1 +1 @@
60606040523415600e57600080fd5b603580601b6000396000f3006060604052600080fd00a165627a7a7230582096dad5bd4a5fb4a813147aa5c569c714ba81b6865d3b46b34580834037ee1a300029
6080604052348015600f57600080fd5b50603580601d6000396000f3006080604052600080fd00a165627a7a72305820d733598722a0cc71034b48bf55e97e6341e2a1bf4ee6dcdbcfd15fd661331e610029
2 changes: 1 addition & 1 deletion test/reference/hello/HelloWorld.bin
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6060604052341561000f57600080fd5b6040516103c13803806103c1833981016040528080518201919050508060009080519060200190610041929190610048565b50506100ed565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061008957805160ff19168380011785556100b7565b828001600101855582156100b7579182015b828111156100b657825182559160200191906001019061009b565b5b5090506100c491906100c8565b5090565b6100ea91905b808211156100e65760008160009055506001016100ce565b5090565b90565b6102c5806100fc6000396000f30060606040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633d7403a314610051578063e21f37ce146100ae575b600080fd5b341561005c57600080fd5b6100ac600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061013c565b005b34156100b957600080fd5b6100c1610156565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b80600090805190602001906101529291906101f4565b5050565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156101ec5780601f106101c1576101008083540402835291602001916101ec565b820191906000526020600020905b8154815290600101906020018083116101cf57829003601f168201915b505050505081565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061023557805160ff1916838001178555610263565b82800160010185558215610263579182015b82811115610262578251825591602001919060010190610247565b5b5090506102709190610274565b5090565b61029691905b8082111561029257600081600090555060010161027a565b5090565b905600a165627a7a72305820bb261bb5858618e117ce6751ee971eccf221b3efade6c29d04b739a5e37335ab0029
608060405234801561001057600080fd5b506040516103d73803806103d7833981018060405281019080805182019291905050508060009080519060200190610049929190610050565b50506100f5565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061009157805160ff19168380011785556100bf565b828001600101855582156100bf579182015b828111156100be5782518255916020019190600101906100a3565b5b5090506100cc91906100d0565b5090565b6100f291905b808211156100ee5760008160009055506001016100d6565b5090565b90565b6102d3806101046000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633d7403a314610051578063e21f37ce146100ba575b600080fd5b34801561005d57600080fd5b506100b8600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061014a565b005b3480156100c657600080fd5b506100cf610164565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561010f5780820151818401526020810190506100f4565b50505050905090810190601f16801561013c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b8060009080519060200190610160929190610202565b5050565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156101fa5780601f106101cf576101008083540402835291602001916101fa565b820191906000526020600020905b8154815290600101906020018083116101dd57829003601f168201915b505050505081565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061024357805160ff1916838001178555610271565b82800160010185558215610271579182015b82811115610270578251825591602001919060010190610255565b5b50905061027e9190610282565b5090565b6102a491905b808211156102a0576000816000905550600101610288565b5090565b905600a165627a7a72305820d42766fa8542610c22334e58300eb153009d2e0061a05ec6ca89828d5a57a5650029
Loading