1
- /* SPDX-License-Identifier: MIT */
2
- pragma solidity 0.6.10 ;
3
- pragma experimental ABIEncoderV2;
1
+
4
2
// File: https://github.com/smartcontractkit/chainlink/blob/master/evm-contracts/src/v0.6/vendor/SafeMathChainlink.sol
5
3
4
+ pragma solidity ^ 0.6.0 ;
6
5
7
6
/**
8
7
* @dev Wrappers over Solidity's arithmetic operations with added overflow
@@ -112,18 +111,24 @@ library SafeMathChainlink {
112
111
113
112
// File: https://github.com/smartcontractkit/chainlink/blob/master/evm-contracts/src/v0.6/vendor/ENSResolver.sol
114
113
114
+ pragma solidity ^ 0.6.0 ;
115
+
115
116
abstract contract ENSResolver {
116
117
function addr (bytes32 node ) public view virtual returns (address );
117
118
}
118
119
119
120
// File: https://github.com/smartcontractkit/chainlink/blob/master/evm-contracts/src/v0.6/interfaces/PointerInterface.sol
120
121
122
+ pragma solidity ^ 0.6.0 ;
123
+
121
124
interface PointerInterface {
122
125
function getAddress () external view returns (address );
123
126
}
124
127
125
128
// File: https://github.com/smartcontractkit/chainlink/blob/master/evm-contracts/src/v0.6/interfaces/ChainlinkRequestInterface.sol
126
129
130
+ pragma solidity ^ 0.6.0 ;
131
+
127
132
interface ChainlinkRequestInterface {
128
133
function oracleRequest (
129
134
address sender ,
@@ -146,6 +151,8 @@ interface ChainlinkRequestInterface {
146
151
147
152
// File: https://github.com/smartcontractkit/chainlink/blob/master/evm-contracts/src/v0.6/interfaces/LinkTokenInterface.sol
148
153
154
+ pragma solidity ^ 0.6.0 ;
155
+
149
156
interface LinkTokenInterface {
150
157
function allowance (address owner , address spender ) external view returns (uint256 remaining );
151
158
function approve (address spender , uint256 value ) external returns (bool success );
@@ -163,6 +170,8 @@ interface LinkTokenInterface {
163
170
164
171
// File: https://github.com/smartcontractkit/chainlink/blob/master/evm-contracts/src/v0.6/interfaces/ENSInterface.sol
165
172
173
+ pragma solidity ^ 0.6.0 ;
174
+
166
175
interface ENSInterface {
167
176
168
177
// Logged when the owner of a node assigns a new owner to a subnode.
@@ -190,6 +199,8 @@ interface ENSInterface {
190
199
191
200
// File: https://github.com/smartcontractkit/chainlink/blob/master/evm-contracts/src/v0.6/vendor/BufferChainlink.sol
192
201
202
+ pragma solidity ^ 0.6.0 ;
203
+
193
204
/**
194
205
* @dev A library for working with mutable byte buffers in Solidity.
195
206
*
@@ -492,6 +503,8 @@ library BufferChainlink {
492
503
493
504
// File: https://github.com/smartcontractkit/chainlink/blob/master/evm-contracts/src/v0.6/vendor/CBORChainlink.sol
494
505
506
+ pragma solidity ^ 0.6.0 ;
507
+
495
508
496
509
library CBORChainlink {
497
510
using BufferChainlink for BufferChainlink.buffer;
@@ -563,6 +576,10 @@ library CBORChainlink {
563
576
564
577
// File: https://github.com/smartcontractkit/chainlink/blob/master/evm-contracts/src/v0.6/Chainlink.sol
565
578
579
+ pragma solidity ^ 0.6.0 ;
580
+
581
+
582
+
566
583
/**
567
584
* @title Library for common Chainlink functions
568
585
* @dev Uses imported CBOR library for encoding to buffer
@@ -687,6 +704,15 @@ library Chainlink {
687
704
688
705
// File: https://github.com/smartcontractkit/chainlink/blob/master/evm-contracts/src/v0.6/ChainlinkClient.sol
689
706
707
+ pragma solidity ^ 0.6.0 ;
708
+
709
+
710
+
711
+
712
+
713
+
714
+
715
+
690
716
/**
691
717
* @title The ChainlinkClient contract
692
718
* @notice Contract writers can inherit this contract in order to create requests for the
@@ -866,7 +892,7 @@ contract ChainlinkClient {
866
892
ens = ENSInterface (_ens);
867
893
ensNode = _node;
868
894
bytes32 linkSubnode = keccak256 (abi.encodePacked (ensNode, ENS_TOKEN_SUBNAME));
869
- ENSResolver resolver = ENSResolver (ens.resolver (linkSubnode));
895
+ ENSResolver_Chainlink resolver = ENSResolver_Chainlink (ens.resolver (linkSubnode));
870
896
setChainlinkToken (resolver.addr (linkSubnode));
871
897
updateChainlinkOracleWithENS ();
872
898
}
@@ -879,7 +905,7 @@ contract ChainlinkClient {
879
905
internal
880
906
{
881
907
bytes32 oracleSubnode = keccak256 (abi.encodePacked (ensNode, ENS_ORACLE_SUBNAME));
882
- ENSResolver resolver = ENSResolver (ens.resolver (oracleSubnode));
908
+ ENSResolver_Chainlink resolver = ENSResolver_Chainlink (ens.resolver (oracleSubnode));
883
909
setChainlinkOracle (resolver.addr (oracleSubnode));
884
910
}
885
911
@@ -943,6 +969,10 @@ contract ChainlinkClient {
943
969
944
970
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.1.0/contracts/token/ERC20/IERC20.sol
945
971
972
+ // SPDX-License-Identifier: MIT
973
+
974
+ pragma solidity ^ 0.6.0 ;
975
+
946
976
/**
947
977
* @dev Interface of the ERC20 standard as defined in the EIP.
948
978
*/
@@ -1019,6 +1049,10 @@ interface IERC20 {
1019
1049
1020
1050
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.1.0/contracts/GSN/Context.sol
1021
1051
1052
+ // SPDX-License-Identifier: MIT
1053
+
1054
+ pragma solidity ^ 0.6.0 ;
1055
+
1022
1056
/*
1023
1057
* @dev Provides information about the current execution context, including the
1024
1058
* sender of the transaction and its data. While these are generally available
@@ -1042,6 +1076,10 @@ abstract contract Context {
1042
1076
1043
1077
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.1.0/contracts/access/Ownable.sol
1044
1078
1079
+ // SPDX-License-Identifier: MIT
1080
+
1081
+ pragma solidity ^ 0.6.0 ;
1082
+
1045
1083
/**
1046
1084
* @dev Contract module which provides a basic access control mechanism, where
1047
1085
* there is an account (an owner) that can be granted exclusive access to
@@ -1108,6 +1146,9 @@ contract Ownable is Context {
1108
1146
1109
1147
// File: https://github.com/nomiclabs/hardhat/blob/master/packages/hardhat-core/console.sol
1110
1148
1149
+ // SPDX-License-Identifier: MIT
1150
+ pragma solidity >= 0.4.22 < 0.8.0 ;
1151
+
1111
1152
library console {
1112
1153
address constant CONSOLE_ADDRESS = address (0x000000000000000000636F6e736F6c652e6c6f67 );
1113
1154
@@ -2643,6 +2684,17 @@ library console {
2643
2684
}
2644
2685
2645
2686
// File: browser/SinglePlayerCommit.sol
2687
+
2688
+ /* SPDX-License-Identifier: MIT */
2689
+ pragma solidity 0.6.10 ;
2690
+ pragma experimental ABIEncoderV2;
2691
+
2692
+
2693
+
2694
+
2695
+ //https://github.com/smartcontractkit/chainlink/issues/3153#issuecomment-655241638
2696
+
2697
+
2646
2698
/// @title CommitPool single-player mode contract
2647
2699
/// @notice Enables staking and validating performance. No social/pool functionality.
2648
2700
contract SinglePlayerCommit is ChainlinkClient , Ownable {
@@ -2888,7 +2940,7 @@ contract SinglePlayerCommit is ChainlinkClient, Ownable {
2888
2940
require (commitment.endTime < block .timestamp , "SPC::processCommitment - commitment is still active " );
2889
2941
require (commitment.endTime < commitment.lastActivityUpdate, "SPC::processCommitment - update activity " );
2890
2942
2891
- require (_commitmentSettlement (commitment), "SPC::processCommitmentUser - settlement failed " );
2943
+ require (_settleCommitment (commitment), "SPC::processCommitmentUser - settlement failed " );
2892
2944
2893
2945
emit CommitmentEnded (committer, commitment.met, commitment.stake);
2894
2946
}
@@ -2900,13 +2952,13 @@ contract SinglePlayerCommit is ChainlinkClient, Ownable {
2900
2952
require (commitments[msg .sender ].exists, "SPC::processCommitmentUser - commitment does not exist " );
2901
2953
Commitment storage commitment = commitments[msg .sender ];
2902
2954
2903
- require (_commitmentSettlement (commitment), "SPC::processCommitmentUser - settlement failed " );
2955
+ require (_settleCommitment (commitment), "SPC::processCommitmentUser - settlement failed " );
2904
2956
emit CommitmentEnded (msg .sender , commitment.met, commitment.stake);
2905
2957
}
2906
2958
2907
2959
/// @notice Internal function for evaluating commitment and slashing funds if needed
2908
2960
/// @dev Receive call with commitment object from storage
2909
- function _commitmentSettlement (Commitment storage commitment ) internal returns (bool success ) {
2961
+ function _settleCommitment (Commitment storage commitment ) internal returns (bool success ) {
2910
2962
commitment.met = commitment.reportedValue > commitment.goalValue;
2911
2963
2912
2964
if (! commitment.met) {
@@ -2920,7 +2972,7 @@ contract SinglePlayerCommit is ChainlinkClient, Ownable {
2920
2972
/// @notice Contract owner can withdraw funds not owned by committers. E.g. slashed from failed commitments
2921
2973
/// @param amount Amount of <token> to withdraw
2922
2974
/// @dev Check amount against slashedBalance, transfer amount and update slashedBalance
2923
- function ownerWithdraw (uint256 amount ) public onlyOwner returns (bool ) {
2975
+ function ownerWithdraw (uint256 amount ) public onlyOwner returns (bool success ) {
2924
2976
console.log ("Received call for owner withdrawal for amount %s " , amount);
2925
2977
2926
2978
require (amount <= slashedBalance, "SPC::ownerWithdraw - not enough available balance " );
@@ -3114,7 +3166,7 @@ contract SinglePlayerCommit is ChainlinkClient, Ownable {
3114
3166
3115
3167
/// @notice Get address for ChainLink token contract
3116
3168
/// @dev ChainLink contract method
3117
- function getChainlinkToken () public view returns (address ) {
3169
+ function getChainlinkToken () public view returns (address tokenAddress ) {
3118
3170
return chainlinkTokenAddress ();
3119
3171
}
3120
3172
0 commit comments