Skip to content

Commit 491a01e

Browse files
committed
hm
1 parent 63733b3 commit 491a01e

File tree

6 files changed

+492
-21
lines changed

6 files changed

+492
-21
lines changed

pnpm-lock.yaml

Lines changed: 485 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

target_chains/ethereum/contracts/contracts/entropy/Entropy.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import "@pythnetwork/entropy-sdk-solidity/EntropyEvents.sol";
99
import "@pythnetwork/entropy-sdk-solidity/IEntropy.sol";
1010
import "@pythnetwork/entropy-sdk-solidity/IEntropyConsumer.sol";
1111
import "@openzeppelin/contracts/utils/math/SafeCast.sol";
12-
import "ExcessivelySafeCall/ExcessivelySafeCall.sol";
12+
import "@nomad-xyz/excessively-safe-call/src/ExcessivelySafeCall.sol";
1313
import "./EntropyState.sol";
1414

1515
// Entropy implements a secure 2-party random number generation procedure. The protocol
@@ -500,7 +500,6 @@ abstract contract Entropy is IEntropy, EntropyState {
500500
bytes memory ret;
501501
(success, ret) = callAddress.excessivelySafeCall(
502502
gasleft(), // TODO: providers need to be able to configure this in the future.
503-
0,
504503
256, // copy at most 256 bytes of the return value into ret.
505504
abi.encodeWithSelector(
506505
IEntropyConsumer._entropyCallback.selector,

target_chains/ethereum/contracts/forge-test/Entropy.t.sol

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -972,10 +972,6 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents {
972972
uint64 assignedSequenceNumber = consumer.requestEntropy{value: fee}(
973973
userRandomNumber
974974
);
975-
EntropyStructs.Request memory req = random.getRequest(
976-
provider1,
977-
assignedSequenceNumber
978-
);
979975

980976
// On the first attempt, the transaction should succeed and emit CallbackFailed event.
981977
bytes memory revertReason = abi.encodeWithSelector(
@@ -1350,9 +1346,7 @@ contract EntropyConsumer is IEntropyConsumer {
13501346
// Keep consuming gas until we reach our target
13511347
while (currentGasUsed < targetGasUsage) {
13521348
// Consume gas with a hash operation
1353-
bytes32 hash = keccak256(
1354-
abi.encodePacked(currentGasUsed, _randomness)
1355-
);
1349+
keccak256(abi.encodePacked(currentGasUsed, _randomness));
13561350
currentGasUsed = startGas - gasleft();
13571351
}
13581352

target_chains/ethereum/contracts/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"migrate": "truffle migrate",
2424
"receiver-submit-guardian-sets": "truffle exec scripts/receiverSubmitGuardianSetUpgrades.js",
2525
"verify": "truffle run verify $npm_config_module@$npm_config_contract_address --network $npm_config_network",
26-
"install-forge-deps": "forge install foundry-rs/[email protected] nomad-xyz/ExcessivelySafeCall@81cd99c --no-git --no-commit",
26+
"install-forge-deps": "forge install foundry-rs/[email protected] --no-git --no-commit",
2727
"coverage": "./coverage.sh",
2828
"test:format": "prettier --check .",
2929
"fix:format": "prettier --write ."
@@ -39,6 +39,7 @@
3939
"@openzeppelin/contracts": "=4.8.1",
4040
"@openzeppelin/contracts-upgradeable": "=4.8.1",
4141
"@openzeppelin/hardhat-upgrades": "^1.22.1",
42+
"@nomad-xyz/excessively-safe-call": "^0.0.1-rc.1",
4243
"@pythnetwork/contract-manager": "workspace:*",
4344
"@pythnetwork/entropy-sdk-solidity": "workspace:*",
4445
"@pythnetwork/pyth-sdk-solidity": "workspace:*",

target_chains/ethereum/contracts/remappings.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
@pythnetwork/=./node_modules/@pythnetwork/
44
ds-test/=lib/forge-std/lib/ds-test/src/
55
forge-std/=lib/forge-std/src/
6-
ExcessivelySafeCall=lib/ExcessivelySafeCall/src/
6+
@nomad-xyz=./node_modules/@nomad-xyz/
77
truffle/=./node_modules/truffle/

target_chains/ethereum/entropy_sdk/solidity/EntropyConstants.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: Apache 2
2+
13
library EntropyConstants {
24
// Status values for Request.status //
35
// not a request with callback

0 commit comments

Comments
 (0)