Skip to content

Commit

Permalink
Update contracts to compile using 0.5.8. (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
nventuro committed Jun 6, 2019
1 parent 5637347 commit a4789e0
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 32 deletions.
2 changes: 1 addition & 1 deletion contracts/Acknowledger.sol
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.5.0;

contract Acknowledger {
event AcknowledgeFoo(uint256 a);
Expand Down
10 changes: 5 additions & 5 deletions contracts/EventEmitter.sol
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.5.0;

import "./IndirectEventEmitter.sol";

Expand All @@ -14,7 +14,7 @@ contract EventEmitter {
event LongUintBooleanString(uint256 uintValue, bool booleanValue, string stringValue);
event Bytes(bytes value);

constructor (uint8 uintValue, bool booleanValue, string stringValue) public {
constructor (uint8 uintValue, bool booleanValue, string memory stringValue) public {
emit ShortUint(uintValue);
emit Boolean(booleanValue);
emit String(stringValue);
Expand Down Expand Up @@ -48,15 +48,15 @@ contract EventEmitter {
emit Boolean(value);
}

function emitString(string value) public {
function emitString(string memory value) public {
emit String(value);
}

function emitBytes(bytes memory value) public {
emit Bytes(value);
}

function emitLongUintBooleanString(uint256 uintValue, bool booleanValue, string stringValue) public {
function emitLongUintBooleanString(uint256 uintValue, bool booleanValue, string memory stringValue) public {
emit LongUintBooleanString(uintValue, booleanValue, stringValue);
}

Expand All @@ -65,7 +65,7 @@ contract EventEmitter {
emit Boolean(boolValue);
}

function emitStringAndEmitIndirectly(string value, IndirectEventEmitter emitter) public {
function emitStringAndEmitIndirectly(string memory value, IndirectEventEmitter emitter) public {
emit String(value);
emitter.emitStringIndirectly(value);
}
Expand Down
4 changes: 2 additions & 2 deletions contracts/IndirectEventEmitter.sol
@@ -1,9 +1,9 @@
pragma solidity ^0.4.24;
pragma solidity ^0.5.0;

contract IndirectEventEmitter {
event IndirectString(string value);

function emitStringIndirectly(string value) public {
function emitStringIndirectly(string memory value) public {
emit IndirectString(value);
}
}
2 changes: 1 addition & 1 deletion contracts/Ownable.sol
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.5.0;

This comment has been minimized.

Copy link
@Csb-218

Csb-218 Jun 29, 2022

This version of compiler gives error while compiling contract erc721. How to fix it


contract Ownable {
address private _owner;
Expand Down
2 changes: 1 addition & 1 deletion contracts/OwnableInterfaceId.sol
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.5.0;

import "./Ownable.sol";

Expand Down
6 changes: 1 addition & 5 deletions contracts/Reverter.sol
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.5.0;

contract Reverter {
uint256[] private array;
Expand All @@ -22,10 +22,6 @@ contract Reverter {
require(false, "Failed requirement");
}

function revertFromThrow() public pure {
throw;
}

function revertFromAssert() public pure {
assert(false);
}
Expand Down
16 changes: 0 additions & 16 deletions test/src/expectRevert.test.js
Expand Up @@ -45,10 +45,6 @@ describe('expectRevert', function () {
await expectRevert(this.reverter.revertFromRequireWithReason(), 'Failed requirement');
});

it('rejects a throw', async function () {
await assertFailure(expectRevert(this.reverter.revertFromThrow()));
});

it('rejects a failed assertion', async function () {
await assertFailure(expectRevert(this.reverter.revertFromAssert()));
});
Expand Down Expand Up @@ -79,10 +75,6 @@ describe('expectRevert', function () {
await expectRevert.unspecified(this.reverter.revertFromRequireWithReason());
});

it('accepts a throw', async function () {
await expectRevert.unspecified(this.reverter.revertFromThrow());
});

it('rejects a failed assertion', async function () {
await assertFailure(expectRevert.unspecified(this.reverter.revertFromAssert()));
});
Expand Down Expand Up @@ -113,10 +105,6 @@ describe('expectRevert', function () {
await assertFailure(expectRevert.assertion(this.reverter.revertFromRequireWithReason()));
});

it('rejects a throw', async function () {
await assertFailure(expectRevert.assertion(this.reverter.revertFromThrow()));
});

it('accepts a failed assertion', async function () {
await expectRevert.assertion(this.reverter.revertFromAssert());
});
Expand Down Expand Up @@ -147,10 +135,6 @@ describe('expectRevert', function () {
await assertFailure(expectRevert.outOfGas(this.reverter.revertFromRequireWithReason()));
});

it('rejects a throw', async function () {
await assertFailure(expectRevert.outOfGas(this.reverter.revertFromThrow()));
});

it('accepts a failed assertion', async function () {
await assertFailure(expectRevert.outOfGas(this.reverter.revertFromAssert()));
});
Expand Down
2 changes: 1 addition & 1 deletion truffle-config.js
Expand Up @@ -9,7 +9,7 @@ module.exports = {

compilers: {
solc: {
version: '0.4.24',
version: '0.5.8',
},
},
};

0 comments on commit a4789e0

Please sign in to comment.