-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding changes to VRF coordinator (#12099)
* VRF V2.5 gas optimisations (#11932) * VRF V2.5 gas optimisations * Minor changes * Removed changes in SubscriptionAPI.sol due to no actual gain in hot paths * Minor changes * VRF-878 Gas Optimization V2 Plus (#11982) * Optimize deregisterProvingKey * Optimize fulfillRandomWords * Optimize deregisterMigratableCoordinator * Optimize _isTargetRegistered * Optimize pendingRequestExists * Optimize _deleteSubscription * Optimize getActiveSubscriptionIds * Optimize requestRandomWords * Replace post-increment with pre-increment * Optimize _getFeedData * Optimize ownerCancelSubscription * Optimize getSubscription * Optimize createSubscription * Optimize requestSubscriptionOwnerTransfer * Optimize acceptSubscriptionOwnerTransfer * Optimize addConsumer * Update geth wrappers * Remove proving keys length check in pendingRequestExists * Add native payment to RandomWordsFulfilled event (#12085) * Add native payment to RandomWordsFulfilled event * Minor change --------- Co-authored-by: Sri Kidambi <[email protected]> --------- Co-authored-by: Sri Kidambi <[email protected]> Co-authored-by: Lee Yik Jiun <[email protected]> Co-authored-by: Lee Yik Jiun <[email protected]>
- Loading branch information
1 parent
902f3e7
commit 2b6fe5c
Showing
9 changed files
with
206 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
echo " ┌──────────────────────────────────────────────┐" | ||
echo " │ Compiling VRF contracts... │" | ||
echo " └──────────────────────────────────────────────┘" | ||
|
||
SOLC_VERSION="0.8.6" | ||
OPTIMIZE_RUNS=1000000 | ||
|
||
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" | ||
ROOT="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; cd ../../ && pwd -P )" | ||
python3 -m pip install --require-hashes -r "$SCRIPTPATH"/requirements.txt | ||
|
||
solc-select install $SOLC_VERSION | ||
solc-select use $SOLC_VERSION | ||
export SOLC_VERSION=$SOLC_VERSION | ||
|
||
compileContract () { | ||
local contract | ||
contract=$(basename "$1" ".sol") | ||
|
||
solc @openzeppelin/="$ROOT"/contracts/node_modules/@openzeppelin/ --overwrite --optimize --optimize-runs $OPTIMIZE_RUNS --metadata-hash none \ | ||
-o "$ROOT"/contracts/solc/v$SOLC_VERSION/"$contract" \ | ||
--abi --bin --allow-paths "$ROOT"/contracts/src/v0.8,"$ROOT"/contracts/node_modules\ | ||
"$ROOT"/contracts/src/v0.8/"$1" | ||
} | ||
|
||
compileContractAltOpts () { | ||
local contract | ||
contract=$(basename "$1" ".sol") | ||
|
||
solc @openzeppelin/="$ROOT"/contracts/node_modules/@openzeppelin/ --overwrite --optimize --optimize-runs "$2" --metadata-hash none \ | ||
-o "$ROOT"/contracts/solc/v$SOLC_VERSION/"$contract" \ | ||
--abi --bin --allow-paths "$ROOT"/contracts/src/v0.8,"$ROOT"/contracts/node_modules\ | ||
"$ROOT"/contracts/src/v0.8/"$1" | ||
} | ||
|
||
# VRF | ||
compileContract vrf/VRFRequestIDBase.sol | ||
compileContract vrf/VRFConsumerBase.sol | ||
compileContract vrf/testhelpers/VRFConsumer.sol | ||
compileContract vrf/testhelpers/VRFRequestIDBaseTestHelper.sol | ||
compileContract vrf/mocks/VRFCoordinatorMock.sol | ||
|
||
# VRF V2Plus | ||
compileContract vrf/dev/interfaces/IVRFCoordinatorV2PlusInternal.sol | ||
compileContract vrf/dev/testhelpers/VRFV2PlusConsumerExample.sol | ||
compileContractAltOpts vrf/dev/VRFCoordinatorV2_5.sol 50 | ||
compileContract vrf/dev/BatchVRFCoordinatorV2Plus.sol | ||
compileContract vrf/dev/VRFV2PlusWrapper.sol | ||
compileContract vrf/dev/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol | ||
compileContract vrf/dev/testhelpers/VRFMaliciousConsumerV2Plus.sol | ||
compileContract vrf/dev/testhelpers/VRFV2PlusExternalSubOwnerExample.sol | ||
compileContract vrf/dev/testhelpers/VRFV2PlusSingleConsumerExample.sol | ||
compileContract vrf/dev/testhelpers/VRFV2PlusWrapperConsumerExample.sol | ||
compileContract vrf/dev/testhelpers/VRFV2PlusRevertingExample.sol | ||
compileContract vrf/dev/testhelpers/VRFConsumerV2PlusUpgradeableExample.sol | ||
compileContract vrf/dev/testhelpers/VRFV2PlusMaliciousMigrator.sol | ||
compileContract vrf/dev/libraries/VRFV2PlusClient.sol | ||
compileContract vrf/dev/testhelpers/VRFCoordinatorV2Plus_V2Example.sol | ||
compileContract vrf/dev/BlockhashStore.sol | ||
compileContract vrf/dev/TrustedBlockhashStore.sol | ||
compileContract vrf/dev/testhelpers/VRFV2PlusLoadTestWithMetrics.sol | ||
compileContractAltOpts vrf/dev/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol 5 | ||
compileContract vrf/dev/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.