Skip to content

Commit 64b9bd4

Browse files
Merge pull request #354 from kleros/feat/chainlink-rng
feat: update chainlink version and remove RNG
2 parents d570e96 + 2eb1849 commit 64b9bd4

File tree

3 files changed

+2954
-3156
lines changed

3 files changed

+2954
-3156
lines changed

contracts/standard/rng/ChainlinkRNG.sol

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
pragma solidity ^0.6.6;
99

1010
import "@chainlink/contracts/src/v0.6/VRFConsumerBase.sol";
11-
import "./RNG.sol";
12-
1311

1412
interface IKlerosLiquid {
1513
function passPhase() external;
@@ -26,7 +24,7 @@ interface IKlerosLiquid {
2624
* @dev Chainlink documentation: https://docs.chain.link/docs/chainlink-vrf/
2725
* @dev For SECURITY CONSIDERATIONS, you might also have look to: https://github.com/smartcontractkit/chainlink/blob/master/evm-contracts/src/v0.6/VRFConsumerBase.sol
2826
*/
29-
contract ChainlinkRNG is RNG, VRFConsumerBase {
27+
contract ChainlinkRNG is VRFConsumerBase {
3028

3129
/* Storage */
3230

@@ -96,17 +94,11 @@ contract ChainlinkRNG is RNG, VRFConsumerBase {
9694

9795
/**
9896
* @dev Requests a random number.
99-
* @dev The _seed parameter is vestigial, and is kept only for API
100-
* @dev compatibility with older versions. It can't *hurt* to mix in some of
101-
* @dev your own randomness, here, but it's not necessary because the VRF
102-
* @dev oracle will mix the hash of the block containing your request into the
103-
* @dev VRF seed it ultimately uses.
104-
* @param _seed seed mixed into the input of the VRF.
10597
* @return requestId unique ID for this request.
10698
*/
107-
function requestRN(uint _seed) external onlyByKleros returns (bytes32 requestId) {
99+
function requestRN() external onlyByKleros returns (bytes32 requestId) {
108100
require(LINK.balanceOf(address(this)) >= fee, "ChainlinkRNG: not enough LINK to pay the fee");
109-
return requestRandomness(keyHash, fee, _seed);
101+
return requestRandomness(keyHash, fee);
110102
}
111103

112104
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"dependencies": {
5656
"@kleros/kleros": "^0.1.2",
5757
"@realitio/realitio-contracts": "^2.0.5",
58-
"@chainlink/contracts": "^0.1.7",
58+
"@chainlink/contracts": "0.2.0",
5959
"minimetoken": "^0.2.0",
6060
"openzeppelin-solidity": "^1.12.0",
6161
"web3-utils": "^1.2.1"

0 commit comments

Comments
 (0)