Skip to content

Commit

Permalink
fix(rng): properly set WRv2's operator
Browse files Browse the repository at this point in the history
  • Loading branch information
guidiaz committed Mar 22, 2024
1 parent 2c6bf22 commit b22b6de
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions contracts/apps/WitnetRandomnessV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ contract WitnetRandomnessV2
bytes32 immutable public override witnetRadHash;

constructor(
WitnetOracle _witnet
WitnetOracle _witnet,
address _operator
)
Ownable(address(msg.sender))
Ownable(_operator)
UsingWitnet(_witnet)
{
_require(
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/WitnetMockedRandomness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ import "../apps/WitnetRandomnessV2.sol";
/// @dev BY THE WITNET FOUNDATION.
contract WitnetMockedRandomness is WitnetRandomnessV2 {
constructor(WitnetMockedOracle _wrb)
WitnetRandomnessV2(_wrb)
WitnetRandomnessV2(_wrb, msg.sender)
{}
}
2 changes: 1 addition & 1 deletion migrations/addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"WitnetOracleDataLib": "0x25d57Cf8a047B14172Ba2a929C1441E1A77c3f9D",
"WitnetOracleTrustableOvm2": "0xeE04B260D4aBE8ABb2BB174D33b2C8731d518DdE",
"WitnetPriceFeedsDefault": "0xa07f16b1312d68bcDed1AD1164F644b309F96d06",
"WitnetRandomnessV2": "0xc0fFee99E1E2bA8C92E714eCCD886AF005AFB06B",
"WitnetRandomnessV2": "",
"WitnetRequestBytecodesDefault": "0x2D8BCBC4F8c97CC227e770d95d19914324baBF2A",
"WitnetRequestFactoryDefault": "0x3D551165020a4014A8d5b9E4b73D2b3Dbe401546"
},
Expand Down
2 changes: 1 addition & 1 deletion migrations/constructorArgs.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"WitnetPriceFeedsDefault": ""
},
"optimism:sepolia": {
"WitnetRandomnessV2": "00000000000000000000000077703ae126b971c9946d562f41dd47071da00777",
"WitnetRandomnessV2": "00000000000000000000000077703ae126b971c9946d562f41dd47071da00777000000000000000000000000f121b71715e71dded592f1125a06d4ed06f0694d",
"WitnetRequestBytecodesDefault": "0000000000000000000000000000000000000000000000000000000000000001322e302e382d3465626434366300000000000000000000000000000000000000",
"WitnetRequestFactoryDefault": "00000000000000000000000077703ae126b971c9946d562f41dd47071da00777000000000000000000000000000b61fe075f545fd37767f403916582759000000000000000000000000000000000000000000000000000000000000000000001322e302e382d3465626434366300000000000000000000000000000000000000",
"WitnetOracleTrustableOvm2": "000000000000000000000000000db36997af1f02209a6f995883b9b699900000000000000000000000000000000b61fe075f545fd37767f403916582759000000000000000000000000000000000000000000000000000000000000000000001322e302e382d3465626434366300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e3aa000000000000000000000000000000000000000000000000000000000000fef90000000000000000000000000000000000000000000000000000000000010faa0000000000000000000000000000000000000000000000000000000000004e20",
Expand Down
5 changes: 3 additions & 2 deletions migrations/scripts/5_apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ module.exports = async function (_, network, [, from]) {
key: "WitnetRandomness",
specs: specs.WitnetRandomness,
intrinsics: {
types: ["address"],
types: ["address", "address"],
values: [
/* _witnet */ await determineProxyAddr(from, specs.WitnetOracle?.vanity || 3),
/* _witnetOracle */ await determineProxyAddr(from, specs.WitnetOracle?.vanity || 3),
/* _witnetOperator */ utils.isDryRun(network) ? from : specs?.WitnetRandomness?.from || from,
],
},
})
Expand Down

0 comments on commit b22b6de

Please sign in to comment.