Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

1116 init validation solidity v0.6 #1124

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bad4625
plock
HeikoFisch May 10, 2020
1dd7523
Update solc version to be used by buidler to 0.6.7
HeikoFisch May 10, 2020
c75014c
Compile against default EVM
HeikoFisch May 10, 2020
2bdf850
Update @openzeppelin/contracts to 3.0.1
HeikoFisch May 10, 2020
d7a8fef
plock
HeikoFisch May 10, 2020
15375e3
Update compiler version pragma to 0.6.7
HeikoFisch May 10, 2020
665e312
Fix fallback function syntax in `Proxy`
HeikoFisch May 10, 2020
42f813a
Replace remaining fallback functions with `receive`
HeikoFisch May 10, 2020
1a94f79
Replace `gas` with `gas()` in assembly
HeikoFisch May 10, 2020
424f349
Rename variable in assembly
HeikoFisch May 10, 2020
badb0c9
Add name to NatSpec `@return`s where needed
HeikoFisch May 10, 2020
f008c04
Add `virtual` and `override` keywords where necessary
HeikoFisch May 10, 2020
c939e24
Fix `DolphinCoin`
HeikoFisch May 10, 2020
3c993c2
Fix broken tests
HeikoFisch May 10, 2020
2c572f1
Get rid of "Unused local variable." warnings
HeikoFisch May 11, 2020
c87433a
Get rid of "Unused function parameter." warnings
HeikoFisch May 11, 2020
63a4b04
Get rid of some warnings to restrict state mutability
HeikoFisch May 11, 2020
b3df135
Fix `TwoPartyFixedOutcomeApp`
HeikoFisch May 11, 2020
8ee7fa4
Add `CounterfactualAppInterface` to silence warnings
HeikoFisch May 11, 2020
4e90984
Use `IERC20` where that is sufficient
HeikoFisch May 11, 2020
696fc7f
Use OZ code to check whether proxy has been deployed
HeikoFisch May 11, 2020
097b15d
Merge remote-tracking branch 'origin/staging' into upgrade_to_solidit…
HeikoFisch May 11, 2020
9d3f4c6
Fix broken watcher tests
HeikoFisch May 12, 2020
6f1f042
Merge branch 'staging' into upgrade_to_solidity_v0.6
HeikoFisch May 12, 2020
b1bcc30
Merge branch 'upgrade_to_solidity_v0.6' into 1116-init-validation-sol…
HeikoFisch May 12, 2020
f757872
Port contract changes from branch 'upgrade_to_solidity_v0.6' to '1116…
HeikoFisch May 12, 2020
bc4ae4a
Port 8acea29b to 'upgrade_to_solidity_v0.6'
HeikoFisch May 13, 2020
610c522
Merge branch 'upgrade_to_solidity_v0.6' into 1116-init-validation-sol…
HeikoFisch May 13, 2020
da480a3
Port 3c993c23 to '1116-init-validation-solidity-v0.6'
HeikoFisch May 13, 2020
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 modules/cf-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@connext/utils": "6.3.13",
"@connext/types": "6.3.13",
"ethers": "4.0.47",
"@openzeppelin/contracts": "2.5.0",
"@openzeppelin/contracts": "3.0.1",
"eventemitter3": "4.0.0",
"memoizee": "0.4.14",
"p-queue": "6.4.0",
Expand Down
3 changes: 1 addition & 2 deletions modules/contracts/buidler.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ const config: BuidlerConfig = {
artifacts: "./build",
},
solc: {
version: "0.5.11", // Note that this only has the version number
evmVersion: "constantinople",
version: "0.6.7", // Note that this only has the version number
},
defaultNetwork: "buidlerevm",
networks: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.5.11;
pragma solidity 0.6.7;
pragma experimental "ABIEncoderV2";

import "./mixins/MixinChallengeRegistryCore.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
pragma solidity 0.5.11;
pragma solidity 0.6.7;
pragma experimental "ABIEncoderV2";

import "./CounterfactualAppInterface.sol";

contract CounterfactualApp {

contract CounterfactualApp is CounterfactualAppInterface {

function isStateTerminal(bytes calldata)
override
virtual
external
view
returns (bool)
Expand All @@ -13,6 +17,8 @@ contract CounterfactualApp {
}

function getTurnTaker(bytes calldata, address[] calldata)
override
virtual
external
view
returns (address)
Expand All @@ -21,6 +27,8 @@ contract CounterfactualApp {
}

function init(bytes calldata)
override
virtual
external
view
returns (bool)
Expand All @@ -29,6 +37,8 @@ contract CounterfactualApp {
}

function applyAction(bytes calldata, bytes calldata)
override
virtual
external
view
returns (bytes memory)
Expand All @@ -37,6 +47,8 @@ contract CounterfactualApp {
}

function computeOutcome(bytes calldata)
override
virtual
external
view
returns (bytes memory)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
pragma solidity 0.6.7;
pragma experimental "ABIEncoderV2";


interface CounterfactualAppInterface {

function isStateTerminal(bytes calldata)
external
view
returns (bool);

function getTurnTaker(bytes calldata, address[] calldata)
external
view
returns (address);

function init(bytes calldata)
external
view
returns (bool);

function applyAction(bytes calldata, bytes calldata)
external
view
returns (bytes memory);

function computeOutcome(bytes calldata)
external
view
returns (bytes memory);

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.5.11;
pragma solidity 0.6.7;
pragma experimental "ABIEncoderV2";

import "../interfaces/CounterfactualApp.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.5.11;
pragma solidity 0.6.7;
pragma experimental ABIEncoderV2;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.5.11;
pragma solidity 0.6.7;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/math/SafeMath.sol";
Expand Down Expand Up @@ -66,7 +66,7 @@ contract LibStateChannelApp is LibDispute {
AppChallenge memory appChallenge
)
public
view
pure
returns (bool)
{
return appChallenge.status == ChallengeStatus.OUTCOME_SET;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.5.11;
pragma solidity 0.6.7;
pragma experimental "ABIEncoderV2";

import "../../shared/libs/LibCommitment.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.5.11;
pragma solidity 0.6.7;
pragma experimental "ABIEncoderV2";

import "../libs/LibStateChannelApp.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.5.11;
pragma solidity 0.6.7;
pragma experimental "ABIEncoderV2";

import "../libs/LibStateChannelApp.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.5.11;
pragma solidity 0.6.7;
pragma experimental "ABIEncoderV2";

import "../libs/LibStateChannelApp.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.5.11;
pragma solidity 0.6.7;
pragma experimental "ABIEncoderV2";

import "../libs/LibDispute.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.5.11;
pragma solidity 0.6.7;
pragma experimental "ABIEncoderV2";

import "../libs/LibStateChannelApp.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.5.11;
pragma solidity 0.6.7;
pragma experimental "ABIEncoderV2";

import "../libs/LibStateChannelApp.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.5.11;
pragma solidity 0.6.7;
pragma experimental "ABIEncoderV2";

import "./AppWithAction.sol";
Expand All @@ -11,8 +11,9 @@ import "./AppWithAction.sol";
contract AppApplyActionFails is AppWithAction {

function init(
bytes calldata encodedState
bytes calldata /* encodedState */
)
override
external
view
returns (bool)
Expand All @@ -21,12 +22,13 @@ contract AppApplyActionFails is AppWithAction {
}

function applyAction(
bytes calldata encodedState,
bytes calldata encodedAction
bytes calldata /* encodedState */,
bytes calldata /* encodedAction */
)
override
external
view
returns (bytes memory ret)
returns (bytes memory)
{
revert("applyAction fails for this app");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.5.11;
pragma solidity 0.6.7;
pragma experimental "ABIEncoderV2";

import "./AppWithAction.sol";
Expand All @@ -11,6 +11,7 @@ import "./AppWithAction.sol";
contract AppComputeOutcomeFails is AppWithAction {

function init(bytes calldata)
override
external
view
returns (bool)
Expand All @@ -19,6 +20,7 @@ contract AppComputeOutcomeFails is AppWithAction {
}

function computeOutcome(bytes calldata)
override
external
view
returns (bytes memory)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.5.11;
pragma solidity 0.6.7;
pragma experimental "ABIEncoderV2";

import "../interfaces/CounterfactualApp.sol";
Expand Down Expand Up @@ -35,6 +35,7 @@ contract AppWithAction is CounterfactualApp {
bytes calldata encodedState,
address[] calldata participants
)
override
external
view
returns (address)
Expand All @@ -44,6 +45,8 @@ contract AppWithAction is CounterfactualApp {
}

function computeOutcome(bytes calldata)
override
virtual
external
view
returns (bytes memory)
Expand All @@ -55,6 +58,8 @@ contract AppWithAction is CounterfactualApp {
bytes calldata encodedState,
bytes calldata encodedAction
)
override
virtual
external
view
returns (bytes memory ret)
Expand All @@ -72,7 +77,9 @@ contract AppWithAction is CounterfactualApp {
return abi.encode(state);
}

function init(bytes calldata encodedState)
function init(bytes calldata)
override
virtual
external
view
returns (bool)
Expand All @@ -81,6 +88,7 @@ contract AppWithAction is CounterfactualApp {
}

function isStateTerminal(bytes calldata encodedState)
override
external
view
returns (bool)
Expand Down
9 changes: 7 additions & 2 deletions modules/contracts/contracts/apps/HashLockTransferApp.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.5.11;
pragma solidity 0.6.7;
pragma experimental "ABIEncoderV2";

import "../adjudicator/interfaces/CounterfactualApp.sol";
Expand Down Expand Up @@ -28,6 +28,7 @@ contract HashLockTransferApp is CounterfactualApp {
}

function init(bytes calldata encodedState)
override
external
view
returns(bool)
Expand All @@ -48,6 +49,7 @@ contract HashLockTransferApp is CounterfactualApp {
bytes calldata encodedState,
bytes calldata encodedAction
)
override
external
view
returns (bytes memory)
Expand All @@ -69,6 +71,7 @@ contract HashLockTransferApp is CounterfactualApp {
}

function computeOutcome(bytes calldata encodedState)
override
external
view
returns (bytes memory)
Expand All @@ -84,9 +87,10 @@ contract HashLockTransferApp is CounterfactualApp {
}

function getTurnTaker(
bytes calldata encodedState,
bytes calldata /* encodedState */,
address[] calldata participants
)
override
external
view
returns (address)
Expand All @@ -95,6 +99,7 @@ contract HashLockTransferApp is CounterfactualApp {
}

function isStateTerminal(bytes calldata encodedState)
override
external
view
returns (bool)
Expand Down
Loading