Skip to content

Commit

Permalink
Merge pull request #1 from 0xC0DE4C0FFEE/solcv050
Browse files Browse the repository at this point in the history
Breaking changes in Solidity v0.5.0 (using Truffle v5-beta-2)
  • Loading branch information
Arachnid authored Dec 13, 2018
2 parents 0eddd1a + c06d796 commit 4a26c91
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions contracts/Buffer.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity >0.4.18;

/**
* @dev A library for working with mutable byte buffers in Solidity.
Expand Down Expand Up @@ -46,7 +46,7 @@ library Buffer {
* @param b The bytes object to initialize the buffer with.
* @return A new buffer.
*/
function fromBytes(bytes b) internal pure returns(buffer memory) {
function fromBytes(bytes memory b) internal pure returns(buffer memory) {
buffer memory buf;
buf.buf = b;
buf.capacity = b.length;
Expand Down Expand Up @@ -88,7 +88,7 @@ library Buffer {
* @param len The number of bytes to copy.
* @return The original buffer, for chaining.
*/
function write(buffer memory buf, uint off, bytes data, uint len) internal pure returns(buffer memory) {
function write(buffer memory buf, uint off, bytes memory data, uint len) internal pure returns(buffer memory) {
require(len <= data.length);

if (off + len + buf.buf.length > buf.capacity) {
Expand Down Expand Up @@ -139,7 +139,7 @@ library Buffer {
* @param len The number of bytes to copy.
* @return The original buffer, for chaining.
*/
function append(buffer memory buf, bytes data, uint len) internal pure returns (buffer memory) {
function append(buffer memory buf, bytes memory data, uint len) internal pure returns (buffer memory) {
return write(buf, buf.buf.length, data, len);
}

Expand All @@ -150,7 +150,7 @@ library Buffer {
* @param data The data to append.
* @return The original buffer, for chaining.
*/
function append(buffer memory buf, bytes data) internal pure returns (buffer memory) {
function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {
return write(buf, buf.buf.length, data, data.length);
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/Migrations.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity >0.4.21;

contract Migrations {
address public owner;
Expand Down
2 changes: 1 addition & 1 deletion test/TestBuffer.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity >0.4.18;

import "truffle/Assert.sol";
import "./../contracts/Buffer.sol";
Expand Down
6 changes: 3 additions & 3 deletions truffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ module.exports = {
},
mocha: {
reporter: 'eth-gas-reporter',
reporterOptions : {
reporterOptions: {
currency: 'USD',
gasPrice: 1
}
},
/* solc: {
solc: {
optimizer: {
enabled: true,
runs: 200
}
}*/
}
};

0 comments on commit 4a26c91

Please sign in to comment.